{"id":38345055,"url":"https://github.com/secnot/leaky_diode","last_synced_at":"2026-01-17T03:02:39.405Z","repository":{"id":62575468,"uuid":"301191245","full_name":"secnot/leaky_diode","owner":"secnot","description":"Leaky diode is a data exfiltration test tool for data diodes.","archived":false,"fork":false,"pushed_at":"2020-10-06T12:57:00.000Z","size":41,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-29T22:13:18.923Z","etag":null,"topics":["cybersecurity","data","diodes","exfiltration","pentesting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secnot.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":"2020-10-04T17:52:44.000Z","updated_at":"2024-08-19T17:29:30.000Z","dependencies_parsed_at":"2022-11-03T20:42:35.524Z","dependency_job_id":null,"html_url":"https://github.com/secnot/leaky_diode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secnot/leaky_diode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secnot%2Fleaky_diode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secnot%2Fleaky_diode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secnot%2Fleaky_diode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secnot%2Fleaky_diode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secnot","download_url":"https://codeload.github.com/secnot/leaky_diode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secnot%2Fleaky_diode/sbom","scorecard":{"id":809036,"data":{"date":"2025-08-11","repo":{"name":"github.com/secnot/leaky_diode","commit":"a7a04f8d21c2730f849911cb3925e6875e704a00"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T12:36:35.086Z","repository_id":62575468,"created_at":"2025-08-23T12:36:35.086Z","updated_at":"2025-08-23T12:36:35.086Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cybersecurity","data","diodes","exfiltration","pentesting"],"created_at":"2026-01-17T03:02:34.839Z","updated_at":"2026-01-17T03:02:39.380Z","avatar_url":"https://github.com/secnot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaky Diodes\n\nLeaky diode is a data exfiltration test tool for *smart* data diodes, that is \ndata diodes with support for TCP pass-through with the help of some side channel\nfrom the isolated side. The attacks used are **flow modulation** and/or \n**close delay**:\n\n- **CLOSE DELAY** uses the delay between the request of one the secret's bits and\nthe time the server closes the connection to encode the bit value. (i.e.- 10 seconds\ndelay means a 0, 30 seconds delay a 1)\n\n- **FLOW MODULATION** uses tcp flow control mechanism to encode secret's bits as\na transfer speed. For example if the the bit requested by the client is 1 the server\nthrottles the speed to 300KB/s, if it's 0 to 100KB/s. The advantage of this attack is\nthat using a single connection makes it harder to detect.\n\n\n## Installation\n\nDownload the package or clone the repository, and then install with:\n\n```bash\npython3 setup.py install\n```\n\nor use pypi:\n\n```bash\npip3 install leaky_diode --user\n```\n\nor\n\n```bash\nsudo pip3 install leaky_diode\n```\n\nthe path to the scripts if not installed as root will be:\n\n```bash\n/home/[username]/.local/bin/leaky_client\n/home/[username]/.local/bin/leaky_server\n```\n\n\n## Usage\n\nOn the isolated side launch the server:\n\n```bash\nleaky_server public_ip port 'secret string that needs leaking'\n```\n\nOn the untrusted side launch the client and select one of the attacks,\n\n```bash\nleaky_client server_ip server_port --mode flow --partial\n```\n\nor\n\n```bash\nleaky_client server_ip server_port --mode close --partial\n```\n\nAnd just wait a few minutes to receive the first byte (it's the slowest), if you're not sure\nif it's working add --verbose option so it prints messages on each received bit.\n \n\n## Options\n\n```bash\nusage: leaky_client [-h] [--mode mode] [--low_delay delay] [--high_delay delay] [--low_rate rate] \n\t\t\t\t\t[--high_rate rate] [--sample_time time] [--settle_time time] [--partial]\n                    host port\n\nLeaky Diode is a data exfiltration test tool for data diodes\n\npositional arguments:\n  host                  Remore host address\n  port                  Remote host port\n\noptional arguments:\n  -h, --help            Show this help message and exit\n  --mode mode, -m mode  Attack mode 'flow' or 'close' (default: flow)\n  --low_delay delay     Close delay for low bits (default: 5s) (only Close Mode)\n  --high_delay delay    Close delay for high bits (default: 10s) (only Close Mode)\n  --low_rate rate       Tx rate for low bits (default: 64 KB/s) (only Flow Mode)\n  --high_rate rate      Tx rate for high bits (default: 300 KB/s) (only Flow Mode)\n  --sample_time time    Tx rate sampling interval (default: 3.0s) (only Flow Mode)\n  --settle_time time    Settle time between sending a bit request and the start of \n                        sampling (default: 8.0s) (only Flow Mode)\n  --partial             Show partial results each time another byte from the secret is received\n  --verbose             Show debugging messages\n```\n\n```bash\nusage: leaky_server [-h] host port secret_string\n\nLeaky Diode is a data exfiltration test tool for data diodes\n\npositional arguments:\n  host           Remore host address\n  port           Remote host port\n  secret_string  Attack mode 'flow' or 'close' (default: a secret string)\n\noptional arguments:\n  -h, --help     Show this help message and exit\n  -v, --verbose  Show debugging messages\n```\n\n## Performance\n\nThe attack throughput with the default parameters is around 1 B/min (yes, one byte per minute),\nyou can increase it by lowering the delay times in **close delay** mode, and the settle/sample\ntimes in **flow modulation** (the default values are very conservative)\n\nAn actual exfiltration attempt using this attack could easily leak a few KB per day, too slow\nfor large breachs, but enough for targeted attacks for keys/passwords or selected users data.\n\n\n## API\n\nIt is also possible to use leaky_diode as a package and include a server in your own app:\n\n\n* class LeakyServer(host, port, secret, ticks=100, max_connections=10)\n\n\t* host: (str) Listen interface ip addres ('' for all)\n\t* port: (int) Listen port\n\t* secret: (bytes) Secret to leak (max length 65535)\n\t* ticks: (int) Ticks per second the worker process use to throttle the connections.\n\t* max_connections: (int) Max concurrent connection the server can handle.\n\n\t* **start()**: Initialize and launch server worker processes\n    * **stop()**: Stop server and its workers\n\n   \n```python\nfrom leaky_diode import LeakyServer\n\nleaky_server = LeakyServer('192.168.0.10', 9000, b'some secret byte string')\nleaky_server.start()\n\n# Do something else\n......\n\n# Close server before exit\nleaky_server.close()\n``` \n\n\n## TODO\n\n- Harden message parsing input validation (invalid lengths)\n- Use concurrent connection to increase exfiltration speed.\n- Tune flow modulation mode tx speeds .\n- Tune close delay mode delays.\n- Add CRC to the secret and secret length, or even better error correction. \n- Add resume capability so there is no need to get the secret in one go.\n- Add some tests.\n\n\n## References\n\n- Data Diodes [Wikipedia](https://en.wikipedia.org/wiki/Unidirectional_network)\n- Place holder so I remember to publish a post on the attacks\n- And another on transport and streaming protocols for data diodes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecnot%2Fleaky_diode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecnot%2Fleaky_diode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecnot%2Fleaky_diode/lists"}