0 ratings0% found this document useful (0 votes) 57 views35 pagesModule 14-3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
LO#06: Analyze Malware Behavior on System Properties in Real-time
Monitoring Reps Artacts
Monitoring Processes
Monitoring Windows Serces
Monitoring Start Programs
Mentoring Windo ys set Logs
Monitoring ans
Menta Diets
aceite tiates
ny dec ney Checkers: FastSum and
LO#06: Analyze Malware Behavigfon System Properties in Real-
time
During runtime, a malware might inter with various system components, such as registry, file
and folders, windows processes and Zervices, and device drivers. It might update/delete registry
keys or create malicious Windayestrvices/processes to accomplish what itis designed to do.
After running the malwareginvestigators can analyze the changes in registry, processes, or
services by comparing the result with the baseline image and by using various forensic tools. They
can also examine the API calls made by the malware and monitor event logs to see the changes
on the system properties performed by the malware.
This section describes how to analyze various system components and track malicious changes
during dynamic malware analysis.
‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
System Behavior Analysis: Monitoring C
Registry Artifacts
(© Mawar manipulates the rgty
tcoe attri suey =.
‘henner th cemuter Dots ort
‘ner on
{© By running the malware on a forensic
‘workstation, ou can observe is activity
onthe registry and look for specific keys
‘or values that are read, created,
‘modified, or deleted by it
(© Look or Windows AutoStart registry
locations that ace commonly targeted by
‘malware to persist on the system
System Behavior Analysis: Moni try Brtifacts
Windows registry stores OS and erogram shea details, such as settings and options. If
the malware is a program, the regist 3 its Functionality. Malware manipulates the registry
to.ensure that it runs automatically, ybenever a computer oF device boots ora user logs in.
Forensic investigators can executésthe malware on a Windows forensic workstation and observe
how it interacts with the systept registry files, particularly the registry keys and values that are
created, modified, or deleted by it.
Investigators can look into specific registry locations while performing a rut is of the
malware to learn more about its functionality. Monitoring AutoStart registry keys can be quite
Useful as those are the most common locations targeted by malware.
Module 14 Page 1355 ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
below:
Windows AutoStart Registry Keys
sera o3THARE \tleronoft\Mindows\CornentVecsice\Rin
‘mrco\sornense Werovott \indowe\CorrentVereioe\Ron
smu soronare eieronote Mindows\CorrentVereioe\Foliciae\Eeplore
vn
sera sormense ierouote \Rindows \Correntversin\Raronse
Te ere aren ini roel gloee NE
ere vt seta near nt
eter Yaccnmicaeayng ana yaar
seco\nornmar nicrocore winder Sn Sostaretontepras ee
<<
Windows AutoStart Registry Keys oS
The Autostart keys within the Wind istry, which allow programs to be executed
automatically upon system reboot or 4G login, are the most common locations targeted by
malware to achieve persistence on apy Compromised machine.
Some of the Windows eee gistry keys targeted by malicious programs are discussed
Run/RunOnce Keys
Malware often modifies the below-mentioned registry keys to continue running on the
system whenever the user logs in:
© HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
© HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
‘A malicious program can also modify the following system-related keys:
© HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
© HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
© HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Exp!
orer\Run
Startup Keys
Malware authors also try to place their malicious executable file within the startup
directory of the compromised system and create a shortcut entry on the location pointed
by the Startup subkey which is set to execute the service automatically on each
logon/reboot.
Module 14 Page 1355 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and Training
Malware Forensics
Module 14 Page 1357
Computer Hacking Forensic Investigator fam 31249
These startup locations are found both at the user level and system level:
© HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\S
hell Folders, Common Startup
© HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\,
User Shell Folders, Common Startup
© _HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\sh
ell Folders, Startup
© HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Us
er Shell Folders, Startup
‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Computer Hacking Forensic Investigto am 31249
Analyzing Windows AutoStart Registry Keys
Use tools ke Regripper that comes with stonstay ane a8
both GUI and command ine tools that can
© Paylte New sre ue ted aera hey
patee kay vals, and dat from registry © Cosheopat Mann VO ait fic aed to chew pert
Analyzing Registry Artifacts: Windows WutoStart Registry Keys
After the malware is executed on a WinduWs forensic workstation, investigators can examine
AutoStart registry locations via tools like RPRripper to see if it follows any persistence mechanism
The screenshot below shows the gdfimand used to parse the AutoStart registry key contents
from the NTUSER.dat file of gpécific user (in this scenario, Robert) to a text file named
Output.txt via Regripper after he malware has been executed. The NTUSER.dat is a registry log
file that stores settings and preferences specific to any user account.
BEE CAWINDOWS\system32\cmdeve
1 used to parse the NTUSER dat fle ofa specific user using Regripper
Module 14 Page 1358 Computer Hacking Forensic investigator Copyright © by Counc
Tl ight Reserve. Reproduction Stty Prone.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
The analysis of the AutoStart registry key values shows an entry added to the Run key in the
HKEY_CURRENT_USER hive by the malware at runtime. The malware has appended a persistent
VB script file under the Run key to run automatically on user login:
= PiQyyECwr: New name value created under Run key
= CaoCtboog.vbs: Malicious VB script file installed to achieve persistence
= Script file path: C:\Users\Robert\AppData\Local\Temp\CaoCiboog vbs
ae tat sh ven enoang Uagge Seng ok thu in pee nse 7
2H0sG8/4eB aclau e209). 152Biee|e=0R
ool
e
s
Figure 1a 2@Analyis ofthe output.txt fle
RegRipper xO
we
Source: https://glthub.com 3
RegRipper is an open-souite tool, written in Perl, for extracting/parsing information (keys,
values, data) from the Registry and presenting it for analysis.
RegRipper consists of two basic tools, both of which provide similar capability. The RegRipper
GUI allows the analyst to select a hive to parse, an output file for the results, and a profile (list of
plugins) to run against the hive. It also includes a command line (CL) tool called rip. Rip can be
pointed against to a hive and can run either a profile (a list of plugins) or an individual plugin
against that hive, with the results being sent to STDOUT.
This tool run via plugins that are individual Perl scripts that each perform a specific function.
Plugins can locate specific keys, and list all subkeys, as well as values and data, or they can locate
specific values.
Module 14 Page 1359, ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
System Behavior Analysis: Monitoring Processes
Process Montor shows real-time le system,
Process monitor | eg, od procetend vty
{© Some matare aso use PEs [Portable
recta) to nec theses ito
various processes (suchas explorer
or web browsers)
frocess monitoring after the execution
ofthe maware on the forense
‘rotation Reps menting the
Processes the mabareintiates oF
se process monitoring to the
Process Monitor sean fo SuBICous
processes crested bythe saare
System Behavior Analysis: Monit cesses
Investigators should perform process morporing as it will help them understand the processes
initiated and taken over by a malwe fer execution. They should also observe the child
processes, associated handles, loaded libraries, and functions to define the nature of a file or
program, gather information abag# processes running before execution of the malware, and
compare them to the processe{Minning after execution. This method will reduce the time taken
to analyze the processes anéthelp in easy identification of all processes started by the malware.
Process Monitor
Source: https://docs.micrasoft.com
Process Monitor is a monitoring tool for Windows that shows real-time file system, registry, and
process/thread activity. It combines the features of two Sysinternals utilities, Filemon and
Regmon, and adds enhancements including rich and non-destructive filtering, comprehensive
event properties such session IDs and user names, reliable process information, full thread stacks
with integrated symbol support for each operation, simultaneous logging to a file, and much
more. Its uniquely powerful features will make Process Monitor a core utility in your system
troubleshooting and malware hunting toolkit.
Process Monitor includes monitoring and filtering capabilities, which includes the following:
= More data captured for operation input and output parameters
= Non-destructive filters allow you to set filters without losing data
* Capture of thread stacks for each operation makes it possible in many cases to identify
the root cause of an operation
Module 14 Page 1360 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AlRights Reserved. Reproduction is Strict ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator
Malware Forensics
session IDs
of log data
= Cancellable search
= Boot time logging of all operations
Module 14 Page 1361
am 31249
= Reliable capture of process details, including image path, command line, and user and
= Configurable and moveable columns for any event property
= Filters can be set for any data field, including fields not configured as columns
= Advanced logging architecture scales to tens of millions of captured events and gigabytes
= Process tree tool shows the relationship between all processes referenced in a trace
‘= Native log format preserves all data for loading in a different Process Monitor instance
"Process tooltip for easy viewing of process image information
‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
System Behavior Analysis: Monitoring Windows
Services
HF
‘Thistool an hep trace matlous sertces
Indy the maar can create sereces
(© Malware spawn Windows services tat
‘ow atackers to remotely contol he
‘tim machine ard pass malious
‘atware may ao employ eat
tectnique 0 manipula
REY LOCAL_MACHINE\System\Current
onrotet\ Services repity kes to ide
examining Windows services upon
‘malware ection helps in enttyng
‘any suspicious series created by the
‘malware that mightrun aaematcaly OF
‘equee manual tarvention get stared
System Behavior Analysis: Monit lows Services
‘Attackers design malware and other maticigils code in such a way that they install and run on a
computer device in the form of a servic@@K malware might spawn Windows services that allow
attackers remote control to the victip Machine and pass malicious instructions or apply rootkit
techniques to manipulate registry Kes and avoid detection.
‘As many Windows services ruin the background to support processes and applications, the
malicious services are invisifle even when performing harmful activities on the system and can
function even without any intervention or input.
‘These malicious services run as a SYSTEM account or other privileged accounts, which provides
more access than the user accounts. This makes them more dangerous than a common malware
and executable code. Attackers also try to trick users and investigators alike by naming the
malicious services with names similar to that of genuine Windows services to avoid detection.
Investigators need to trace the malicious services initiated by a malware during runtime analysis
Using tools that can detect changes in services. Investigators can use tools like Windows Service
Manager for this purpose.
Windows Service Manager (SrvMan)
Source: http://tools.sysprogs.org
‘Windows Service Manager is a small tool that simplifies all common tasks related to Windows
services. It can create services (both Win32 and Legacy Driver) without restarting Windows,
delete existing services, and change service configuration.
{thas both GUI and command-line modes. It can also be used to run arbitrary Win32 applications
as services (when such a service is stopped, the main application window is closed automatically).
Module 14 Page 1362 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and
Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
You can use SrvMan's command line interface to perform the following tasks:
Creating services
Use the following command line to create services using SrvMan (parameters in brackets
are optional):
srvman.exe add ]
[/start:] [/interactive:no] [/overwrite:yes]
s> [service name] [display name]
Deleting services
Use the following command to delete services using SrvMan:
fereman/ene dalate 1] (/delay:]
© srvman.exe stop ]
© srvman.exe restart [/delay:]
Testing legacy driver Ke
Test the legacy drivers by ushig the following command with SrvMan:
srvman.exe run [
[/stopafter : Toe sree > Sort by Scan Te
cieecvdnemunc pneu nage aeeet
Mom \Programs\Startun Noa
System Behavior Analysis: Monitoring Startup Programs
Various Trojans and malware can alter thegystem settings and add themselves to the startup
menu to perform malicious activities @Rtinuously whenever the system starts. Therefore,
investigators must monitor startup, pgorams thoroughly while detecting trojans. Given below
are the ways to detect hidden Troj@is on a suspect system:
Check boot.ini <
Check boot.ini or bed (bootmgr) entries using command prompt. Open command prompt as an
administrator, type bededit, and press enter button to view all boot manager entries.
Figure 14.23: bedeatt command displaying Windows Boot Manager Entries
Module 14 Page 1364 Computer Hacking Forensic investigator Copyright © by Counc
Tl ight Reserve. Reproduction Stty Prone.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
Check the Windows Services
To find the startup process, investigators can check the Windows services list for viewing services
that start automatically when the system boots. To check the Windows services, investigators
can navigate to Run -> Type services.msc > Sort by Startup Type
—
le heen ion Hp
+¢\migal/Gm>reun
(a
Gamer sence
Gianni
Gergen iat re
Gite Facra Eee
scene tet Sen
comets eves Pat.
{Qcomees Deve
ene ecaion Anam Coan
aor ietece Sat Ta ere
Faure 1424 Services window showing if @fton abut services ona local sstem
‘Check Startup Folders
sei xs
Startup folders store the applications ox sBrtcuts of applications that autostart when the system
boots. To check the startup applicatigns search the following locations on Windows 10:
= C:\ProgramData\Micr: indows\Start Menu\Programs\startup
. C:\Users\(UserName)\ppData\Roaming\Microsoft\Windows\startMenu\Programs\sta
rtup
‘Another method to access startup folders is as follows:
1. Press the Windows and r buttons simultaneously to open the Run box
2. Type shell:startup in the box and click OK button to navigate to the startup folder
Run
{E_Beetbe name of program folder, document or intemet
resource, and Windows will pen it for you.
Gea Ces Ge]
Figure 14.2: shell: startup command in Run box
‘Module 14 Page 1365, ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Comouter Hacking Forensic Ivesteatr am 31249
Mawar Foren
Startup Programs Monitoring Tool: AutoRuns for c! HFI
Windows
‘Autorun for Windows pays programs that reconfigured to run automaticaly during use lagi or system bot
Startup Programs Monitoring Tool: oe for Windows
Source: https://docs.microsoft.com s
This utility shows what programs are c6dfigured to run during system bootup or login, and when
you start various built-in Windows?applications like Internet Explorer, Explorer, and media
players. These programs and driv@rs include those in the startup folder, and in Run, RunOnce,
and other registry keys. Autotiins reports Explorer shell extensions, toolbars, browser helper
objects, Winlogon notificatiéns, AutoStart services, and much more.
Run Autoruns and it shows you the currently configured AutoStart applications as well as the
entire list of registry and file system locations available for AutoStart configuration. Autostart
locations displayed by Autoruns include logon entries, Explorer addons, Internet Explorer addons
including Browser Helper Objects (BHOs), Appinit DLLs, image hijacks, boot execute images,
Winlogon notification DLLs, Windows Services and Winsock Layered Service Providers, met
codecs, and more. Switch tabs to view Autostarts from different categories.
Navigate to the registry or file system location displayed or the configuration of an Autostart item
by selecting the item and using the Jump to Entry menu item or toolbar button and navigate to
the location of an AutoStart image. To disable an AutoStart entry. uncheck its check box. To
delete an AutoStart configuration entry, use the Delete menu item or toolbar button.
Usage of Autorunse
‘Autorunsc is the command-line version of Autoruns.
Syntax:
autorunse [-a <+|bdeghiklmoprsw>] [-cl-ct] [-h] [-m] [-s] [-u) (-vtl ((-2 1 |
fuser]}]
Module 14 Page 1366, ‘Computer Hacking Forensic investigator Cooyreht © by f-Caumel
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and Training
one cing ees nest am 32049
Parameters:
a Autostart entry selection
= All
B Boot execute
D Appinit DLs
E Explorer addons
6 Sidebar gadgets (Vista and higher)
H Image hijacks ~&
' Internet Explorer addons &
K Known DLLs oS
$
L Logon startups (this is the aint)
m___|watenties &
N Winsock rotocdetd network providers
° codecs
o
P Printefrionitor DLLs
R LSA security providers
Ss Autostart services and non-disabled drivers
T Scheduled tasks
w Winlogon entries
« Print output as CSV
-ct Print output as tab-delimited values
“h Show file hashes
-m Hide Microsoft entries (signed entries if used with -v)
s Verify digital signatures
+t Show timestamps in normalized UTC (YYYYMMOD-hhmmss)
Module 16 Page 1367 computer Hacking Foren lovesigator Core © by aml
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and Training
Malware Forensics
Computer Hacking Forensic Investigator fam 31249
If VirusTotal check is enabled, show files that are unknown by
VirusTotal or have non-zero detection, otherwise show only unsigned
files
Print output as XML
~vlrs)
Query VirusTotal for malware based on file hash. Add 'r' to open
reports for files with non-zero detection. Files reported as not
previously scanned will be uploaded to VirusTotal if the 's' option is
specified. Note scan results may not be available for five or more
minutes.
Before using VirusTotal features, you must accept the VirusTotal
terms of service. If you have not accepted th® terms and you omit
this option, you will be interactively ed.
Specifies the offline Windows sue toscan.
Specifies the name of the
be shown. Specify “*” to,
mst for which Autorun items will
in all user profiles
Fie ty Opts Me
Sewers abi
Smee
Same 8 ous pean a omvnirs— @ hzonin gE neon Fm ome
‘a Therese cD Soeieiae Are ones Epcamo Sloot 2 mere
Module 14 Page 1368
Figure 14.26: Autoruns for Windows showing modifications in Autostart registry key and startup folder by malware
‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
System Behavior Analysis: Monitoring Windows
Event Logs
(8 Windows event logs are store in
(a eascate te malware onthe
Windows forensic warktaton 2nd
‘montr e events ager by 8
‘recution ana operations
(© Use Windows bln vant Viewer
ly to montor evens based on
Sec ett, such a event,
trent name, event descipton et
{0 bok or matware ncatos nthe
wwonstaton
System Behavior Analysis: Monitoring Windows Event Logs
The analysis of event logs, which store a petted record of all the activities performed on the
Windows OS based on auditing poli executed, can provide forensic investigators with
valuable information while looking fog.signs of a malware attack on a specific system.
Event logs can be found in the XWindows\system32\winevt\Logs folder in all Windows OS
editions and are stored with.etQx extension.
‘After executing the malware on the Windows forensic workstation, investigators can monitor the
events triggered by its activities via Windows’ built-in utility Event Viewer. They can examine
these events in real-time based on specific details, such as event ID, event name, event
description, etc., to extract data on how the malware is interacting with the system resources
and use them for further analysis.
Module 14 Page 1369 ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
Key Event IDs to Monitor
‘Yaa me pea eh
‘Spocm ormnacee
‘Seni pata Cen
‘nto Conensbyacsesemae
‘Angee mma
a é
oo sees
Key Event IDs to Monitor oe
While performing runtime analysis, investigators need to look at specific event IDs and corelate
the event descriptions to any anomalgu@sictivities to understand the behavior of the malware.
Some of the important event IDs ares follows:
Event 1D 4688 o”
Malicious programs@Sften include an.exe file into the filesystem to compromise a
machine. Event ID 4688, which is generated whenever a new process 1ed, can help
forensic investigators look for suspicious process names or process paths upon malware
execution.
Malicious process names are often misspelled, such as “scvhost.exe” instead of
“svchost.exe,” or “iexplorer.exe” instead of “explorer.exe.” Any Windows process running
from an unusual path should also be investigated, such as C:\Windows\svchost.exe
instead of C:\Windows\system32\svchost.exe
Event ID 5156
This event is generated when Windows Filtering Platform allows a connection between a
program and another process on the same or any other remote computer via UDP or TCP
ports. During dynamic malware analysis, this event ID can be the key to detecting the
origin of attack.
Investigators can use the event description t
© Name of Application
‘The name of full path of the malicious executable used to communicate with external
or internal IP
fentify the following details:
Module 14 Page 1370 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AlRights Reserved. Reproduction is Strict ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
© Direction
It specifies whether the allowed connection is inbound or outbound
© Destination Address
It shows the IP address the connection was received from
© Destination Port
Port number used to start the connection from any remote machine
Event ID 7045 and 4657
Installation of any new service is generally a planned event. An attacker might try to
maintain control over the infected system by creating a persistent malicious service that
remains even after the system is rebooted. &
S$
The attacker can also create a persistent ee by modifying certain
registry keys, which enables him/her to insert ialicious payload into the list of
programs that are executed on system reboot, gen as Windows startup programs.
Hence, if any unexpected service installationoPanomalous registry key modifications are
Identified via event ID 4697 and 4657, it hSDld be considered suspicious and investigated
further. <
Note: In case of Windows Server.Q016 and 2019 operating systems, enabling Security
‘System Extensions in AdvancedAudit Policy Configuration will generate event ID 4697,
which is same as event 704542
Event ID 4660 and 46535"
Once executed, a mSfware might attempt to access, modify, or delete any files and folders
from the compromised system. Investigators, therefore, should monitor event ID 4660,
which is generated on the deletion of any object, which can be a kernel, file system, or
registry object.
As this event ID does not contain the name of the deleted object, investigators need to
track event 4663, which confirms whether access right was actually exercised along with
the name and type of the object, account name, and process name that accessed the
object.
Tracking event IDs 4663 is also useful for tracking other access request information, such
as ReadAttributes, WriteAttributes, READ CONTROL, etc.
Event ID 7036 and 7040
Any malicious program might also disable vital Windows protection services, such as
Windows Defender, Windows Firewall, or antivirus solution, to maintain persistence on
the target system. Monitoring events 7036 and 7040 would enable an investigator to look
for any such suspicious activities.
Module 14 Page 1371 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator am 31249
‘Mabware Forensics
‘hand eight raed arc ps een Psd pot
ne ‘Sepertcats tocar cma bard
J
7005 Avene minted ten thee nde bape mana eames ne 8
ronguac ie peace ones eee rm
157 Arey nines =
146s searetimate eset tier Ober nane. net an ect ce Seis
Jom ton Pein er ha te
‘Module 14 Page 1372 ‘Computer Hacking Forensic Investigator Copyright © by Keown
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
ns " i
Examining Windows Event Logs HEI
‘Event 4588; Process Creation vent 5156: Outbound Network Connection
‘ter ata emcstion,oo reer 1 468 0 Look for een 156th sme tine that shows a0
Event vewer ta shows maou races ame ‘ctheund networ cooncton between the malo
‘ith, tn time of xeon ‘oct and fornscwoataton, song wate
eo
Examining Windows Event-R6gs (Cont'd)
a ee
© oxen mena ce 1 si clam pt inscnince
Fasererepeteerninaien m9 Soca
‘Module 14 Page 1373, ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator am 31249
Malware Forensics
Examining Windows Event Logs (Cont'd)
Event 7040: Service Start Type Change
(© Windows protection services beng sated on
‘sown suchas Windows Frewal, Widows
‘tender, Fan eer SrOWeUS Progra, 3
(00d indicator of malware cote em *
(& Post the exciton ofthe mahare, beer
‘vent 7040 onthe Evert viewer
(© Here the event shows thatthe start ype of ne
‘othr service onthe tual machine has
‘hanged tom auto srt to dable, nseating
macous sciies
Ww
Examining Windows Eve: igs
event 67 Reg Kyau Seon
sO
0 westeidsto mang Soar
Soares
Sarees
She Ss wos eT cll he al
aoe. |
created anew value nnyouTM under the
Run retry key, so that it loads everytime
fonuser login
(© thas alto created 2 malicious VEScrpt fle
IMveFjuOcRvbe in the Temp directory to
persist onthe system
Examining Windows Event Logs
‘As a forensic investigator, you need to execute the malware on the Windows workstation to
determine and analyze the set of Windows events that are triggered by its activities.
For demonstration purpose, we executed a malware named payload.exe. As a result, multiple
event IDs were generated on Windows Event Viewer. Monitoring these events reveals the
following information about the malware and its activities on the system properties:
Module 14 Page 1374 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AlRights Reserved. Reproduction is Strict ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
Event ID 4688: Process Creation
‘After malware execution, you need look for event ID 4688 on Event viewer that shows malicious
process name, its path, and the time of execution. Event 4688 is generated on Windows-based
machines whenever a new process is initiated. Malicious programs often create new processes
or inject themselves into processes already running on the system. Monitoring this event ID post
the execution of the malware sample can help determine the processes created by the malware,
ifany.
Monitoring the event ID 4688, as shown in the screenshot below, provides us with two very
important findings:
= Itshows the creation of a suspicious process called payload.exe
* You can also see that the process payload.exe contains every unusual process path
C:\Users\Robert\Downloads\payload.exe Se
Figure 14.27: Event 1b 4688 showing suspicious process creation
Event ID 5156: Outbound Network Connection
Look for event 5156 along with event ID 4688 that shows an outbound network connection
between the malicious process and forensic workstation, along with the destination address and
port.
Module 14 Page 1375, ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
In the screenshot below, event ID 5156 shows an outgoing network connection between the
“payload.exe” process and the target machine Robert-PC. The event description also includes
192.168.0.141 and 4444 as the destination address and destination port, respectively. This
indicates a connection has been successfully built.
ret Propeties- vent S156 Mirouoft Windows sect auditing
Titer Run-Time
Lepr Rn Time D:
‘igure 14.28: Event ID $156 showing outbound connection
Note: To track events 4688 and 5156, Process Creation and Windows Filtering Connection
auditing should be enabled on the system via Local Security Policy. To do this, type Local Security
Policy on Windows Start Menu search and select Local Policies under Security Settings in the pop-
up window that appears. Select Audit Policy and go to Audit Process Tracking, configure audit
attempts by ticking both Success and Failure, and click OK. Auditing process tracking is now
enabled.
Now, go to Advanced Audit Policy Configuration on the left-side menu and select System Audit
Policies- Local Group Policy Object. Here, you will see an option called Object Access, which will
have Audit Filtering Platform Connection in its submenu. Configure audit attempts by ticking both
Success and Failure and click OK. Windows Filtering Connection auditing is now enabled.
‘Module 14 Page 1375 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
Event 4660: Object Deletion
‘Once installed, the malware might attempt to delete files or folders that would trigger event ID
4660 on Event Viewer. The event description in the screenshot below shows the deletion of an
object by malicious payload.exe process.
Figure 1423: fg 4660 mown ceton of objets
Event 4663: Object Access A
This event is triggered at the saffe time as event 4660. Review this event ID to get more
information about the object afeessed, modified, or deleted by the malware. In the screenshot
below, event description &€ this event ID confirms that the requested access DELETE was
performed by “payload.exe” process. It also shows the deleted object name as “C:\personal
folder\worksheet.txt” and object type as file.
bee topet te a y g
Figure 14.30: Event 1 4663 showing deletion of object by the malicous process
‘Module 14 Page 1377 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
Note: To monitor file and folder deletion via Event Viewer, Object Access auditing should be
enabled via Group Policy Management Editor. Auditing should also be enabled on specific files
and folders that need to be monitored. To do this, select the file/folder that need to be audited,
right-click on it, and select Properties > Security > Advanced Security Settings > Auditing. Select
the Add button, select the users you want to audit in Enter the object name box, and click OK.
Select This folder, subfolder, and files in the Applies to field, choose the access types, and click
OK. Click OK again to close the Properties dialog-box.
Event 7040: Service Start Type Change
‘Windows protection services being disabled on its own, such as Windows Firewall, Windows
Defender, or any other antivirus programs, is a good indicator of malware on the system.
To determine whether the malware has disabled any Windows protection services, such as
Windows Defender, Windows Firewall, and antivirus programs, ¢00 need to monitor event 1D
7040, which will show whether any such service has been . In the screenshot below, the
event ID 7040 shows that the start type of the antivirus $éfvice on the virtual machine has
changed from auto start to disabled, indicating maliciougvethities.
Legge amo 1osbas am,
Tack Category None
Keywords Chasse
Computes DESCTOP-KTESGSS
Figure 14.31: Event 1D 7040 showing thatthe anti-virus service has been disabled
Note: The event ID 7040 is generated automatically in Windows Event Viewer. It is logged when
changes are observed in the system settings.
‘Module 14 Page 1378, ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AlRights Reserved. Reproduction is Strict ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
‘Mabware Forensics
Event 4657: Registry Key Value Modification
You should also review event ID 4657 to detect any changes in the registry made by the malware.
The screenshot below depicts the generation of event ID 4657, showing that the malicious
“payload.exe” file has made changes in the value of the registry key to maintain persistence on
the compromised virtual machine.
=. .
= —-=
a Sone"
Figure 1432: EventID vine cat tay modaton by the mare
The malicious VB script file named, "yYeFjuOcR.vbs” is saved within the Temp directory of the
system and a new value name “ngysuTM” is created under the Run registry key, which indicates
that the malware would load aifmatically each time the user logs in.
&
oe = 18 2
69 = A ban a p+ 28 (mae ,
tose | | f
one =
Sis z
Bowmen + :
Figure 14.33: VB script IWYeF}uOCR wbs in Temp directory
wept > ox
Es - we ses a
Figure 14.34: new value nnyonuTM created under Run key by the malware
Note: Auditing for File and Object Access must be locally as well as globally enabled to detect
changes in the registry
Module 14 Page 1379, ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer cig Fre tar eam 31249
fer oer
System Behavior Analysis: Monitoring API Calls HEI
(© Nateious programs often mate use of
‘windows APs to acest operating ster
Information, suchas fe systems, treads,
reastn, andere!
{A cal montonng helps understanding 2
‘malware’ interaction wth the 08. an
might prove valuable formation
regarng ts stem and network eve
Use tot ke APY Monitor ltecept APL
‘als made ye mahware during rari
(Cont'd)
‘eanainatonct he AP mae by
Eieiccsseee OS
omer ott one
Pepreferayahaberndl- oo)
‘tons cea maou ere
See he wd ene
Stor
1 shat cen amber ot
tut ands one leone
System Behavior Analysis: Monitoring API Calls
Application programming interfaces (APIs) are parts of the Windows OS that allow external
applications to access operating system information such as file systems, threads, errors, registry,
kernel, buttons, mouse pointer, network services, web, and the internet. Malware programs also
make use of these APIs to access the operating system information.
‘Module 14 Page 1380, ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AllRights Reserved. Reproduction i Strict Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
Investigators need to gather the APIs related to malware programs and analyze them to reveal
its interaction with the operating system, as well as the activities it has been performing on the
system. They can use tools like API Monitor to perform the analysis.
‘The examination of the API calls, as shown in the screenshots below, made by a malware sample
upon execution via API Monitor tool reveals the following:
= The malware has repetitively used “CreateFileA” and “NtCreateFile” functions to create
malicious files in the system folder of the forensic workstation
= Ithas attempted to create a number of HTML and SCR files with the following names:
© molani.ser
© evan.htmt
© avril.ntmi
© nemo.htm!
eng ar
Figure 14.35: Creation of file molan.serin system drive
= tee
ree A cstoct te annem ive
Fe 437: conte el inom ve
assim + renntstonnet) =
Hore 3h Cente! temenointnsensine
st re com aig mit oh yma
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
‘API Monitor
Source: www.rohitab.com
‘API Monitor is a free software that lets you monitor, and control API calls made by applications
and services. This tool helps in viewing how applications and services work, or for tracking
problems in applications.
Features
"64-bit Support
‘API Monitor supports monitoring of 64-bit applications and services. The 64-bit version
can only be used to monitor 64-bit applications and the 32-bit version can be only be used
to monitor 32-bit applications. To monitor a 32-bit application on 64-bit Windows, you
must use the 32-bit version. Note that the 64-bit installe{@b API Monitor includes both
64-bit and 32-bit versions. xs
* Summary View with Syntax Highlighting aS
‘The Summary window displays coarse API call. This includes the Thread ID
and the name of the DLL that made the ARQcall, the syntax-highlighted API call with all
parameters, and the return value. if the @PPcall fails, information about the error is also
displayed.
+ API Definitions & COM interfaces
‘API Monitor comes with AP| definitions for over 13,000 APIs from almost 200 DLLs and
over 17,000 methods fregp3,300+ COM Interfaces (Shell, web Browser, DirectShow,
DirectSound, DirectX, f7Ect2D, DirectWrite, Windows Imaging Component, Debugger
Engine, MAPI, etc). ABTS are organized into categories and sub-categories (as specified in
MSDN). The API Capture filter enables you to select APIs for monitoring.
* Structures, Unions, Enums and Flags
API Monitor can decode and display 2000 different structures and unions, 1000+
enumerated data types, and 800+ flags. Buffers and arrays within structures can also be
viewed.
* Buffer View
API Monitor can display both input and output buffers. The amount of data displayed is
automatically calculated from other arguments to the API or from the API return value.
The maximum amount of data to be captured Is configurable.
The length IpBuffer is calculated by looking at the value of IpNumberOfBytesRead after
the API call has executed. In this case, the value returned is 174, which is the displayed
length of the buffer.
= Call Tree
API Monitor displays a call tree which shows the hierarchy of API calls. The following
screenshot displays a call tree for a CoGetClassObject call made by a VB application that
Module 14 Page 1382 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘Al Rights Reserved. Reproduction is Stl ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator
Malware Forensics
= Decode Parameters and Return Values
the parameters pane and the summary pane.
am 31249
loads the Microsoft Winsock ActiveX control. The ActiveX control MSWINSCK.OCX makes
calls to WSAStartup and CreateWindow—xA from DilMain.
Both parameters and return values can be displayed in a user-friendly format. The first
screenshot below shows the normal view with the parameter values displayed as-is. For
dwShareMode, API Monitor displays FILE_SHARE_DELETE | FILE_SHARE_READ instead of
5 when the Decode Parameter Values option is enabled. This option is available both in
Module 14 Page 1383 ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Comouter Hacking Forensic Ivesteatr am 31249
Mawar Foren
System Behavior Analysis: Monitoring Device c! HFI
Drivers i.
(a Mawar getsinstates og with he cevce ders ownladed rom untrusted Sources 2 Sener 25 25h! © 018
1 Younus scanforsmpious device rer ad very they ae genie nd owrioaed em the pubes orga te
15 Gotahun > type msnio2 > SotwareEnvkonment 3 System Divers
System Behavior Analysis: Monitoring Wévice Drivers
Malware gets installed along with the esas downloaded from untrusted sources and
use them as a shield to avoid detecti must scan for suspicious device drivers and verify if,
they are genuine and downloaded fragn the publisher's original ste.
To view device drivers on a Windgws machine, navigate to Run > Type msinfo32 > Software
Environment > System Drvgeed
Module 14 Page 1384 ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
Device Drivers Monitoring Tool: DriverView
Deve uy pay tl eve rr carry leaded nthe str For each erin the i inst
Inlomation ssh at heland aes Be der, Sescpton versn, pod name andthe ampany tat ested et,
asoloed
re
i
ft
G
TUTTE
TUTE
Device Driver Monitoring Tool: melee iee:
Source: http://www.nirsoft.net s
DriverView utility displays a list of all“@Svice drivers currently loaded on the system. For each
driver in the list, additional nego such as the load address of the driver, description,
version, product name, and the cdsripany that created the driver, is displayed.
°°
Module 14 Page 1385 ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
System Behavior Analysis: Monitoring Files and c! HFI
Folders
(© Youcan ue fs and flier ntgrity montoring tok to examin fle system and foleractivtyInreabtimeon an
(nletes tem
ceca eae oe hs ht ave ee pal gre by Mert
1 Toner SCRE for > Ran ye se res ner
== <
D crceeietatiuignyconcecrmensunghson |e
a ‘Wee CONTROL.
System Behavior Analysis: Monitoring Files and Folders
Malware can also modify the system filegSand folders to save some information on them.
Investigators should be able to find theGtes and folders which a malware creates and analyze
them to collect any important information stored in them. These files and folders may also
contain hidden program code or Vicious strings that the malware will schedule for execution
at a specific time.
°°
Sigverif,
File Signature Verification, also called Sigverif, is an inbuilt Microsoft utility in Windows 10/8/7.
It checks the integrity of critical files that have been digitally signed by Microsoft. It thus can help
investigators find unsigned drivers. To launch SIGVERIF, go to Run, type sigverif, and press Enter.
Few
Source: https://docs. microsoft.com
The File Checksum Integrity Verifier (FCIV) is a command prompt utility that generates and
verifies hash values of files using MDS or SHA-1 algorithms.
The FCIV utility has the following features:
‘Supports MDS or SHA1 hash algorithms (The default is MDS)
= Can output hash values to the console, or store the hash value and file name in an XML
file
= Can recursively generate hash values for all files in a directory and in all subdirectories
{for example, fciv.exe c:\-r)
Module 14 Page 1385 ‘Computer Hacking Forensic Investigator Copyright © by Ee-Counelt
‘All Rights Reserved. Reproduction is Stet ProhibitedRobusta Technology and Training
Computer Hacking Forensic Investigator fam 31249
Malware Forensics
= Supplies an exception list to specify files or directories to hash
= Can store hash values for a file with or without the full path of the file
Tripwire Enterprise
Source: https://www.tripwire.com
Tripwire Enterprise is a tool for assessing IT configurations and detecting, analyzing, and
reporting any change activity across IT infrastructure. Tripwire Enterprise can monitor servers,
desktops, directory servers, hypervisors, databases, middleware applications, and network
devices.
Tripwire Enterprise captures a baseline of server file systems, desktop file systems, directory
servers, databases, virtual systems, middleware applications, and network device configurations
in a known good state. It undertakes ongoing integrity checks ané>then compares the current
states against these baselines to detect changes. While dai this, it collects information
essential to the reconciliation of detected changes. <<
Tripware Enterprise can crosscheck detected changes wth either defined IT compliance policies
(policy-based filtering); documented changes in in a CCM system or a list of approved
changes; automatically generated lists created ich management and software provisioning
tools; and against additional ChangelQ™ capebilities. This enables it to recognize the desired
changes and expose the undesired changesqutomatically.
xe
&
o
Module 14 Page 1387 ‘Computer Hacking Forensic Investigator Copyright © by Ke-Pounelt
‘AllRights Reserved. Reproduction s Stel Prohibited.Robusta Technology and Training
Computer Hacking Forensic Investigator
Malware Forensics
am 31249
File and Folder Monitoring Tool: PA File Sight
(© PA ile sight is afle monitoring
uly that audits whieh
‘ter/appication i deleting es,
‘moving fies, or reading fies. can
generate reports with detalls such
User acount ning
domanyAcive Deecary
ser computer name
Target He and folder
‘Actvty dove onthe fe (ea, we,
eee)
ite ac tine of action
File and Folder Monitoring Tool: PA
Source: https://www.poweradmin.com s
PA File Sight is a file monitoring and ae<éss auditing software that tracks who is deleting files,
moving files, or reading files; detecdsers copying files; and optionally blocks access.
With its file monitoring featureg can determine things like the following:
+ when a file or folderWas deleted
= who deleted or moved files or folders
computer name)
= who is reading and writing sensitive files
= when a new file or folder is created, renamed, or moved
File Auditing Features
* File Monitoring
© Allfiles or just a subset
© File and folder permission changes
© Successful actions and failures
© File and folder creation, deletion, access (reads), and changes (writes)
= watch for log file modifications, which is useful for PCI DSS file integrity monitoring (FIM)
= which computer they read/wrote/deleted the file or folders from (IP address* and
© Real-time monitoring that does not require enabling system audit events
Module 14 Page 1388 ‘Computer Hacking Forensic Investigator Copyright © by EE-Coumelt
‘AlRights Reserved. Reproduction is Strict Prohibited