
morphHTA - Cobalt Strike의 evil.HTA 모핑
평소와 같이, 이 코드와 도구는 악의적인 목적으로 사용되어서는 안 됩니다.
MDSec Consulting의 ActiveBreach 팀의 Vincent Yiu가 작성했습니다. 저자에 대한 크레딧을 포함한 코드 수정이 허용됩니다.
Explorer 및 SWBemLocator COM Moniker 연구는 @enigma0x3이 수행했습니다.
사용법:
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
HTA 출력의 전체 크기를 줄이기 위해 최대 변수 이름 길이와 무작위 생성 문자열 길이 축소:
/morphHTA# python morph-hta.py --maxstrlen 4 --maxvarlen 4
chr() 난독화의 최대 분할 횟수. 길이를 줄이기 위해 더하기 연산 수를 감소시킵니다:
/morphHTA# python morph-hta.py --maxnumsplit 4
입력 파일 및 출력 파일 변경:
/morphHTA# python morph-hta.py --in advert.hta --out advert-morph.hta
https://www.youtube.com/watch?v=X4S2aQ4o_jA
VT에 업로드하지 않는 것을 권장합니다:
