{"id":16161428,"url":"https://github.com/gamemann/udp-sender","last_synced_at":"2025-03-18T22:30:32.231Z","repository":{"id":92735912,"uuid":"243159665","full_name":"gamemann/UDP-Sender","owner":"gamemann","description":"A C program I made for sending UDP packets. Comes with a few useful features.","archived":false,"fork":false,"pushed_at":"2020-03-02T01:47:18.000Z","size":16,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T12:30:01.156Z","etag":null,"topics":["c","ip","linux","packet","send","socket","spoof","udp"],"latest_commit_sha":null,"homepage":"https://moddingcommunity.com/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gamemann.png","metadata":{"files":{"readme":"ReadME.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-02-26T03:29:03.000Z","updated_at":"2024-12-22T20:39:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"a57d3b7b-00b1-4cb1-82f3-e39bda4a3030","html_url":"https://github.com/gamemann/UDP-Sender","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/gamemann%2FUDP-Sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FUDP-Sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FUDP-Sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FUDP-Sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamemann","download_url":"https://codeload.github.com/gamemann/UDP-Sender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950813,"owners_count":20373664,"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":["c","ip","linux","packet","send","socket","spoof","udp"],"created_at":"2024-10-10T02:25:14.561Z","updated_at":"2025-03-18T22:30:32.226Z","avatar_url":"https://github.com/gamemann.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UDP Sender\n## Description\nA C program I made to send UDP packets to a specified destination IP and port via raw sockets. This program supports the following:\n\n* `pthreads` (multi-threading).\n* Specifying a source IP (including spoofing the IP).\n* Minimum and maximum payload length (randomized for each packet).\n* Randomized source ports (from 10000 to 60000).\n* Wait times (intervals) between sending packets on each thread.\n* Calculates both the IP Header and UDP Header checksums.\n\n**Note** - This program does not support packet fragmentation and there's really no point to add that support since that's not what the program is made for.\n\n## Why Did I Make This?\nI am currently learning more about in-depth packet inspection along with learning how (D)DoS attacks work. I made this program and only use it on my local network. I am planning to create a UDP server application that is capable of filtering (D)DoS attacks and blocking them using [XDP](https://en.wikipedia.org/wiki/Express_Data_Path) once detected. This tool will be used to test this server application I will be making. Eventually I will be making software that'll run on my Anycast network that will be capable of dropping detected (D)DoS attacks via XDP on all POP servers.\n\n## Compiling\nI used GCC to compile this program. You must add `-lpthread` at the end of the command when compiling via GCC.\n\nHere's an example:\n\n```\ngcc -g UDP_Sender.c -o UDP_Sender -lpthread\n```\n\n## Usage\nUsage is as follows:\n\n```\nUsage: ./UDP_Sender \u003cSource IP\u003e \u003cDestination IP\u003e \u003cDestination IP\u003e [\u003cMax\u003e \u003cMin\u003e \u003cInterval\u003e \u003cThread Count\u003e]\n```\n\nPlease note that the interval is in *microseconds*. The Min and Max payloads are in *bytes*. If you set the interval to 0, it will not wait between sending packets on each thread.\n\nHere's an example:\n\n```\n./UDP_Sender 192.168.80.10 10.50.0.4 27015 1000 1200 1000 3\n```\n\nThe above continuously sends packets to `10.50.0.4` (port `27015`) and appears from `192.168.80.10` (in my case, spoofed). It sends anywhere from `1000` - `1200` bytes of payload data every `1000` microseconds. It will send these packets from `3` threads.\n\n## To Do List\n* Pick source IPs from a configuration file on disk and randomize it for each packet.\n\n## Experiments\nI was able to push around 300 mbps (~23K PPS) using this program on my local network until it overloaded my router and VM (I have a lower-end Edge Router). This was with no interval set and using one thread. The VM sending the information had 6 vCPUs and the processor was an older Intel Xeon clocked at 2.4 GHz. This VM was also using around 90 - 95% CPU when having this program running.\n\n## Improvements\nI am still fairly new to C and network programming. Therefore, I'm sure there are improvements that can be made. If you see anything that can be improved, please let me know :)\n\n## Credits\n* [Christian Deacon](https://www.linkedin.com/in/christian-deacon-902042186/) (AKA Roy).\n* Online resources including Stack Overflow for help with calculating IP/UDP checksums.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fudp-sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamemann%2Fudp-sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fudp-sender/lists"}