Advertisement
Guest User

cow

a guest
Jun 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import socket
  2. import struct
  3. import sys
  4.  
  5.  
  6. def say_moo(ip):
  7. s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_UDP)
  8. data = "moo"
  9. sport = 15843
  10. dport = 42849
  11. length = 8 + len(data)
  12. checksum = 0
  13. udp_header = struct.pack('!HHHH', sport, dport, length, checksum)
  14. udp_packet = udp_heaader + data
  15. s.sendto(udp_packet, (ip, 0))
  16.  
  17.  
  18. if __name__ == "__main__":
  19. ip = sys.argv[1]
  20. say_moo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement