
morphHTA - Trasformazione dell'evil.HTA di Cobalt Strike
Come al solito, questo codice e strumento non devono essere utilizzati per scopi malevoli.
Scritto da Vincent Yiu del team ActiveBreach di MDSec Consulting. È consentita la modifica del codice con attribuzione all'autore.
La ricerca su Explorer e SWBemLocator COM Moniker è di @enigma0x3
Utilizzo:
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
Lunghezza massima del nome della variabile e della stringa generata casualmente ridotta per ridurre la dimensione complessiva dell'output HTA:
/morphHTA# python morph-hta.py --maxstrlen 4 --maxvarlen 4
Divisione massima nell'offuscamento chr(), questo riduce il numero di addizioni che facciamo per ridurre la lunghezza:
/morphHTA# python morph-hta.py --maxnumsplit 4
Modifica file di input e file di output:
/morphHTA# python morph-hta.py --in advert.hta --out advert-morph.hta
Suggerisco di non caricare su VT:

