Skip to content

Instantly share code, notes, and snippets.

@infosecn1nja
Created July 16, 2017 00:11
Show Gist options
  • Save infosecn1nja/106ac517c2d7cdc3cb9ea448ba8070fb to your computer and use it in GitHub Desktop.
Save infosecn1nja/106ac517c2d7cdc3cb9ea448ba8070fb to your computer and use it in GitHub Desktop.
Drop binary executable using certutil on windows
#!/bin/bash
# drop_binary.sh
# ./drop_binary.sh /usr/share/windows-binaries/nc.exe nc.txt
# certutil -decode encoded.txt decoded.bin
echo "-----BEGIN CERTIFICATE-----" > $2
cat $1 | base64 >> $2
echo "-----END CERTIFICATE-----" >> $2
sed -i 's/^/echo /g' $2 && sed -i 's/$/ >> encoded.txt/g' $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment