
morphHTA - Morfando o evil.HTA do Cobalt Strike
Como de costume, este código e ferramenta não devem ser utilizados para fins maliciosos.
Escrito por Vincent Yiu da equipe ActiveBreach da MDSec Consulting. A modificação do código é permitida com créditos ao autor.
A pesquisa sobre Explorer e SWBemLocator COM Moniker é de autoria de @enigma0x3
Uso:
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
Comprimento máximo do nome da variável e comprimento da string gerada aleatoriamente reduzidos para diminuir o tamanho geral da saída HTA:
/morphHTA# python morph-hta.py --maxstrlen 4 --maxvarlen 4
Divisão máxima na ofuscação chr(), isso reduz o número de adições que fazemos para diminuir o comprimento:
/morphHTA# python morph-hta.py --maxnumsplit 4
Alterar arquivo de entrada e arquivos de saída:
/morphHTA# python morph-hta.py --in advert.hta --out advert-morph.hta
https://www.youtube.com/watch?v=X4S2aQ4o_jA
Sugiro não enviar para o VT:
