Last active
August 29, 2015 14:05
-
-
Save alseambusher/5e2d52280a849e38b5e5 to your computer and use it in GitHub Desktop.
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 | |
while getopts "de:" OPTION | |
do | |
case $OPTION in | |
d) | |
# mailexe -d [original] [duplicate] | |
#decoding | |
base64 $2 > original | |
base64 $3 > duplicate | |
diff -ed original duplicate > diffed | |
tail -n +2 diffed | head -n -1 > exe.64 | |
base64 -d exe.64 > output.exe | |
rm original duplicate diffed exe.64 | |
echo "output.exe generated" | |
;; | |
e) | |
# mailexe -e [exe file] [image file] | |
#encoding | |
base64 $3 > temp | |
base64 $2 >> temp | |
base64 -d temp > image.png | |
rm temp | |
echo "image.png has the exe file embedded" | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment