Skip to content

Instantly share code, notes, and snippets.

textwrap.wrap("123456789", 2)
a = 'eW91ciB0ZXh0'
a.decode('base64')
'your text'
binascii.unhexlify(line).strip()
export PYTHONWARNINGS="ignore"
file = open('newfile.txt', 'r')
for line in file
print line
file.close()
awk -v RS='' '/contents/'
tcpdump -n -r conference.pcapng | cut -d" " -f 3 | cut -d"." -f1-4 | tr -d [[:blank:]] | sort | uniq -c > all-ips
@leveled
leveled / tcpdump_cheatsheet.sh
Last active December 15, 2020 15:24
tcpdump cheatsheet
##Basic Structure is
#[timestamp] [network protocol] [source IP].[source port] > [dest IP].[dest port]
tcpdump -n -r icmp.pcap 'icmp[icmptype] = icmp-echoreply' and dst host 192.168.2.127
# Number of packets
tcpdump -nn -r capture.pcap | wc - l
# Capture incoming DNS Traffic
x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0}
sorted_x = sorted(x.items(), key=operator.itemgetter(1))