Guest User

Untitled

a guest
Feb 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import scapy.all as scapy
  3. scapy.conf.verb=0
  4. import os
  5. import socket
  6.  
  7. print "PRIMER PASO"
  8. p=scapy.IP(dst="192.168.1.4")/scapy.TCP(flags="SA")
  9. ans,unans = scapy.sr(p)
  10. for s,r in ans:
  11. f=r[scapy.TCP].seq
  12. print +f
  13.  
  14. print "SEGUNDO PASO"
  15. q=scapy.IP(src="192.168.1.4",dst="192.168.1.1")/scapy.TCP(dport=[80],flags="S")
  16. scapy.send(q)
  17.  
  18. print "TERCER PASO"
  19. ans,unans = scapy.sr(p)
  20. for s,r in ans:
  21. e=r[scapy.TCP].seq
  22. print +e
  23.  
  24. print "PRUEBA DE PID"
  25. if e > f:
  26. print "AUMENTO EL CONTADOR"
  27. else:
  28. print "NO AUMENTO EL CONTADOR"
Add Comment
Please, Sign In to add comment