-
-
Save mak/26e513a38a959d9a07631d2f47b94ca7 to your computer and use it in GitHub Desktop.
decode some powershell malware from image
This file contains hidden or 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
ret = [ 0 for _ in range(40000)] | |
for i in range(26): | |
for j in range(800): | |
try: | |
px = img.getpixel((j,i)) | |
except: | |
continue | |
ret[i * 800 + j ] = math.floor((px[2] & 0xf ) * 4 * 4 ) | (px[1]&0xf) | |
with open('x.ps1','w') as f: f.write(''.join(map(chr,filter(None,ret)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment