Created
August 26, 2020 03:57
-
-
Save enderphan94/cbd5d08207564fb987ce31a5c027967e to your computer and use it in GitHub Desktop.
Endode dll file to base64 #dll #dllinjection #base64dll
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
#!/usr/bin/python | |
# DLL Encoder - Insecurety Research | |
import sys | |
print "Encodes a DLL as a base64 encoded textfile" | |
if (len(sys.argv) != 3): | |
print "Usage: %s <Path To DLL> <Outfile>" %(sys.argv[0]) | |
print "Eg: %s C:\\windows\win32.dll encoded.txt" %(sys.argv[0]) | |
sys.exit(0) | |
dll = sys.argv[1] | |
out = sys.argv[2] | |
try: | |
print "[+] Reading DLL..." | |
f = open(dll, "r") | |
raw = f.read() | |
f.close() | |
except Exception: | |
print "[-] Something failed... Quitting!" | |
sys.exit(0) | |
try: | |
print "[+] Creating encoded outfile..." | |
encoded = raw.encode('base64') | |
g = open(out, "w") | |
g.write(encoded) | |
g.close() | |
except Exception: | |
print "[-] Something failed... Quitting!" | |
sys.exit(0) | |
print "[+] Encoded File Saved As: %s" %(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment