
morphHTA - Morphing von Cobalt Strike's evil.HTA
Wie üblich sollte dieser Code und dieses Tool nicht für böswillige Zwecke verwendet werden.
Geschrieben von Vincent Yiu vom ActiveBreach-Team der MDSec Consulting. Die Modifikation des Codes ist mit Quellenangabe erlaubt.
Die Forschung zu Explorer und SWBemLocator COM Moniker stammt von @enigma0x3
Verwendung:
usage: morph-hta.py [-h] [--in <input_file>] [--out <output_file>]
[--maxstrlen <default: 1000>] [--maxvarlen <default: 40>]
[--maxnumsplit <default: 10>]
optional arguments:
-h, --help show this help message and exit
--in <input_file> File to input Cobalt Strike PowerShell HTA
--out <output_file> File to output the morphed HTA to
--maxstrlen <default: 1000>
Max length of randomly generated strings
--maxvarlen <default: 40>
Max length of randomly generated variable names
--maxnumsplit <default: 10>
Max number of times values should be split in chr
obfuscation
/morphHTA# python morph-hta.py
███╗ ███╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗ ██╗ ██╗████████╗ █████╗
████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║ ██║ ██║ ██║╚══██╔══╝██╔══██╗
██╔████╔██║██║ ██║██████╔╝██████╔╝███████║█████╗███████║ ██║ ███████║
██║╚██╔╝██║██║ ██║██╔══██╗██╔═══╝ ██╔══██║╚════╝██╔══██║ ██║ ██╔══██║
██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
Morphing Evil.HTA from Cobalt Strike
Author: Vincent Yiu (@vysec, @vysecurity)
[*] morphHTA initiated
[+] Writing payload to morph.hta
[+] Payload written
Maximale Länge von Variablennamen und zufällig generierten Zeichenfolgen reduziert, um die Gesamtgröße der HTA-Ausgabe zu verringern:
/morphHTA# python morph-hta.py --maxstrlen 4 --maxvarlen 4
Max Split in chr()-Verschleierung, dies reduziert die Anzahl der Additionen, um die Länge zu verringern:
/morphHTA# python morph-hta.py --maxnumsplit 4
Eingabe- und Ausgabedateien ändern:
/morphHTA# python morph-hta.py --in advert.hta --out advert-morph.hta
https://www.youtube.com/watch?v=X4S2aQ4o_jA
Ich empfehle, nicht auf VT hochzuladen:
