Skip to content

Instantly share code, notes, and snippets.

@thepacketgeek
Created October 4, 2013 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thepacketgeek/6828798 to your computer and use it in GitHub Desktop.
Save thepacketgeek/6828798 to your computer and use it in GitHub Desktop.
Clean up a scapy packet summary
def cleanPayload(p):
p = str(p)
# Clean up packet payload from scapy output
return p.split('Raw')[0].split("Padding")[0].replace('|','\n').strip('<')\
.strip('bound method Ether.show of ').replace('>','').replace('[<','[')\
.replace('\n<','<').replace('<','\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment