{"id":13567106,"url":"https://github.com/evilsocket/kitsune","last_synced_at":"2025-05-07T09:44:56.330Z","repository":{"id":66844713,"uuid":"289677168","full_name":"evilsocket/kitsune","owner":"evilsocket","description":"🧠 🔎 🤖  Kitsune is an artificial neural network designed to detect and correlate Twitter profiles with similar behaviours.","archived":false,"fork":false,"pushed_at":"2022-06-06T00:37:03.000Z","size":47075,"stargazers_count":243,"open_issues_count":0,"forks_count":15,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-31T08:44:13.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evilsocket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-23T12:00:38.000Z","updated_at":"2025-03-24T00:17:56.000Z","dependencies_parsed_at":"2023-03-13T20:29:08.682Z","dependency_job_id":null,"html_url":"https://github.com/evilsocket/kitsune","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Fkitsune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Fkitsune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Fkitsune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilsocket%2Fkitsune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evilsocket","download_url":"https://codeload.github.com/evilsocket/kitsune/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252853587,"owners_count":21814549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:23.787Z","updated_at":"2025-05-07T09:44:56.309Z","avatar_url":"https://github.com/evilsocket.png","language":"Python","readme":"# Kitsune\n\nAn artificial neural network designed to detect and correlate Twitter profiles with similar behaviours, originally developed to detect automated Twitter accounts (bots), but that can be used for any custom list of accounts.\n\n## Requirements\n\nMake sure you have python3 and pip3 installed, then proceed to install the requirements:\n\n    cd /path/to/kitsune\n    sudo pip3 install -r requirements.txt\n\n## Using the existing model\n\nTo test the model predictions on a profile folder (that you will need to download with `download.py` as explained in the training section) or multiple folders at once:\n\n     /path/to/kitsune/test.py \\\n        --model /path/to/kitsune/model.h5 \\\n        --profile /path/to/profile-data-folder\n\n    writing predictions to /path/to/profile-data-folder/predictions.csv ...\n\n    -------\n\n            screen_name | class | confidence\n\n        someusername   bot     100.000000 %\n        someusername   bot     99.893301 %\n        someusername   bot     99.999895 %\n        someusername   bot     99.993192 %\n        someusername   bot     66.441199 %\n        someusername   bot     99.981043 %\n        someusername   bot     99.999995 %\n        someusername   bot     99.999995 %\n        someusername   bot     99.760059 %\n\n## Training a new model\n\nYou'll need to create two folders, in this example we'll create a `bots` folder and a `legit` folder. Place in each one a file named `seed.txt` with the list of accounts you want to be classified in that group, so that you'll have:\n\n    /path/to/bots/seed.txt\n    /path/to/legit/seed.txt\n\nIdeally the two lists should cointain the same number accounts, at least in the order of one hundred each. The more accounts you'll use and the more accurately they're grouped, the more accurate the model will be.\n\nDownload the last tweets and profile data for each list:\n\n    /path/to/kitsune/download.py \\\n        --consumer_key TWITTER_CONSUMER_KEY \\\n        --consumer_secret TWITTER_CONSUMER_SECRET \\\n        --access_token TWITTER_ACCESS_TOKEN \\\n        --access_token_secret TWITTER_ACCESS_SECRET \\\n        --seed /path/to/bots/seed.txt \\\n        --output /path/to/bots\n\nand then:\n\n    /path/to/kitsune/download.py \\\n        --consumer_key TWITTER_CONSUMER_KEY \\\n        --consumer_secret TWITTER_CONSUMER_SECRET \\\n        --access_token TWITTER_ACCESS_TOKEN \\\n        --access_token_secret TWITTER_ACCESS_SECRET \\\n        --seed /path/to/legit/seed.txt \\\n        --output /path/to/legit\n\nNow it's time to transform this data into numerical features in a CSV file that kitsune can understand (for the complete features set seet [kitsune/features.py](https://github.com/evilsocket/kitsune/blob/master/kitsune/features.py), keeping in mind this file is changing and improving very fast at this stage):\n\n    /path/to/kitsune/encode.py \\\n        --label_a bot --path_a /path/to/bots \\\n        --label_b legit --path_b /path/to/legit \\\n        --output /path/to/dataset.csv\n\nOnce this is done, you can train the model:\n\n     /path/to/kitsune/train.py \\\n        --dataset /path/to/dataset.csv \\\n        --output /path/to/model.h5\n        \nThis will start the training, print accuracy metrics and save the model, normalization values and features relevances in the folder you specified.\n\n    normalizing dataset ...\n    data shape: (1797, 198) (197 features)\n    bots:541 legit:1256\n    generating train, test and validation datasets (test=0.150000 validation=0.150000) ...\n    unique labels: 2\n    building neural network for: inputs=197 outputs=2\n    ...\n    training model ...\n    Epoch 1/100\n    79/79 - 0s - loss: 0.3349 - binary_crossentropy: 0.3349 - binary_accuracy: 0.8568 - val_loss: 0.1520 - val_binary_crossentropy: 0.1520 - val_binary_accuracy: 0.9442\n    Epoch 2/100\n    79/79 - 0s - loss: 0.1685 - binary_crossentropy: 0.1685 - binary_accuracy: 0.9300 - val_loss: 0.1346 - val_binary_crossentropy: 0.1346 - val_binary_accuracy: 0.9480\n    Epoch 3/100\n    ...\n    79/79 - 0s - loss: 0.0130 - binary_crossentropy: 0.0130 - binary_accuracy: 0.9960 - val_loss: 0.0627 - val_binary_crossentropy: 0.0627 - val_binary_accuracy: 0.9777\n\n## License\n\n`kitsune` is made with ♥ by [@evilsocket](https://twitter.com/evilsocket) and it is released under the GPL3 license.        \n","funding_links":[],"categories":["Python","Pentesting"],"sub_categories":["OSINT - Open Source INTelligence"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilsocket%2Fkitsune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilsocket%2Fkitsune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilsocket%2Fkitsune/lists"}