Interactive Triage Flow
Connectivity

Second Detonation

INetSim Enabled execution
or Hosts file modified etc.

How does it behave after service imitation is enabled - e.g. Internet, Network, AD etc.? Or if anti-sandbox/reverse has been manually bypassed?

Initial Detonation
How does the malware operate when executed without any network connectivity in your sandbox?

Revert VM Snapshot

2.3

Monitor Functions

2.2

In-memory String Search

Noriben.py

Noriben is a python wrapper around ProcMon that is used as an analysis tool specifically for malware behavioural analysis.

When you run noriben.py, it will automatically attempt to open procmon with a predefined config. The config specifies the filters for capturing system operations

This tool has YARA integrations as well. You can use --yara option to specify a folder containing yara rules.

  1. run noriben.py
python3 noiben.py
  1. execute the malicious file until it exits
  2. close ProcMon and wait for a few seconds
  3. ctrl+c to stop logging once execution is complete
  4. analyse the noriben output

Note
due to limitations,noriben may omit some information, such as VM and Sandbox checks that a sample may do.
It is always worth doing manual checks in conjunction

CMD

CMD Watcher
  • run Cmd Watcher
  • Execute your sample
  • inspect Cmd Watcher to see if cmd or powershell are executed throughout execution

Win API

Wireshark

It may be worth running wireshark in the background
Wireshark - filter for http / dns:

  • dns → Show only DNS queries/responses.
  • tcp.port==80 or tcp.port==443 → Show HTTP/HTTPS.
  • http.request.full_uri contains <string>
Suricata

Suricata is an IDS tool. It takes PCAP files as input, analyses them then dumps Network-based indicators on the rule-set supplied.

sudo suricata -r sample.pcap -S custom.rules -k none

2.4

Connectivity & Network Indicators

x64Dbg for In-Execution Strings

run to user code > reference for current module > String Search

API Monitor

This tool allows you to trace and monitor API function calls.

You can use it to set breakpoints on specific Win API functions.

Workflow:

  • Open API Monitor
  • Click on the API Filter pane
  • Press Ctrl-F (or click on the 'Find' icon)
  • Search for 'http' and other Internet modules (alternatively, select DNS & Internet paths)
  • You can do the same for any other interesting APIs, e.g. registry APIs, Process injection APIs etc.
  • Check all of the APIs that you want to break on
  • Make sure in the "Summary" Pane, that decode parameter values is checked & make sure the breakpoint option is checked
  • Next, load your executable in the "Monitor Process" pane

Once you have selected your process and it has executed, if the program calls the API Module that you have set breakpoints for, you will see the output on API Monitor - as well as the arguments passed to it.

Netstat

Run this command as admin in the background to log the system's 'live' connections

netstat -b -n -o 5

-b displays the process from which the connection is made
-n display address and port in numerical value (optional)
-o display process id
5 interval (refresh time) - increase / decrease as you wish

Process Hacker for In-Execution Strings

Open Process Hacker > select Process > Properties > Memory > String Check

TCPView

TCPView (sysinternals program).
Sort by Remote Port:

  • 80/443 → HTTP/HTTPS
  • 53 → DNS
    You can also easily perform whois on the dest IP on the GUI
Procmon (tcp filter)

Run procmon and set the filter:
Process Name contains <proc name>
Operation contains TCP

This is useful to determine network IoCs. It can be used to determine inbound/outbound TCP operations from your sample.

Fiddler

Fiddler Web Proxy to review outbound traffic

NOTE: Bind Connectivity
if you notice that your sample has started a LISTENER on a given port, you can use netcat or similar to establish a connection to it and inspect what happens

Reverse Connectivity
Conversely, if the sample is connecting out to a target address on a given port, you can imitate the target (set the hosts file - if necessary, and start a listener on the specified port) to see what happens when the sample connects to it

The "ncat" version of netcat has an SSL option that can be used if required:

ncat -lvnp <port> --ssl

ncat.exe works & this can be downloaded in many instances on Linux withapt install nc

Procmon
  • Add each of the following filters as Include.
  • exclude noise (e.g., Process Name is not explorer.exe, Process Name is not chrome.exe etc.)
  • Combine with Process Name is sample.exe if you want to focus on one binary and its children.

Useful procmon filters:

path contains <string>
ppid is <parent proc ID>
Operation is Process Create
Operation is Process Exit
Operation is Thread Create
Operation is Thread Exit
Operation begins with Reg   ; catches all registry actions
Operation is RegQueryValue
Operation is RegCreateKey
Operation is RegSetValue
Operation is RegDeleteKey
Operation is RegDeleteValue
Operation is CreateFile
Operation is WriteFile
Operation is ReadFile
Operation is SetDispositionInformationFile   ; rename/delete
Operation is CloseFile
Operation is Load Image                     ; DLL loads

operation monitoring

2. Behavioural Analysis

Behavioural analysis is an imperative step that helps us to understand what the program actually does, and how it behaves. In this stage you should try to identify any indicators of compromise (IoC), including System-based and Network/Internet-based IoCs.

You may be required to configure your environment in such a way that it facilitates the full execution of the target program. You are the master of your own environment. You may also be required to "patch" your program, in order to have it execute in full, thus you may need to jump to stage 3 or 4 to apply patches, and then return to stage 2 to continue.

Some questions that ought to be asked at this point are the following:

Questions to ask
How does the sample behave when executed while isolated without any network connectivity?
Is there a network activity kill-switch?
Is there anti-sandbox kill-switch?
What conditions need to be met in order for the program to be executed in-full?
What are the Host indicators (System operations)? process/thread spawn, File writes / Deletion, Registry activity etc.
Is there any persistence?
What are the Network indicators (Network & Internet operations)? HTTP, Bind Con, Remote Con, AD, SMB etc.
Based on the information collected - can the program be classified as mlwr? Is there enough evidence to determine this?

Tracing Registry Modification

Regshot

https://sourceforge.net/projects/regshot/ (or trusted mirrors)
note: regshot may take a while to complete the registry snapshot

  1. Launch Regshot (Portable EXE)
  2. First Snapshot (before malware execution)
  • Click 1st shotShot (or Shot + Save if you want to keep the file).
  1. Run the malware sample or install the application you want to analyze. Allow it to finish its activity.
  2. Capture 2nd Snapshot
  • click 2nd shotShot (or Shot + Save if you want to keep the file).
  1. Compare
  • Click Compare
    Regshot will generate a report showing:
- Added Keys/Values
- Deleted Keys/Values
- Modified Keys/Values
- Changed files (if directories were scanned

2.1

System Operations & Host Indicators

HTTP server

In some instances you may need to serve an http server for a specific domain. You can modify the hosts file and run the following:

python -m http.server <port>

Nth Detonation
What operations does it perform after a "successful" execution?

What are the Host IoCs?
What are the Network IoCs?

Revert VM Snapshot