Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import scapy.all as scapy
- scapy.conf.verb=0
- import os
- import socket
- print "PRIMER PASO"
- p=scapy.IP(dst="192.168.1.4")/scapy.TCP(flags="SA")
- ans,unans = scapy.sr(p)
- for s,r in ans:
- f=r[scapy.TCP].seq
- print +f
- print "SEGUNDO PASO"
- q=scapy.IP(src="192.168.1.4",dst="192.168.1.1")/scapy.TCP(dport=[80],flags="S")
- scapy.send(q)
- print "TERCER PASO"
- ans,unans = scapy.sr(p)
- for s,r in ans:
- e=r[scapy.TCP].seq
- print +e
- print "PRUEBA DE PID"
- if e > f:
- print "AUMENTO EL CONTADOR"
- else:
- print "NO AUMENTO EL CONTADOR"
Add Comment
Please, Sign In to add comment