
일반적인 원격 액세스 트로이목마용 Python 디코더
Malconf는 특정 악성코드 패밀리를 정적으로 분석하고 사고 대응 담당자(Incident Responder)가 사고 발생 시 활용할 수 있는 구성(Configuration) 데이터를 추출하는 데 사용할 수 있는 python3 라이브러리입니다.
라이브러리로서 자동화된 악성코드 분석 파이프라인에 설치할 수도 있습니다.
pip 설정과 requirements.txt에 포함된 몇 가지 선행 요구 사항이 있습니다.
모든 디코더를 사용하려면 yara와 yara-python이 필요합니다. .NET 악성코드를 처리하려면 dotnet 지원과 함께 yara-python을 설치해야 합니다.
git clone --recursive https://github.com/VirusTotal/yara-python
python3 setup.py build --enable-magic --enable-dotnet
sudo python3 setup.py install
pip3 install --upgrade malwareconfig
git clone [email protected]:kevthehermit/RATDecoders.git
cd RATDecoders
pip3 install -r requirements.txt
python3 setup.py install
현재 지원되는 RAT 목록은 다음과 같습니다.
제공된 명령줄 도구 malconf를 사용하면 단일 파일이나 디렉터리를 -r 플래그와 함께 전달할 수 있으며, 패밀리를 자동으로 탐지하여 구성(config)을 추출하려고 시도합니다.
-o 옵션을 사용하여 결과를 파일로 작성할 수도 있습니다.
malconf
malconf -l 지원되는 모든 RAT 목록을 표시합니다.
malconf /path/to/sample 패밀리를 자동으로 탐지하고 디코더를 실행합니다.
⇒ malconf tests/samples/alienspy
__ __ _ ____ __
| \/ | __ _| |/ ___|___ _ __ / _|
| |\/| |/ _` | | | / _ \| '_ \| |_
| | | | (_| | | |__| (_) | | | | _|
|_| |_|\__,_|_|\____\___/|_| |_|_|
Malware Configuration Parser by @kevthehermit
[+] Loading File: tests/samples/alienspy
[-] Found: AlienSpy
[-] Running Decoder
[-] Config Output
{'ConfigKey': 'fzGUoTaQH3SUW7E82IKQK2J2J2IISIS',
'NAME': 'ok',
'Version': 'B',
'connetion_time': '0',
'desktop': 'true',
'dns': '213.208.129.211',
'extensionname': 'qQJ',
'folder': 'java',
'instalar': 'true',
pip로 설치하면 라이브러리로도 사용할 수 있습니다.
from malwareconfig import fileparser
from malwareconfig.modules import __decoders__, __preprocessors__
# Open and parse the file
sample_path = '/path/to/sample.exe'
file_info = fileparser.FileParser(file_path=sample_path)
# Check for a valid decoder and then parse
if file_info.malware_name in __decoders__:
module = __decoders__[file_info.malware_name]['obj']()
module.set_file(file_info)
module.get_config()
conf = module.config
pprint(conf)
공로가 있는 곳에 모든 공로를 돌립니다.
초기 xtreme Rat 분석 자료를 제공한 Malware.lu - https://code.google.com/p/malware-lu/wiki/en_xtreme_RAT
Poison Ivy 및 Xtreme RAT 분석 자료를 제공한 Fireye (제 트윗을 무시했지만 :-) ) - http://www.fireeye.com/blog/technical/2014/02/xtremerat-nuisance-or-threat.html
이 논문을 작성한 Shawn Denbow와 Jesse Herts - http://www.matasano.com/research/PEST-CONTROL.pdf 많은 시간을 절약해 주었습니다.