1
0
mirror of https://github.com/nganhkhoa/malware.git synced 2024-06-10 21:32:07 +07:00
mether049-malware/Emotet/extracting_ioc_from_doc.md
2020-01-23 23:56:50 +09:00

43 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Extracting IoC from .doc file(Emotet)
解析環境をあまり汚さないかつ簡潔な手法を示す
- Sample/Required Tools
- Flow
- Reference
## Sample/Required Tools
- Sample
|sha256|[14445473a8b471e550c9e36677223a3d0ffb017647dc8d7a01ae88efd1b993ac](https://www.virustotal.com/gui/file/14445473a8b471e550c9e36677223a3d0ffb017647dc8d7a01ae88efd1b993ac/detection)|
|:-|:-|
|file type|.doc|
|sandbox|[ANYRUN](https://app.any.run/tasks/31ccc24e-e55e-4757-b964-c0969323752e/)<br>[HYBRID ANALYSIS](https://www.hybrid-analysis.com/sample/14445473a8b471e550c9e36677223a3d0ffb017647dc8d7a01ae88efd1b993ac?environmentId=120)|
- Required Tools
- Windows Machine
- [CMD Watcher](http://www.kahusecurity.com/tools.html)
## Flow
1. CMD Watcherを起動しStartを押下
![](https://github.com/mether049/malware/blob/master/Emotet/img/cmdwacher.PNG)
2. .docファイルを開き「コンテンツの有効化」を押下
![](https://github.com/mether049/malware/blob/master/Emotet/img/word.PNG)
3. マクロによって実行されるpowershellコマンドがCMD Watcherに出力されるためそこからBase64でエンコードされた文字列をコピーする<br>
(コマンドをキャプチャしたときにPowerShellプロセスを強制終了させるので解析環境はあまり汚さないですむ)
![](https://github.com/mether049/malware/blob/master/Emotet/img/cmdwacther2.PNG)
4. Cyberchefを利用してBase64でエンコードされた文字列をデコードしIoC(URL)のみを出力させる
- レシピの内容として必要なのは以下
- Base64のデコード
- null文字の除去
- 正規表現によるURLの抽出
- Base64からIoCを取得するレシピの例は[こちら](https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)Remove_null_bytes()Regular_expression('User%20defined','http(s)?://(%5B%5C%5Cw-%5D%2B%5C%5C.)%2B%5B%5C%5Cw-%5D%2B(/%5B%5C%5Cw-%20./?%25%26%3D%5D*)?',true,true,false,false,false,false,'List%20matches'))
![](https://github.com/mether049/malware/blob/master/Emotet/img/cyberchef_960.png)
## Reference
[How To: Extract Network Indicators of Compromise (IOCs) from Maldoc Macros — Part 2](https://security-soup.net/how-to-extract-network-indicators-of-compromise-iocs-from-maldoc-macros-part-2/)<br>
[CMD Watcher and Maldocs](http://www.kahusecurity.com/posts/cmd_watcher_and_maldocs.html)