{"id":22021956,"url":"https://github.com/knightchaser/synfloodingplayground","last_synced_at":"2026-05-04T04:35:40.909Z","repository":{"id":188104362,"uuid":"678117052","full_name":"KnightChaser/SYNFloodingPlayground","owner":"KnightChaser","description":"A simple web-based playground where you can freely test SYN Flooding with hping3! Written in Flask, Python3.","archived":false,"fork":false,"pushed_at":"2023-08-14T04:28:05.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T16:46:41.126Z","etag":null,"topics":["ctf","doityourself","dos","experiment","synflood"],"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/KnightChaser.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}},"created_at":"2023-08-13T18:27:33.000Z","updated_at":"2023-08-16T03:01:42.000Z","dependencies_parsed_at":"2023-08-13T19:53:25.254Z","dependency_job_id":null,"html_url":"https://github.com/KnightChaser/SYNFloodingPlayground","commit_stats":null,"previous_names":["knightchaser/synfloodingplayground"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2FSYNFloodingPlayground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2FSYNFloodingPlayground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2FSYNFloodingPlayground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2FSYNFloodingPlayground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnightChaser","download_url":"https://codeload.github.com/KnightChaser/SYNFloodingPlayground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245086172,"owners_count":20558531,"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":["ctf","doityourself","dos","experiment","synflood"],"created_at":"2024-11-30T06:16:32.499Z","updated_at":"2026-05-04T04:35:35.877Z","avatar_url":"https://github.com/KnightChaser.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNFloodingPlayground\n\u003e A simple web-based playground where you can freely test SYN Flooding with hping3! Written in Flask, Python3.\n\u003cspan\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Python-FFD43B?style=for-the-badge\u0026logo=python\u0026logoColor=blue\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Flask-000000?style=for-the-badge\u0026logo=flask\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge\u0026logo=ubuntu\u0026logoColor=white\"\u003e\n\u003c/span\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n **Welcome to [KnightChaser](https://github.com/KnightChaser)'s SYN Flooding experiment playground!** (You don't know what `SYN FLOODING ATTACK` mean yet? Then, check [Wikipedia's detailed explanation](https://en.wikipedia.org/wiki/SYN_flood). This would be helpful for understanding.)\n\n The main goal of this playground is to generate lots of SYN packets(As default, 30 million accumulative SYN packets) with lots of tools dedicated to network attacks such as `hping3`, which is very popular. With any tool you prefer, try to attack the playground freely! You can watch the rapid increment of SYN packets you sent. (This playground shows how much did you send in the session.)\n\n If you send more SYN packets than specific threshold amounts, the playground will show you a secret flag(actually, it's stored in `/secret/flag.txt`. But Let's suppose you don't know where is the flag.). To get a flag, you conduct a SYN Flooding attack. It's like CTF(Capture The Flag), isn't it?\n\n\n## Build\n\n The program was written on Ubuntu 22.04. LTS on WSL2. This code likely does not work on Windows or other operating systems. I wrote this playground under the assumption of you are going to run this in a localhost environment(So, the attack and the victim reside on the same device.). If you are going to separate the attack role and server(victim), you may have to adjust some code. But don't worry, the code isn't complicated.\n\n- On Ubuntu(You must be able to run basic Linux commands, command `stat`, and command `tcpdump`.), Install **Python3** and **PIP(Package Installer for Python)** to install required Python packages.\n- With PIP, Install every component specified in `requirements.txt`.\n- Run `server.py` with the proper FLASK command. (ex. `flask run`)\n\n## How does it work?\n\n If the server(`server.py`) runs and the attacker enters `/`(`@app.route('/')`), The following command will run on the victim's system automatically. The command based on `tcpdump` will print a single line like `03:17:01.085514 IP 192.168.0.1.52756 \u003e 127.0.1.1.5000: Flags [S], seq 1821047614, win 512, length 0` per every single incoming SYN packet. So, each line of the command output is equivalent of 1 SYN packet arrival. \n```sh\nsudo tcpdump -i lo -l -n -Q in dst port 5000\n```\n\n To reduce the output size, I appended the `grep -o \"S\"` option with the pipeline(`|`). If I do so, the output from every SYN packet arrival will be just `S`. So, 200 SYN packets mean 200 `S` characters. I store the output in the file `./tcpdumplog`. Thus, the file size in Bytes will be the same as the total arrived SYN packets. That's how I measure how much SYN Flooding attack has been reached to the server in the session.\n```sh\nsudo tcpdump -i lo -l -n -Q in dst port 5000 | grep -o \"S\" \u003e ./tcpdumplog\n```\n\n For reference, only `./tcpdumplog`'s file size can be extracted by this simple command. `server.py` runs this command whenever it needs to fetch the accumulative SYN packet arrival count.\n```sh\nstat --printf=\"%s\" ./synfloodlog\n```\n\n## How can I exploit and get the content of `flag.txt`?\n\n Just do a SYN Flooing attack! If `server.py` runs on `127.0.0.1:5000` and you are going to use `hping3`, the attack payload will be:\n```sh\nsudo hping3 -S 127.0.1.1 -p 5000 -a 192.168.0.1 --flood\n```\n In my environment, only a single execution of that command can generate 500k ~ 1M SYN packets per second. If you run the command in multiple instances simultaneously, the attack speed will increase. (And highly likely they will consume more CPU and memory resources too.)\n\n You don't need to adhere to `hping3` only. Try to write a Python script, or use other tools too if you are interested!\n\n## Adjustable parts\n\n#### `server.py`\nYou can manually alter SYN Flooding log from `tcpdump`.\n```py\n# Where the file for accumulative SYN packets should be?\nsynflooding_count_file_path = \"./synfloodlog\"\n```\n\nYou can manually alter the location of `flag.txt`, and also can change `flag.txt`'s contents, too.\n```py\n# flag\n@app.route('/sh0wMYFLAGGGGGGGGGGGGG')\ndef give_flag():\n    # ...\n    current_path = os.path.abspath(os.path.dirname(__file__))\n    file_path = os.path.join(current_path, \"./secret/flag.txt\")\n```\n\n#### threshold\n`threshold` means how much accumulative SYN packets have to arrive at the server to reveal `flag`. Adjust the threshold value according to your device's capability, time, or other variables. When you change the threshold, Don't forget to synchronize the value both in `server.py` and `counter_template.html`.\n```py\n# server.py\n# flag\n@app.route('/sh0wMYFLAGGGGGGGGGGGGG')\ndef give_flag():\n\n    # verify\n    # Don't forget to synchronize this threshold variable with counter_template.js's!!\n    threshold = 30000000\n    # ...\n```\n```js\n// counter_template.html (JS in HTML file)\nvar count = document.getElementById(\"count\");\nvar threshold = 30000000;                       // Don't forget to synchronize this threshold variable with server.py's!!\n```\n\n## Issues\n\nIf you have any questions, suggestions, improvements, typos, errors, problems, or something else, Do not hesitate to make issues! I'll be glad to check them out.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightchaser%2Fsynfloodingplayground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknightchaser%2Fsynfloodingplayground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightchaser%2Fsynfloodingplayground/lists"}