Last active
December 25, 2015 18:39
-
-
Save truekonrads/bb4c6e0a179cbbd4ba40 to your computer and use it in GitHub Desktop.
fake a syn scan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6.7.8.9 | |
2.2.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# usage spoofsynscan.py srcmacpairs.txt dests.txt | |
# adjust gwmac to the mac of your gw and ports to the ports you want to "scan" | |
import sys | |
from scapy.all import * | |
import random | |
pairs=[] | |
gwmac="00:50:56:ff:d1:d1" | |
ports=[1521,5900,1527] | |
with file(sys.argv[1],"rb") as f: | |
for l in f.xreadlines(): | |
ip,srcmac=l.strip().split(" ") | |
pairs.append([ip,srcmac]) | |
dests=[] | |
with file(sys.argv[2],"rb") as f: | |
for l in f.xreadlines(): | |
dests.append(l.strip()) | |
for srcip,srcmac in pairs: | |
for p in ports: | |
sendp(Ether(src=srcmac,dst=gwmac)/IP(dst=random.choice(dests),src=srcip)/TCP(dport=p,flags="S")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.2.3.4 ff:ff:ff:00:00:00 | |
1.2.2.2 aa:bb:cc:dd:ee:ff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment