هظفاح شاتکف
یلضفت لبط
یلاعت همسب
Ref The Art of Memory Forensics SANS 508 - - PowerPoint PPT Presentation
Ref The Art of Memory Forensics SANS 508 .
یلضفت لبط
یلاعت همسب
Ref The Art of Memory Forensics SANS 508
URLاهویاهسردآ IP
cache ، clipboard
یمدوش.
دنک.
دشاب.
Panel>System>Advanced System Settings>Startup and Recovery>Settings
adminدرومزاینتسا.
یمدنیامن.
یزاجمیکیزا taskییاههکربیوررتویپماکارجایم،دوشیمدنراگن.
Device-Memoryاریپکیمدننکویخربرگیدنیاهیحاناریپکیمندننک.
Plugin Format crashinfo Crash dump hibinfo Hibernation File vmwareinfo VMware
RAMردنامز hibernationهریخذیمدوش.
Evidence E01 Files\Quantum1.E01"
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01"
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01" | findstr page
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01" 24 > pagefile.sys
quering the registry for a profile
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01" | findstr -i config/SYSTEM$
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01" | findstr -i config/SOFTWARE$
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01" 2502 > SYSTEM
"C:\Users\tala\Desktop\Encase\Encase_Evidence_E01_Files\Encase Evidence E01 Files\Quantum1.E01" 2667 > SOFTWARE
NT\CurrentVersion" software
WindowsVista_0401.vmem
executive objectsیمدنیوگاریزطسوت Windows Object Managerتیریدم یمدنوش–یئزجزالنرک.
executive objectاهکی structureیمدنشابیلوهمه structureاهکی executive
executive objectلیدبتیمدوشهکزودنیوهبنآیاهردهیفلتخملصتم یمدنکاتییاهسیورسارتیریدمدیامن.
Description Structure Object Name
کی instanceزاکیلیافزابهکرگنایامنیسرتسدکی processای لوژاملنرکهبلیافیم،دشابلمتشمرب،اهزوجمهیحانیازاظفاحههک یاوتحملیافردنآهریخذیمدوشومانلیاف.
_FILE_OBJECT File
هظفحمیاهکهباهنامسیرهزاجایمدهدردیاضفسردآیزاجم یصوصخارجادوشو handleییاهارهبعبانمدننام،اهلیافیاهدیلک یرتسیجروهریغهگندراد.
_EPROCESS Process
زا aliaseاهینابیتشپیمدنکهککمکهبتشاگن share pathو یاههاگتسدلباقلمحهبمانویاردیمدیامن. _OBJECT_SYMBOL IC_LINK
SymbolicLink
تاعلبطا contextیتینما(دننامهسانشیتینما( SID )واهزوجم)ار یارب processاهو threadاههگنیمدراد._TOKEN
Token
Description Structure Object Name کیءیشهکرگنایامنتیدوجومیارجایدنبنامزهدشرد کی processوریاس contextطبترمیمدشاب. _ETHREAD Thread کیءیشهکرگنایامنهحفصشیامنتساولماشایشاء ناربراکدننامهرجنپ،اهاهونمو buttonاهیمدشاب. tagDESKTOP Desktop رگنایامنریوصتزایاهرویاردیراذگرابهدشدوملنرکاتس ویواحییاهسردآیاربعباوتیلرتنک Ioتسا. _DRIVER_OBJECT Driver کی instanceزایاهدیلکزابیرتسیجرهکیواح یتاعلبطاهرابردریداقمدیلکوهدادتسا. _CM_KEY_BODY Key
executive Objectاهیاراد Object Header ( _OBJECT_HEADER )ورفصایرتشیب headerیباختنادنتسه.
headerیاهیباختنالبقزا
WindowsVista_0401.vmem
هدادطوبرمهبیاهاضاقتءازجا Kernel Modeاررددوخهریخذدیامن(دنناملوژام NT ، device driver ) .
headerیتسا( POOL HEADER )هکیواحتاعلبطاگابیدو یسرباسحتسا.
memory poolیاهابزیاسریغتمییایوپتساهکیاربصیصختهظفاح متسیسراکبیمدور.
memory poolدوجودراد:
non-pagedدنتسه.
header, and any optional headers.
pool header describes.
uniquely identify the code path taken to produce the allocation
instance )زاکی executive objectداجیا،دوشکیکولبزا هظفاحهکهبردقیفاکگرزب،دشابیاربهریخذیزاس
headerشیاهردیکیزا poolیاهمتسیسلماعدیابصیصختدبای.
Assuming that a process wants to create a new file using the Windows API, the following steps will occur:
kernel32.dll.
reaches the native NtCreateFile function.
for its optional headers.
whether to allocate paged or nonpaged memory, as well as the four-byte tag to use.
executive objectرگیدهدافتسا،دوشنکولبهظفاحهبتسیلدازآ poolربیم،ددرگ ویمدناوتیاربفراصمرگیداددجمصیصختدبای.
allocations ) ، pool tag scanningیمدنیوگ.
pool tag scanning ،عورشوجتسجردهظفاحابراهچتیاب tagیمدشاب.هبکمکزیاس صیصختوعونهظفاحنیاوجتسجیشرافسرتیمدوش.
processهراشایم،دنکادیپ درک.
یاربره Pool Tagدرومهدافتساراکبیمدور.
\courseware\WindowsVista_0401.vmem --profile VistaSP1x86 pooltracker -- tags=Proc,Thre,File,Driv
processدنترابعزانییعتهکنآ:
hidden processاهارفشک؟مییامن
processاهارهبیاهباسحیربراکصاخطبترم؟مییامن
the data. This method typically cannot show you terminated or hidden processes.
see parent and child relationships.
plugin can also find terminated and unlinked (hidden) processes.
reference different sources of information and reveal malicious discrepancies.
WindowsVista_0401.vmem
lsass.exe: The local security authority subsystem process is responsible for:
be found in its private memory space.
later systems
winlogon.exe presents:
CTRL+ALT+DEL.
File Protection (WFP).
navigation,
various users who may log on via the console or Remote Desktop Protocol (RDP).
executable on disk).
threads.
the System process (PID 4) appears to own any sockets or handles to files that kernel modules open.
commands executed via cmd.exe, so you can extract command history from its memory space.
private memory space.
providing a container for DLLs that implement services
Directory Parent Process Process System32 Winlogon.exe, wininit.exe Services.exe System32 Services.exe Svchost.exe Services.exe spoolsv.exe Services.exe SearchIndexer.exe
Pslist psscan
DKOM ،مدعلاصتاکی processزاکنیلتسیلودهفرط EPROCESSتسا.
Flinkو Blinkراکنیاماجناریذپتسا.
:نامه pool tag scanningتسا.
:
processدیابلقادحکی threadهتشاد،دشابیممیناوتلابندءایشا thread میدرگبواهنآارهب processاهمیراگنب.
rootkitهتسناوتدشاب pool tagاریارب processرییغت،دهددیابهمه pool tagاه اریارب thread poolاهرییغتدهداتهتخانشدوشن.
:
processو threadلیخدتسا.
handleنآرتشیبوجتسجدرکاتتسیلهمه processاهارمیبایب.
handle tableصاخردهظفاح kernelتساهکهمهءایشا processیاهلاعفو threadاهاررددوخهگنیمدراد.
processاهارهکرد sessionربراکتساردتسیل SessionProcessLinksهگنیمدراد.
threadیاهلصتمهبپاتکسدهریخذیمدوش.
،ردعقاو contextیتینماارنآصخشمیمدیامن.لماشدراوملیذتسا:
processارارجایمدننک.
privileges )هکهزاجاارجااردنراد.
processهبکیءیشیسرتسددبایبای APIیصاخ اریناوخارف،دنکزاهدادنورد process tokenهدافتسایمدنک.
processارلامعِایمدیامن.
S-1-5-21-4010035002-774237572-2085959976-1000
SID The revision level (version
specification) The identifier authority value The local computer or domain identifier A relative identifier that represents any user or group
getsids plug-in
\courseware\WindowsVista_0401.vmem getsids
\courseware\WindowsVista_0401.vmem getsids -p 832
\courseware\WindowsVista_0401.vmem printkey -K "Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-3357474304-2915131210-3987339850- 1000"
identifiers-in-windows-operating-systems
kernel objectتسادننام،لیافدیلک،یرتسیجر processای thread .
processردنامزهیهتریوصتهباهنآیسرتسدادیپ،هدرکهب یدادعتزاجیاتنیشاتکفیممیسر:
processیلیافیصاخاریمهدناوخاییم؟هتشون
processیهبدیلکیرتسیجریسرتسدادیپ؟هدرک
processیمتسیسلیافهاررودارهتشاگن؟تسا
processاهتاعلبطایدیفمارردرایتخارارقیم،دهد_EPROCESS ، هظفاحیلصاهک processهبدوخصیصختیم،دهدیواحتاعلبطایدیفمتسا.
executable paths, temporary directories, home folders, and so on.
in this list, including the DLLs, heaps, and environment variables.
and its standard handles
placed on the heap, as is data sent or received over network sockets.
reconstruct call history), and local variables.
documents, and so on.
variables for the application.
memory, it unpacks, enabling you to dump plain-text code back to disk.
\courseware\WindowsVista_0401.vmem --profile=VistaSP2x86 procdump -- dump-dir=outDir
1180 --dump-dir=outDir
p 1180 --dump-dir=outDir
PEBتسا.
Process
processارزاغآیمدیامن.
Process’s heap
DLLیاهیراذگرابهدشتسا.
PEBیارادیاهدلیفریزتسا:
processمهنونکاردلاحگابیدندشتسا.
processهکیئاجلیافییارجایلصایراذگرابهدشتسا.( plugin: procdump )
DLLیاهیراذگرابهدشرد processتسا.
Processهکردماگنهنیزاغآیهد processهبروطکیتاموتاداجیایمدوش.
heapیاهکی process .هبروطشیپضرفره processکی heapدراداماابیناوخارف HeapCreateناکماداجیادادعتیرتشیب heapمهارفیمدوش.
heapیاه process .نیلوایدوروردتسیلهب ProcessHeapهراشایم دیامن.
اجنآهکلیافییارجاسسورپهشیمهیاربیراذگرابنیلوایم،دشابیدورونآردیاضفآسرد نیلواتسا.
یمدنک.
یاهلیافنآاجکربیورکسیدرارق،دنرادردرایتخارارقیمدهد.
heap
heapهریخذیمدنوش
handleیاهدرادناتسا
redirectهدشتسا.
DLLاه
DLLیاهیراذگرابهدشطسوتسسورپردمتسیس،لماعونینچمه APIییاههکیاربتسیلندرکاهنآهدافتساهدشتسا.نینچمهفشکهناخباتکیاهنپناهو unlinked
PEزاهظفاح
PEزاهظفاح dumpیمدندرگویاربلیلحتاتسیاهدامآیمدنوش.
NULLهمتاخیم،دنباییهدنامزاسیمدنوش.
Path )هبهمانربیاهییارجا
PATHEXT )
PATH
PATHEXT
PATHرد explorer.exeرییغتهدرک
Start->Runروتسد calcاریناوخارفهدرکتسا.
PATHEXTلماشتسیلییاهدنوسپتساهکرگاربراکیدنوسپارصخشم،دنکنسوتط متسیسابنآاهدنوسپوجتسجیمدوش.
calcارپیاتیم،دنکادتباهبلابند calc.comدعب calc.exeوردتیاهن calc.batیمددرگ.
calc.zzzیمددرگودکداهندبارارجایمدنک.
calc.exeارارجایمدنکوردتیاهنربراکهجوتمیمندوش.
profile=WinXPSP3x86 envars -p 1724
threat actorاهجیاریم،دنشاباریزهبعبانمفلتخممتسیسسرتسدی دنراد:
process
هبماگنهلیلحت DLLاهدیابهبدراوملیذهجوتمییامن:
:
DLLناشیاهارابعطقلاصتاراتخاسهدادارفزاکیایدنچتسیل ایابهرابودیسیوندلیفمانایریسمردراتخاسهدادارفناهنپدنیامن.
DLLاهابیاهمانکوکشماییاهمانانشآانردیاهلحمدرادناتساریغدیابعلطممیشاب.
C:\Windows\system32\sys\kernel32.dll
DLLهجوتدومن.
Usage DLL networking ws2_32.dll cryptography crypt32.dll firewall maintenance hnetcfg.dll access to protected storage pstorec.dll
DLLردلیافییارجاهبتروصکیتاموتارد یاضفسردآسسورپیراذگرابیمددرگ.
import ،دنتسهنیاربانبهکینامزیراذگرابیم،دندرگهمه DLLیاه هفاضایاهکهبنآدامتعا،دنرادزینهبیاضفسردآسسورپیراذگرابیمدنوش.
LoadLibraryای LDRLoadDLLهبهارمهمان DLLیاربیراذگرابیناوخارف دیامن.
DLLرد IATطوبرمهبسسورپیقاب یمندنام.
dllاهاریمدهد.
DLLیاهناهنپ
868
868 -b 0x00080000 --dump-dir=outDir
contextسسورپرگیدماجنادنهد.
ندیدزدتاعلبطازامتسیس.
سسورپهاررودایندوزفادیلکیرتسیجرهکثعابیمدوشیاهسسورپدیدج DLLدرومرظن مجاهماریراذگرابدنیامن.
DLLصاخزاکسیدیمدنک.نیا DLL لبقزاقیرزتدیابربیورکسیددشاب.
DLLار(هبناونعهلابندیازااهتیاب)ردیاضفهظفاحسسورپدصقمیم دسیون.نیزاغآیهد DLLنودب windows Loaderماجنایمدوش.
suspendedزاغآیمدنک(دننام lsass.exe ) .شیپزا resume ،نآشخبییارجادازآوابدکداهندباددجمیراذگرابیمدوش.
\courseware\stuxnet.vmem
\courseware\coreflood.vmem
not-to-execute-tampered-binaries
صیصختهتفایارحیرشتدیامن.
VADداجیایم دنک.
VADیارب،سسورپراتخاستاعطقهظفاحارصخشمیمدیامن.
VADتاعلبطالیذرارقیمدنریگ:
mappedfile )
VADهراشایمدیامن.
APIراکبهتفرویاهرتماراپلاسرا،هدش میمصتیمدریگ.
VADتاعلبطایفلتخمدوجودراد:
:یتاعلبطاارهرابردلیافای DLLهتشاگنهدشردهیحانهگنیمدراد.
short nodeیارادشخب subsectionتسینویمندناوتلیافهتشاگنهدشارهریخذدیامن.
mappedfileبسانمتسین.
دنراد.
copy-on-writeارمهارفیمدنک. DLLاهبلغازانیاعون تظفاحمهدافتسایمدننک.
copy-on-writeارمهارفیمدنک.
قیرزت،دنیامندننام Services.exe ، SVCHost.exeو WinLogon.exe .
VADارسراپیمدنکاتیاهدکقیرزتهدشارادیپدنک:
VirtualAllocEx/WriteProcessMemory داجیاهدشدنازاعون_MMVAD_SHORTدنتسه.
PAGE_EXECUTE_READWRITE ،دنشابیگژیو یبوخیارب malfindتسا.
REF
Based Code Injection Attacks in Memory Dumps, International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment, 2017.
to read and write other process’ memory as if it were a debugger.
least PROCESS_CREATE_THREAD, PROCESS_VM_OPERATION, and PROCESS_VM_WRITE.
typically PAGE_READWRITE.
A transfers a string to Process B’s memory by calling
DLL and it is written at the address allocated in the previous step.
executes the LoadLibrary function. The thread’s parameter is set to the full path to the malicious DLL, which already exists in Process B’s memory.
A calls VirtualFree to free the memory containing the DLL’s path.
Start a new instance
a legitimate process (for example, C:\windows\system32\ lsass.exe), but with its first thread suspended. At this point, the ImagePathName in the PEB of the new process identifies the full path to the legitimate lsass.exe.
come from a file on disk, an existing buffer in memory, or over the network.
free or unmap the containing memory section. At this point, the process is just an empty container (the DLLs, heaps, stacks, and open handles are still intact, but no process executable exists).
can be read, written, and executed. You can reuse the same ImageBase or a different one
in lsass.exe.
in lsass.exe.
state) to point at the malicious process’ AddressOfEntryPoint value.
the container created for lsass.exe. The ImagePathName in the PEB still points to C:\windows\system32\lsass.exe.
profile=WinXPSP3x86 pslist | findstr lsass
profile=WinXPSP3x86 dlllist -p 680,868,1928 | findstr lsass
profile=WinXPSP3x86 vadinfo -p 680,868,1928 --addr=0x01000000
profile=WinXPSP3x86 ldrmodules -p 1928
patchیاهیتینما
startupتسا.
یمدنوش.
\courseware\WindowsVista_0401.vmem --profile=VistaSP2x86 hivelist
profile=VistaSP2x86 printkey -K "controlset001\control\computername"