more scapy scripts

This commit is contained in:
Mari Wahl 2014-12-28 17:17:15 -05:00
parent d12c8a523a
commit 34d0cc0ae7
2 changed files with 39 additions and 6 deletions

View file

@ -11,12 +11,13 @@ DEST = '192.168.1.25'
def scan_port():
packet=IP(dst=DEST)/TCP(dport=(1,100),flags="S")
responded, unanswered = sr(packet, timeout=10, verbose=0)
print "List of all open ports in " + DEST
for a in responded:
if a[1][1].flags == 18:
print a[1].sport
if responded:
print "List of all open ports in: " + DEST
for a in responded:
if a[1][1].flags == 18:
print a[1].sport
else:
print "All ports in %s are closed." %DEST
if __name__ == '__main__':
scan_port()