Skip to content

Instantly share code, notes, and snippets.

@jkeuper
Created February 12, 2019 21:13
Show Gist options
  • Save jkeuper/18cb24cd156af0d468eb50a489c85abd to your computer and use it in GitHub Desktop.
Save jkeuper/18cb24cd156af0d468eb50a489c85abd to your computer and use it in GitHub Desktop.
Hack the compound
#!/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