Header Banner
Null Byte Logo
Null Byte
wonderhowto.mark.png
Cyber Weapons Lab Forum Metasploit Basics Facebook Hacks Password Cracking Top Wi-Fi Adapters Wi-Fi Hacking Linux Basics Mr. Robot Hacks Hack Like a Pro Forensics Recon Social Engineering Networking Basics Antivirus Evasion Spy Tactics MitM Advice from a Hacker

How to Make a Simple UDP_Flooder in C pt1.

Feb 22, 2016 03:50 AM
Feb 22, 2016 04:06 AM
Coding Drunk with a fish illustration

Alright, this will be my first tutorial in C.

Note that this guide is written for Linux.

This won't be very easy if you don't know the basics of C, so if you don't I suggest looking into dontrustme's awesome C tutorials first.

READ THIS FIRST

Alright here is the deal, this UDP flooder should NEVER, EVER be used outside your LAN. The reason being, apart from the fact you shouldn't ofcourse use it illegally, that there is a chance your ISP will shut you down for breaking the terms of agreement.

How Does UDP Flooding Work?

UDP Works by sending lots of UDP packets to random closed ports on a server. The server will process each received UDP packet and send back an ICMP packet saying the port is closed. Because of all the trafic this creates the server will eventually be unable to process traffic, causing denial of service.

So What Do We Need?

We need a program that sends a lot of UDP packets to different ports.

in pseudo code:

#include socketheaders

struct sockaddr targetAddr

main() {

sock (udp)

targetAddr.ipaddr = <target ip>

while(true) {

. . for(i=10000;i<60000;i++) {

. . . . targetAddr.port = i

. . . . sendto(sock, msg, targetAddr)

. . }

}

}

Homework

That's right, home work! I want you to first try and write it yourself.

Check the following man pages:

man socket, man 2 socket, man 7 socket, man sendto

Also take a look in the header files, sys/socket.h, arpa/inet.h

In part two we will go trough my version of the program and ways to mitigate this attack ;)

That's it for now, good luck with coding ^^.

EDIT: Beej also has a great deal of info on sockets found here ~ thx dtm, for the suggestion

You already know how to use your phone. With Gadget Hacks' newsletter, we'll show you how to master it. Each week, we explore features, hidden tools, and advanced settings that give you more control over iOS and Android than most users even know exists.

Sign up for Gadget Hacks Weekly and start unlocking your phone's full potential.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!