Created
October 3, 2018 19:34
-
-
Save eybisi/43410a743d3aff980221df6db69d76ad to your computer and use it in GitHub Desktop.
Agent tesla base64 decrypt code
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
import base64 | |
from Crypto.Cipher import AES | |
def stringdecrypt(a): | |
string = base64.b64decode(a) | |
iv = "@1B2c3D4e5F6g7H8" | |
key = "\x34\x88\x6D\x5B\x09\x7A\x94\x19\x78\xD0\xE3\x8b\x1b\x5c\xa3\x29\x60\x74\x6a\x5e\x5d\x64\x87\x11\xb1\x2c\x67\xaa\x5b\x3a\x8e\xbf" #to 6a/5e for first iteration | |
cleartext = AES.new(key[0:32], AES.MODE_CBC, iv).decrypt(string) | |
return cleartext | |
fh = open("extracted64") | |
content = fh.readlines() | |
fh.close() | |
for i in content: | |
try: | |
dec = stringdecrypt(i) | |
print "%s | %s" % (i.strip(),dec.strip()) | |
except: | |
pass | |
#https://researchcenter.paloaltonetworks.com/2017/09/unit42-analyzing-various-layers-agentteslas-packing/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment