{"id":19257629,"url":"https://github.com/milesrack/pynet","last_synced_at":"2025-07-09T03:03:35.769Z","repository":{"id":150960533,"uuid":"389745330","full_name":"milesrack/pynet","owner":"milesrack","description":"A proof-of-concept botnet written in Python.","archived":false,"fork":false,"pushed_at":"2021-07-26T19:26:20.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T14:55:52.550Z","etag":null,"topics":["botnet","botnet-python","proof-of-concept","python","python3","sockets"],"latest_commit_sha":null,"homepage":"","language":"Python","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/milesrack.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-26T19:24:05.000Z","updated_at":"2024-02-19T10:48:17.000Z","dependencies_parsed_at":"2023-04-30T12:01:14.484Z","dependency_job_id":null,"html_url":"https://github.com/milesrack/pynet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/milesrack/pynet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fpynet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fpynet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fpynet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fpynet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milesrack","download_url":"https://codeload.github.com/milesrack/pynet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fpynet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260005967,"owners_count":22944867,"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","botnet-python","proof-of-concept","python","python3","sockets"],"created_at":"2024-11-09T19:10:57.308Z","updated_at":"2025-06-15T16:08:09.832Z","avatar_url":"https://github.com/milesrack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pynet :snake:\nA proof-of-concept botnet written in Python.\n\n## :pushpin: Installation\n```\ngit clone https://github.com/milesrack/pynet.git\ncd pynet\npip3 install -r requirements.txt\n```\n\n## :pushpin: Usage\n### Changing Settings\nBefore running the script edit `settings.py`. You will need to change `BIND_IP` and `DB_URI`, everything else can stay as it is.\n\n### Starting the Server\nTo start the server:\n```\npython3 server.py\n```\nThis will begin listening for connections from infected machines, listen for user connections, and start a web server which serves the payload. A `public` directory will be created which contains the following files:\n- `infect.sh`: Installs Python, downloads `client.py`, and sets up persistence for Linux machines (requires root access because of raw sockets).\n- `infect.bat`: Streams the data from `infect.ps1` into powershell without writing to the disk (bypasses execution policy).\n- `infect.ps1`: Installs Python, downloads `client.py`, and sets up persistence for Windows machines.\n- `client.py`: Recieves commands from server and executes them.\n\n### Infecting Machines\n**Linux payload:** `http://\u003cBIND_IP\u003e:\u003cWEB_PORT\u003e/infect.sh`\n\n**Windows payload:** `http://\u003cBIND_IP\u003e:\u003cWEB_PORT\u003e/infect.bat`\n\n### Creating a User\nBefore you log into the server, you must create a user:\n```\npython3 manage.py create\n```\nYou can use the `manage.py` script to list, create, update, and delete users. Run `python3 manage.py` (without arguments) for help.\n\n### Logging In\nTo log into the server, make a raw TCP connection to `\u003cBIND_IP\u003e:\u003cCOMMAND_PORT\u003e`. You can use netcat (Linux), PuTTY (Windows), or anything that allows raw TCP connections. From there you will be prompted for your username and password.\n\n### Executing Commands\nOnce you are logged in, run `help` to see the available commands and their usage.\n\n## :pushpin: Improvements\nThis project was just done for learning purposes. It could be improved by encrypting the commands sent over raw TCP sockets (by default this is plaintext). This would prevent unauthorized people from sending commands to the bots and make analysis slightly harder. Another improvement would be to rewrite the client end in a compiled language.\n\n## :warning: Disclaimer\nDo not use this code for anything malicous. Only infect machines that you own or have permission to infect.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesrack%2Fpynet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilesrack%2Fpynet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesrack%2Fpynet/lists"}