
OpenBSM 또는 Monitor.app을 통해 시스템 활동을 모니터링하고 파일, 프로세스, 네트워크 이벤트에 대한 상세 보고서와 타임라인을 생성하는 경량 macOS 악성코드 분석 샌드박스입니다.
"Norimaci"는 macOS용 간단하고 가벼운 멀웨어 분석 샌드박스입니다. 이 도구는 "Noriben"에서 영감을 받았습니다. Norimaci는 Sysinternals Process Monitor(procmon) 대신 OpenBSM 또는 Monitor.app의 기능을 사용하여 macOS 시스템 활동을 모니터링합니다.
Norimaci는 3개의 Python 스크립트로 구성됩니다.
OpenBSM은 macOS의 활동을 감사하는 프레임워크입니다. 자세한 내용은 해당 웹사이트를 참조하십시오.
Monitor.app은 FireEye에서 만든 무료 도구입니다. 자세한 내용은 해당 웹사이트를 참조하십시오.
제 이전 동료(@cci_forensics)가 이 이름을 제안했습니다.
"Norimaci"는 "Noriben"과 "Macintosh"를 결합한 조어입니다. "Norimaki"로 발음되며, 일본어로 "のり巻き"를 나타냅니다. 영어로는 "sushi roll"을 의미합니다.
Noriben은 최소한의 재료로 구성된 일본식 도시락입니다. 노리마키의 재료는 노리벤과 유사합니다(김, 밥, 그리고 기타 원하는 재료).
그래서 이 도구의 이름을 "Norimaci"로 정했습니다.
참고: Monitor.app은 macOS 10.12 - 10.14만 지원합니다. macOS 10.15 이상에서 멀웨어를 실행하려면 설치할 필요가 없습니다. 대신 OpenBSM을 사용해야 합니다.
Monitor.app과 함께 Norimaci를 사용하려면 다음 라이브러리를 소스 저장소나 pip에서 설치해야 합니다.
멀웨어 샘플을 실행할 macOS VM을 구축해야 합니다. 또한 가짜 인터넷 연결을 위한 별도의 VM을 구축하는 것이 좋습니다. 많은 멀웨어가 자체 서버(예: 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.
Norimaci로 macOS 10.15 Catalina에서 AppleJeus.A 분석. 이 데모 영상은 Japan Security Analyst Conference 2020 (JSAC2020)를 위해 제작되었습니다.

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