Files
Desiree Beck bd31003a22 Staging (#151)
* Fixing links

* Code samples (#149)

* Update obfuscated-files-or-information.md

Added code sample with some proposed formatting incl. annotations explaining broad behavior patterns

* Update obfuscated-files-or-information.md

Added brief clarification to note

* Update obfuscated-files-or-information.md

Made requested changes to format

* Update system-information-discovery.md

Added code snippet from PoisonIvy RAT

* Update debugger-detection.md

Added code with example of PEB access

* Update system-information-discovery.md

Added new method based on code snippet

* Update registry.md

Added snippet for registry key query

* Update generate-pseudorandom-sequence.md

Added example of Mersenne Twister algorithm

* Update keylogging.md

Add Dark Comet keylogging code sample

* Update dns-communication.md

Added code sample from darkcomet

* Update socket-communication.md

Added DarkComet code snippet

* Update delete-file.md

Provided DarkComet sample

* Update file-and-directory-discovery.md

Added DarkComet snippet

* Update allocate-memory.md

Added DarkComet sample

* Update modulo.md

Added Hupigon snippet

* Update get-file-attributes.md

Added Hupigon sample

* Update application-window-discovery.md

Added Hupigon snippet

* Update create-process.md

Added Hupigon snippet.

* Update conditional-execution.md

Added Hupigon snippet

* Update create-thread.md

Added Hupigon snippet

* Update resume-thread.md

Added Hupigon snippet

* Update command-and-scripting-interpreter.md

Added SmokeLoader sample

* Update change-memory-protection.md

Added SmokeLoader snippet

* Update console.md

Added snippet from SmokeLoader

* Update dynamic-analysis-evasion.md

Added Industroyer sample

* Update interprocess-communication.md

Added CobaltStrike sample

* Update read-file.md

Added Cobalt Strike snippet

* Update writes-file.md

Added cobalt strike snippet

* Update noncryptographic-hash.md

Added emotet snippet

* Update clipboard-modification.md

Added emotet snippet

* Update check-mutex.md

Added emotet sampler

* Update check-mutex.md

Fixed typo

* Update create-mutex.md

Added Emotet snippet

* Update allocate-thread-local-storage.md

Added emotet snippet

* Update registry-run-keys-startup-folder.md

Added emotet snippet

* Update wininet.md

Added EnvyScout snippet

* Update http-communication.md

Added EnvyScout snippet

* Update enumerate-threads.md

Added Envyscout snippet

* Update set-thread-local-storage-value.md

Added Envyscout sample

* Update create-directory.md

Added explosive snippet

* Update delete-directory.md

Added explosive code snippet (note: the malware is called "explosive")

* Update set-file-attributes.md

Added explosive sample

* Update terminate-process.md

Added explosive snippet

* Update terminate-thread.md

Added explosive sample

* Update move-file.md

Added Finfisher snippet

* Update screen-capture.md

Added ECCENTRICBANDWAGON snippet

* Fix links (#150)

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* fix link

* update mod date

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* fix links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* update links

* Update code-discovery.md

* Update taskbar-discovery.md

* Update conditional-execution.md

* Update memory-dump-evasion.md

* Update execution-dependency.md

* Update compromise-data-integrity.md

* Update dns-communication.md

* Update http-communication.md

* Update interprocess-communication.md

* Update socket-communication.md

* Update wininet.md

* Update generate-pseudorandom-sequence.md

* Update modulo.md

* Update noncryptographic-hash.md

* Update create-directory.md

* Update delete-directory.md

* Update delete-file.md

* Update get-file-attributes.md

* Update move-file.md

* Update read-file.md

* Update terminate-thread.md

* Update set-file-attributes.md

* Update writes-file.md

* Update allocate-memory.md

* Update change-memory-protection.md

* Update console.md

* Update registry.md

* Update allocate-thread-local-storage.md

* Update check-mutex.md

* Update terminate-process.md

* Update create-mutex.md

* Update create-process.md

* Update set-thread-local-storage-value.md

* Update resume-thread.md

* Update enumerate-threads.md

* Update create-thread.md

* update for 3.1 release

* update for 3.1 release

* update for 3.1 release

---------

Co-authored-by: ryan <ryanxu@wustl.edu>
Co-authored-by: brightmt <50853930+brightmt@users.noreply.github.com>
2024-05-01 16:09:33 -04:00

7.1 KiB

Pafish - MBC Behaviors

Pafish is a testing tool that detects virtual machines and malware analysis environments using the same techniques as malware. The behaviors below were identified by reviewing the Pafish source code. [1]

Name Use
Anti-Behavioral Analysis::Debugger Detection::IsDebuggerPresent (B0001.008) Pafish uses the IsDebuggerPresent function to determine whether a debugger is present. [1]
Anti-Behavioral Analysis::Debugger Detection::Process Environment Block/Being Debugged (B0001.035) Pafish uses the BeingDebugged field of the Process Environment Block (PEB) to determine whether the process is being debugged. [1]
Anti-Behavioral Analysis::Debugger Detection::OutputDebugString (B0001.016) Pafish uses the OutputDebugString function to determine whether a debugger is present. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Instruction Testing - RDTSC (B0009.036) Pafish identifies a VM CPU by checking the difference between CPU timestamp counters (rdtsc). [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Instruction Testing - CPUID (B0009.034) Pafish identifies a VM CPU by checking the hypervisor bit in cpuid feature bits, which shows the presence of a hypervisor and/or VM vendor information. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Human User Check (B0009.012), Anti-Behavioral Analysis::Sandbox Detection::Human User Check (B0007.012) Pafish checks for mouse movement (speed, clicking activity: single and double), and Pafish displays a dialog box to see whether a user responds to it.[1]
Anti-Behavioral Analysis::Sandbox Detection (B0007) Pafish identifies sandboxes by checking whether Sleep() has been patched using GetTickCount(), checking for common sandbox-related values for username (SANDBOX, VIRUS, MALWARE) and file path (\SAMPLE, \VIRUS, \SANDBOX), and looking for common sample names in root drives (sample.exe, malware.exe). [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Modern Specs Check - Drive size (B0009.015) Pafish checks whether the hardware has modern characteristics. Sub-standard specs indicate a virtual environment. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Modern Specs Check - Processor count (B0009.018) Pafish checks whether the hardware has modern characteristics. Single CPUs indicate a virtual environment. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Modern Specs Check - Total physical memory (B0009.014) Pafish checks whether the hardware has modern characteristics. Physical memory less than 4 GB indicates a virtual environment. [1]
Anti-Behavioral Analysis::Sandbox Detection::Timing/Uptime Check (B0007.009) Pafish uses the GetTickCount function to to check how long the system has been running (a short uptime indicates a sandbox). [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Unique Hardware/Firmware Check (B0009.023) Pafish checks IsNativeVhdBoot() to determine whether the OS was booted from a virtual hard drive. [1]
Anti-Behavioral Analysis::Sandbox Detection (B0007) Pafish checks whether the ShellExecuteExW or CreateProcessA functions have been hooked, indicating a sandbox. [1]
Anti-Behavioral Analysis::Sandbox Detection (B0007) Pafish checks whether the module sbiedll.dll (which is associated with Sandboxie) has been mapped into the address space of the process [1]
Anti-Behavioral Analysis::Emulator Detection (B0004) Pafish detects Wine using GetProcAddress(wine_get_unix_file_name) from kernel32.dll [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Check Registry Keys (B0009.005) Pafish checks the value of several registry keys to determine whether VWware, VitualBox, Bocks, or QEMU is running [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Unique Hardware/Firmware Check - MAC Address (B0009.028) Pafish identifies VirtualBox by checking whether the MAC address starts with 08:00:27, and it identifies VMware by checking whether the MAC address starts with 00:05:69, 00:0C:29, 00:1C:14 or 00:50:56. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Check Processes (B0009.004) Pafish identifies VirtualBox by identifying the VBoxTray windows daemon. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Check File and Directory Artifacts (B0009.001) Pafish checks for VirtualBox shared folders (network share). [1]
Anti-Behavioral Analysis::Virtual Machine Detection (B0009) Pafish uses Windows Management Instrumentation (WMI) to find a VirtualBox device identifier or a VMware serial number. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Check File and Directory Artifacts (B0009.001) Pafish checks for particular files on the file system indicating the presence of VMware. [1]
Anti-Behavioral Analysis::Virtual Machine Detection (B0009) Pafish uses GetAdaptersAddresses() to check whether an adapter is named "VMware," which indicates the presence of VMware. [1]
Anti-Behavioral Analysis::Virtual Machine Detection::Unique Hardware/Firmware Check - CPU Name (B0009.026) Pafish checks the CPU name to identify virtualization. For example, Qemu is traced using the CPU brand string 'QEMU Virtual CPU', and Bochs is traced using either a typo in the CPU AMD processor name, a CPU AMD Easter egg, or a wrong value in the CPU Intel processor name. [1]
Anti-Behavioral Analysis::Sandbox Detection (B0007) Pafish checks the TLS hooks information structure (TLS_HOOK_INFO) to identify the presence of Cuckoo. [1]

References

[1] https://github.com/a0rtega/pafish