requirements

This commit is contained in:
Mari Wahl 2014-12-28 16:23:24 -05:00
parent fc0dea98ec
commit 4e13f2ba45
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/usr/bin/env python
__author__ = "bt3"
import sys
import random
from scapy.all import IP, TCP, send
def send_syn(dest, src=None, sport=1234, dport=80):
pkt = IP(dst=dest,src=src)/TCP(sport=sport,dport=dport,flags="S")
send(pkt)
def scan_ip(dest):
for i in range(1, 65535):
send_syn(dest, sport=random.randint(21024, 51024))
if __name__ == '__main__':
if len(sys.argv) > 1:
scan_ip(sys.argv[1])
else:
print 'Usage: scan_ip <destination>'

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
__author__ = "bt3"
import sys
from scapy.all import *
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 __name__ == '__main__':
scan_port()

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
scapy==2.2.0-dev