"Norimaci" 是一个简单轻量的 macOS 恶意软件分析沙箱。该工具受 "Noriben" 启发。Norimaci 使用 OpenBSM 或 Monitor.app 的功能来监控 macOS 系统活动,而非 Sysinternals Process Monitor (procmon)。
Norimaci 由 3 个 Python 脚本组成。
OpenBSM 是一个用于审计 macOS 活动的框架。详情请参见 他们的网站。
Monitor.app 是由 FireEye 开发的免费工具。详情请参见 他们的网站。
我以前的同事 (@cci_forensics) 建议了这个名字。
"Norimaci" 是结合 "Noriben" 和 "Macintosh" 的合成词。发音为 "Norimaki",在日语中表示 "のり巻き",英文意为 "寿司卷"。
Noriben 是一种日式便当,包含最少的配料。Norimaki 的配料与 Noriben 类似(海苔、米饭和其他你喜欢的配菜)。
因此,我决定将这个工具命名为 "Norimaci"。
注意,Monitor.app 仅支持 macOS 10.12 - 10.14。如果你要在 macOS 10.15 或更高版本上运行恶意软件,则无需安装它。你需要使用 OpenBSM 替代它。
如果你将 Norimaci 与 Monitor.app 一起使用,则需要从源代码仓库或 pip 安装以下库:
你需要构建一个 macOS 虚拟机来运行恶意软件样本。此外,强烈建议构建另一个用于模拟假互联网连接的虚拟机。因为很多恶意软件会尝试连接它们的服务器(例如 C2 服务器)。
PolarProxy 和 INetSim 是非常有用的工具,可以提供假 HTTP/HTTPS 和 DNS 服务。请参考 NETRESEC 博客 来搭建假互联网。
如果你使用 OpenBSM 监控系统活动,则需要修改 /etc/security/audit_control 文件,如下所示。 因为默认情况下 OpenBSM 仅记录登录和认证的审计日志。但 Norimaci 需要更多种类的审计日志(文件创建、文件删除、进程执行、网络活动等)。
修改后需要重启计算机才能应用设置。
#
# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_control#8 $
#
dir:/var/audit
flags:lo,aa,fc,fd,pc,nt,ex <- 此处编辑为这样
minfree:5
naflags:lo,aa,fc,fd,pc,nt,ex <- 此处编辑为这样
policy:cnt,argv
filesz:2M
expire-after:10M
superuser-set-sflags-mask:has_authenticated,has_console_access
superuser-clear-sflags-mask:has_authenticated,has_console_access
member-set-sflags-mask:
member-clear-sflags-mask:has_authenticated
$ sudo python3 ./norimaci.py -m openbsm -o ./out/
Password:
--===[ Norimaci v0.1.0
--===[ Minoru Kobayashi [@unkn0wnbit]
[*] Launching OpenBSM agent...
[*] When runtime is complete, press CTRL+C to stop logging.
^C
[*] Termination of OpenBSM agent commencing... please wait
[*] Converting OpenBSM data ...
[*] Loading converted macOS activity data ...
[*] Saving report to: /Users/macforensics/tools/norimaci/out/Norimaci_14_Jan_20__15_55_093219.txt
[*] Saving timeline to: /Users/macforensics/tools/norimaci/out/Norimaci_14_Jan_20__15_55_093219_timeline.csv
注意:Monitor.app 不能在 macOS 10.15 上运行,但在 macOS 10.14 或更早版本上运行正常。
$ python3 ./norimaci.py -h
--===[ Norimaci v0.1.0
--===[ Minoru Kobayashi [@unkn0wnbit]
usage: norimaci.py [-h] [-m MONITOR] [-j JSON] [-bl OPENBSM_LOG] [-p PROCLIST]
[-ml MONITORAPP_LOG] [-o OUTPUT] [--force] [--debug]
Light weight sandbox which works with OpenBSM or Fireeye's Monitor.app
optional arguments:
-h, --help show this help message and exit
-m MONITOR, --monitor MONITOR
Specify a program to monitor macOS activity. You can
choose 'openbsm' or 'monitorapp'.
-j JSON, --json JSON Path to a JSON file which is converted by
'openbsmconv.py' or 'monitorappconv.py'.
-bl OPENBSM_LOG, --openbsm-log OPENBSM_LOG
Path to an OpenBSM log file.
-p PROCLIST, --proclist PROCLIST
Path to a process list file to process OpenBSM log
file. A file which has ".proclist" extnsion would be
used, if this option is not specified.
-ml MONITORAPP_LOG, --monitorapp-log MONITORAPP_LOG
Path to a Monitor.app data file.
-o OUTPUT, --output OUTPUT
Path to an output directory.
--force Enable to overwrite output files.
--debug Enable debug mode.
$ python3 ./openbsmconv.py -h
usage: openbsmconv.py [-h] [-f FILE] [-p PROCLIST] [-o OUT] [-c] [-rp]
[--with-failure] [--with-failure-socket] [--force]
[--debug]
Converts OpenBSM log file to JSON format.
optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE Path to a bsm log file
-p PROCLIST, --proclist PROCLIST
Path to a process list file
-o OUT, --out OUT Path to an output file
-c, --console Output JSON data to stdout.
-rp, --use-running-proclist
Use current running process list instead of a existing
process list file. And, the process list is saved to a
file which places in the same directory of '--file' or
to a file which specified '--proclist'.
--with-failure Output records which has a failure status too.
--with-failure-socket
Output records which has a failure status too (related
socket() syscall only).
--force Enable to overwrite an existing output file.
--debug Enable debug mode.
$ python3 ./monitorappconv.py -h
usage: monitorappconv.py [-h] [-f FILE] [-o OUT] [-c] [--force] [--debug]
Parses data of Fireeye Monitor.app and converts it to JSON format. Please note
that strings in JSON data are saved as UTF-8.
optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE Path to a saved data of Monitor.app.
-o OUT, --out OUT Path to an output file.
-c, --console Output JSON data to stdout.
--force Enable to overwrite an output file.
--debug Enable debug mode.
在 macOS 10.15 Catalina 上使用 Norimaci 分析 AppleJeus.A。该演示视频是为 2020 年日本安全分析师大会(JSAC2020)制作的。

git clone https://github.com/mnrkbys/norimaci.git