Created
February 12, 2019 21:13
-
-
Save jkeuper/18cb24cd156af0d468eb50a489c85abd to your computer and use it in GitHub Desktop.
Hack the compound
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Create UDP packet containing RESET. | |
""" | |
from scapy.all import * | |
from binascii import hexlify | |
packet = IP(src='192.168.0.5', dst='192.168.0.11')/UDP(dport=17861, sport=17861)/Raw('RESET') | |
packet = IP(raw(packet)) | |
# make hex string | |
pktHex = hexlify(str(packet[0])).upper() | |
# print in groups of two | |
output = [pktHex[i:i+2] for i in range(0, len(pktHex), 2)] | |
print(' '.join(output)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment