内存取证工具-volatility、foremost

内存取证

1. 内存取证工具volatility

猜测dump文件的profile值

root@kali:~/CTF# volatility -f mem.vmem imageinfo
Volatility Foundation Volatility Framework 2.6
INFO    : volatility.debug    : Determining profile based on KDBG search...
          Suggested Profile(s) : WinXPSP2x86, WinXPSP3x86 (Instantiated with WinXPSP2x86)
                     AS Layer1 : IA32PagedMemoryPae (Kernel AS)
                     AS Layer2 : FileAddressSpace (/root/CTF/mem.vmem)
                      PAE type : PAE
                           DTB : 0xb18000L
                          KDBG : 0x80546ae0L
          Number of Processors : 1
     Image Type (Service Pack) : 3
                KPCR for CPU 0 : 0xffdff000L
             KUSER_SHARED_DATA : 0xffdf0000L
           Image date and time : 2016-05-03 04:41:19 UTC+0000
     Image local date and time : 2016-05-03 12:41:19 +0800
root@kali:~/CTF#

看到,profile可能是WinXPSP2x86

直接获取volshell

shell的命令:

dt("内核关键数据结构名称"")

如: dt("_PEB")

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 volshell
Volatility Foundation Volatility Framework 2.6
Current context: System @ 0x821b9830, pid=4, ppid=0 DTB=0xb18000
Welcome to volshell! Current memory image is:
file:///root/CTF/mem.vmem
To get help, type 'hh()'
>>> dt("_PEB")
 '_PEB' (528 bytes)
0x0   : InheritedAddressSpace          ['unsigned char']
0x1   : ReadImageFileExecOptions       ['unsigned char']
0x2   : BeingDebugged                  ['unsigned char']
0x3   : SpareBool                      ['unsigned char']
0x4   : Mutant                         ['pointer', ['void']]
0x8   : ImageBaseAddress               ['pointer', ['void']]
0xc   : Ldr                            ['pointer', ['_PEB_LDR_DATA']]
0x10  : ProcessParameters              ['pointer', ['_RTL_USER_PROCESS_PARAMETERS']]
0x14  : SubSystemData                  ['pointer', ['void']]
0x18  : ProcessHeap                    ['pointer', ['void']]
0x1c  : FastPebLock                    ['pointer', ['_RTL_CRITICAL_SECTION']]
0x20  : FastPebLockRoutine             ['pointer', ['void']]
0x24  : FastPebUnlockRoutine           ['pointer', ['void']]
0x28  : EnvironmentUpdateCount         ['unsigned long']
0x2c  : KernelCallbackTable            ['pointer', ['void']]
0x30  : SystemReserved                 ['array', 1, ['unsigned long']]
0x34  : AtlThunkSListPtr32             ['unsigned long']
0x38  : FreeList                       ['pointer', ['_PEB_FREE_BLOCK']]
0x3c  : TlsExpansionCounter            ['unsigned long']
0x40  : TlsBitmap                      ['pointer', ['void']]
0x44  : TlsBitmapBits                  ['array', 2, ['unsigned long']]
0x4c  : ReadOnlySharedMemoryBase       ['pointer', ['void']]
0x50  : ReadOnlySharedMemoryHeap       ['pointer', ['void']]
0x54  : ReadOnlyStaticServerData       ['pointer', ['pointer', ['void']]]
0x58  : AnsiCodePageData               ['pointer', ['void']]
0x5c  : OemCodePageData                ['pointer', ['void']]
0x60  : UnicodeCaseTableData           ['pointer', ['void']]
0x64  : NumberOfProcessors             ['unsigned long']
0x68  : NtGlobalFlag                   ['unsigned long']
0x70  : CriticalSectionTimeout         ['_LARGE_INTEGER']
0x78  : HeapSegmentReserve             ['unsigned long']
0x7c  : HeapSegmentCommit              ['unsigned long']
0x80  : HeapDeCommitTotalFreeThreshold ['unsigned long']
0x84  : HeapDeCommitFreeBlockThreshold ['unsigned long']
0x88  : NumberOfHeaps                  ['unsigned long']
0x8c  : MaximumNumberOfHeaps           ['unsigned long']
0x90  : ProcessHeaps                   ['pointer', ['array', <function <lambda> at 0x7f88d57decf8>, ['pointer', ['_HEAP']]]]
0x94  : GdiSharedHandleTable           ['pointer', ['void']]
0x98  : ProcessStarterHelper           ['pointer', ['void']]
0x9c  : GdiDCAttributeList             ['unsigned long']
0xa0  : LoaderLock                     ['pointer', ['void']]
0xa4  : OSMajorVersion                 ['unsigned long']
0xa8  : OSMinorVersion                 ['unsigned long']
0xac  : OSBuildNumber                  ['unsigned short']
0xae  : OSCSDVersion                   ['unsigned short']
0xb0  : OSPlatformId                   ['unsigned long']
0xb4  : ImageSubsystem                 ['unsigned long']
0xb8  : ImageSubsystemMajorVersion     ['unsigned long']
0xbc  : ImageSubsystemMinorVersion     ['unsigned long']
0xc0  : ImageProcessAffinityMask       ['unsigned long']
0xc4  : GdiHandleBuffer                ['array', 34, ['unsigned long']]
0x14c : PostProcessInitRoutine         ['pointer', ['void']]
0x150 : TlsExpansionBitmap             ['pointer', ['void']]
0x154 : TlsExpansionBitmapBits         ['array', 32, ['unsigned long']]
0x1d4 : SessionId                      ['unsigned long']
0x1d8 : AppCompatFlags                 ['_ULARGE_INTEGER']
0x1e0 : AppCompatFlagsUser             ['_ULARGE_INTEGER']
0x1e8 : pShimData                      ['pointer', ['void']]
0x1ec : AppCompatInfo                  ['pointer', ['void']]
0x1f0 : CSDVersion                     ['_UNICODE_STRING']
0x1f8 : ActivationContextData          ['pointer', ['void']]
0x1fc : ProcessAssemblyStorageMap      ['pointer', ['void']]
0x200 : SystemDefaultActivationContextData ['pointer', ['void']]
0x204 : SystemAssemblyStorageMap       ['pointer', ['void']]
0x208 : MinimumStackCommit             ['unsigned long']
>>> 

查看进程:

root@kali:~/CTF# 
root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 pslist
Volatility Foundation Volatility Framework 2.6
Offset(V)  Name                    PID   PPID   Thds     Hnds   Sess  Wow64 Start                          Exit                          
---------- -------------------- ------ ------ ------ -------- ------ ------ ------------------------------ ------------------------------
0x821b9830 System                    4      0     62      253 ------      0                                                              
0x81fb9210 smss.exe                552      4      3       19 ------      0 2016-05-03 04:32:10 UTC+0000                                 
0x81c14da0 csrss.exe               616    552     10      328      0      0 2016-05-03 04:32:12 UTC+0000                                 
0x81f81880 winlogon.exe            640    552     18      449      0      0 2016-05-03 04:32:12 UTC+0000                                 
0x8208fda0 services.exe            684    640     16      260      0      0 2016-05-03 04:32:12 UTC+0000                                 
0x81c32b10 lsass.exe               696    640     18      333      0      0 2016-05-03 04:32:12 UTC+0000                                 
0x820a19a0 vmacthlp.exe            852    684      1       25      0      0 2016-05-03 04:32:13 UTC+0000                                 
0x81c30458 svchost.exe             864    684     18      201      0      0 2016-05-03 04:32:13 UTC+0000                                 
0x81c67020 svchost.exe             948    684     11      238      0      0 2016-05-03 04:32:13 UTC+0000                                 
0x81ce7da0 svchost.exe            1040    684     55     1103      0      0 2016-05-03 04:32:13 UTC+0000                                 
0x81c25020 svchost.exe            1096    684      4       66      0      0 2016-05-03 04:32:13 UTC+0000                                 
0x82002b28 svchost.exe            1256    684     13      194      0      0 2016-05-03 04:32:14 UTC+0000                                 
0x81f6c988 explorer.exe           1464   1448     12      329      0      0 2016-05-03 04:32:14 UTC+0000                                 
0x82085550 spoolsv.exe            1576    684     13      140      0      0 2016-05-03 04:32:14 UTC+0000                                 
0x81f64560 vmtoolsd.exe           1712   1464      5      145      0      0 2016-05-03 04:32:15 UTC+0000                                 
0x820a3528 ctfmon.exe             1736   1464      1       78      0      0 2016-05-03 04:32:15 UTC+0000                                 
0x81f7d3c0 vmtoolsd.exe           2020    684      7      273      0      0 2016-05-03 04:32:23 UTC+0000                                 
0x8207db28 TPAutoConnSvc.e         512    684      5       99      0      0 2016-05-03 04:32:25 UTC+0000                                 
0x81c26da0 alg.exe                1212    684      6      105      0      0 2016-05-03 04:32:26 UTC+0000                                 
0x81f715c0 wscntfy.exe            1392   1040      1       39      0      0 2016-05-03 04:32:26 UTC+0000                                 
0x81e1f520 TPAutoConnect.e        1972    512      1       72      0      0 2016-05-03 04:32:26 UTC+0000                                 
0x81f9d3e8 TrueCrypt.exe          2012   1464      2      139      0      0 2016-05-03 04:33:36 UTC+0000                                 
root@kali:~/CTF# 

查看缓存在内存的注册表

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 hivelist
Volatility Foundation Volatility Framework 2.6
Virtual    Physical   Name
---------- ---------- ----
0xe1e9f9d8 0x0bf169d8 DeviceHarddiskVolume1Documents and SettingsAdministratorLocal SettingsApplication DataMicrosoftWindowsUsrClass.dat
0xe1cee5d0 0x0be075d0 DeviceHarddiskVolume1Documents and SettingsAdministratorNTUSER.DAT
0xe1b99b60 0x0ae0ab60 DeviceHarddiskVolume1Documents and SettingsLocalServiceLocal SettingsApplication DataMicrosoftWindowsUsrClass.dat
0xe1b95008 0x0adc6008 DeviceHarddiskVolume1Documents and SettingsLocalServiceNTUSER.DAT
0xe1a7c2a8 0x0a76b2a8 DeviceHarddiskVolume1Documents and SettingsNetworkServiceLocal SettingsApplication DataMicrosoftWindowsUsrClass.dat
0xe1a72b60 0x0a6e1b60 DeviceHarddiskVolume1Documents and SettingsNetworkServiceNTUSER.DAT
0xe146c398 0x084a3398 DeviceHarddiskVolume1WINDOWSsystem32configsoftware
0xe1699758 0x08246758 DeviceHarddiskVolume1WINDOWSsystem32configdefault
0xe166faa8 0x05e7eaa8 DeviceHarddiskVolume1WINDOWSsystem32configSECURITY
0xe16aab60 0x082a6b60 DeviceHarddiskVolume1WINDOWSsystem32configSAM
0xe12e9008 0x02d7f008 [no name]
0xe1035b60 0x02b08b60 DeviceHarddiskVolume1WINDOWSsystem32configsystem
0xe102e008 0x02b02008 [no name]
root@kali:~/CTF# 

hivedump 打印出注册表中的数据 :

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 hivedump -o 0xe16aab60
Volatility Foundation Volatility Framework 2.6
Last Written         Key
2016-05-03 03:41:48 UTC+0000 SAM
2016-05-03 03:41:48 UTC+0000 SAMSAM
2016-05-03 03:41:48 UTC+0000 SAMSAMDomains
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccount
2016-05-03 03:50:51 UTC+0000 SAMSAMDomainsAccountAliases
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountAliases00003E9
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountAliasesMembers
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountAliasesMembersS-1-5-21-1844237615-1677128483-1801674531
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountAliasesMembersS-1-5-21-1844237615-1677128483-180167453100003EA
2016-05-03 03:50:51 UTC+0000 SAMSAMDomainsAccountAliasesNames
2016-05-03 03:50:51 UTC+0000 SAMSAMDomainsAccountAliasesNamesHelpServicesGroup
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsAccountGroups
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountGroups0000201
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsAccountGroupsNames
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsAccountGroupsNamesNone
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountUsers
2016-05-03 04:32:14 UTC+0000 SAMSAMDomainsAccountUsers00001F4
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsAccountUsers00001F5
2016-05-03 03:50:15 UTC+0000 SAMSAMDomainsAccountUsers00003E8
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountUsers00003EA
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountUsersNames
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsAccountUsersNamesAdministrator
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsAccountUsersNamesGuest
2016-05-03 03:50:15 UTC+0000 SAMSAMDomainsAccountUsersNamesHelpAssistant
2016-05-03 03:51:02 UTC+0000 SAMSAMDomainsAccountUsersNamesSUPPORT_388945a0
2016-05-03 03:42:51 UTC+0000 SAMSAMDomainsBuiltin
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases0000220
2016-05-03 03:42:51 UTC+0000 SAMSAMDomainsBuiltinAliases0000221
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases0000222
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases0000223
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases0000227
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases0000228
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases000022B
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliases000022C
2016-05-03 03:42:51 UTC+0000 SAMSAMDomainsBuiltinAliasesMembers
2016-05-03 03:42:51 UTC+0000 SAMSAMDomainsBuiltinAliasesMembersS-1-5
2016-05-03 03:42:51 UTC+0000 SAMSAMDomainsBuiltinAliasesMembersS-1-50000004
2016-05-03 03:42:51 UTC+0000 SAMSAMDomainsBuiltinAliasesMembersS-1-5000000B
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesMembersS-1-5-21-1844237615-1677128483-1801674531
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesMembersS-1-5-21-1844237615-1677128483-180167453100001F4
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesMembersS-1-5-21-1844237615-1677128483-180167453100001F5
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNames
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesAdministrators
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesBackup Operators
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesGuests
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesNetwork Configuration Operators
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesPower Users
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesRemote Desktop Users
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesReplicator
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinAliasesNamesUsers
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinGroups
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinGroupsNames
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinUsers
2016-05-03 03:41:48 UTC+0000 SAMSAMDomainsBuiltinUsersNames
2016-05-03 03:41:48 UTC+0000 SAMSAMRXACT
root@kali:~/CTF# 

获取SAM表中的用户

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 printkey -K "SAMDomainsAccountUsersNames"
Volatility Foundation Volatility Framework 2.6
Legend: (S) = Stable   (V) = Volatile

----------------------------
Registry: DeviceHarddiskVolume1WINDOWSsystem32configSAM
Key name: Names (S)
Last updated: 2016-05-03 03:51:02 UTC+0000

Subkeys:
  (S) Administrator
  (S) Guest
  (S) HelpAssistant
  (S) SUPPORT_388945a0

Values:
REG_NONE                      : (S) 

root@kali:~/CTF#

获取最后登录系统的账户

volatility -f mem.vmem –profile=WinXPSP2x86 printkey -K "SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"

提取出内存中记录的 当时正在运行的程序有哪些,运行过多少次,最后一次运行的时间等信息

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 userassist
Volatility Foundation Volatility Framework 2.6
----------------------------
Registry: DeviceHarddiskVolume1Documents and SettingsAdministratorNTUSER.DAT 
Path: SoftwareMicrosoftWindowsCurrentVersionExplorerUserAssist{5E6AB780-7743-11CF-A12B-00AA004AE837}Count
Last updated: 2016-05-03 04:31:34 UTC+0000

Subkeys:

Values:

REG_BINARY    UEME_CTLSESSION : Raw Data:
0x00000000  9c 27 8d 0e 01 00 00 00                           .'......

REG_BINARY    UEME_CTLCUACount:ctor : 
ID:             1
Count:          2
Last updated:   1970-01-01 00:00:00 UTC+0000
Raw Data:
0x00000000  01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00   ................

REG_BINARY    UEME_UITOOLBAR  : 
ID:             1
Count:          5
Last updated:   2016-05-03 04:31:34 UTC+0000
Raw Data:
0x00000000  01 00 00 00 0a 00 00 00 50 d4 8a ac f4 a4 d1 01   ........P.......

REG_BINARY    UEME_UITOOLBAR:0x4,7031 : 
ID:             1
Count:          3
Last updated:   2016-05-03 04:30:11 UTC+0000
Raw Data:
0x00000000  01 00 00 00 08 00 00 00 30 de 54 7b f4 a4 d1 01   ........0.T{....

REG_BINARY    UEME_UITOOLBAR:0x1,120 : 
ID:             1
Count:          2
Last updated:   2016-05-03 04:31:34 UTC+0000
Raw Data:
0x00000000  01 00 00 00 07 00 00 00 50 d4 8a ac f4 a4 d1 01   ........P.......
----------------------------
Registry: DeviceHarddiskVolume1Documents and SettingsAdministratorNTUSER.DAT 
Path: SoftwareMicrosoftWindowsCurrentVersionExplorerUserAssist{75048700-EF1F-11D0-9888-006097DEACF9}Count
Last updated: 2016-05-03 04:33:36 UTC+0000

Subkeys:

Values:

REG_BINARY    UEME_CTLSESSION : Raw Data:
0x00000000  7b 27 8d 0e 01 00 00 00                           {'......

REG_BINARY    UEME_RUNPIDL:%csidl2%Windows Media Player.lnk : 
ID:             1
Count:          14
Last updated:   2016-05-03 03:52:39 UTC+0000
Raw Data:
0x00000000  01 00 00 00 13 00 00 00 f0 b1 09 3d ef a4 d1 01   ...........=....

REG_BINARY    UEME_RUNPIDL:%csidl2%Windows Messenger.lnk : 
ID:             1
Count:          13
Last updated:   2016-05-03 03:52:39 UTC+0000
Raw Data:
0x00000000  01 00 00 00 12 00 00 00 f0 b1 09 3d ef a4 d1 01   ...........=....

REG_BINARY    U               : 
ID:             1
Count:          12
Last updated:   2016-05-03 03:52:39 UTC+0000
Raw Data:
0x00000000  01 00 00 00 11 00 00 00 f0 b1 09 3d ef a4 d1 01   ...........=....

REG_BINARY    U               : 
ID:             1
Count:          11
Last updated:   2016-05-03 03:52:39 UTC+0000
Raw Data:
0x00000000  01 00 00 00 10 00 00 00 f0 b1 09 3d ef a4 d1 01   ...........=....

REG_BINARY    UEME_CTLCUACount:ctor : 
ID:             1
Count:          2
Last updated:   1970-01-01 00:00:00 UTC+0000
Raw Data:
0x00000000  01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00   ................

REG_BINARY    UEME_RUNCPL     : 
ID:             1
Count:          1
Last updated:   2016-05-03 04:09:17 UTC+0000
Raw Data:
0x00000000  01 00 00 00 06 00 00 00 f0 cc 99 8f f1 a4 d1 01   ................

REG_BINARY    UEME_RUNCPL:desk.cpl : 
ID:             1
Count:          1
Last updated:   2016-05-03 04:09:17 UTC+0000
Raw Data:
0x00000000  01 00 00 00 06 00 00 00 f0 cc 99 8f f1 a4 d1 01   ................

REG_BINARY    UEME_UISCUT     : 
ID:             1
Count:          8
Last updated:   2016-05-03 04:33:35 UTC+0000
Raw Data:
0x00000000  01 00 00 00 0d 00 00 00 20 a5 ec f4 f4 a4 d1 01   ................

REG_BINARY    UEME_RUNPATH    : 
ID:             1
Count:          13
Last updated:   2016-05-03 04:33:36 UTC+0000
Raw Data:
0x00000000  01 00 00 00 12 00 00 00 70 53 2f f5 f4 a4 d1 01   ........pS/.....

REG_BINARY    U               : 
ID:             1
Count:          1
Last updated:   2016-05-03 04:21:44 UTC+0000
Raw Data:
0x00000000  01 00 00 00 06 00 00 00 c0 18 b5 4c f3 a4 d1 01   ...........L....

REG_BINARY    UEME_RUNPATH:TrueCrypt.lnk : 
ID:             1
Count:          3
Last updated:   2016-05-03 04:33:35 UTC+0000
Raw Data:
0x00000000  01 00 00 00 08 00 00 00 10 ef ee f4 f4 a4 d1 01   ................

REG_BINARY    UEME_RUNPATH:C:Program FilesTrueCryptTrueCrypt.exe : 
ID:             1
Count:          3
Last updated:   2016-05-03 04:33:36 UTC+0000
Raw Data:
0x00000000  01 00 00 00 08 00 00 00 70 53 2f f5 f4 a4 d1 01   ........pS/.....

REG_BINARY    U               : 
ID:             1
Count:          1
Last updated:   2016-05-03 04:24:19 UTC+0000
Raw Data:
0x00000000  01 00 00 00 06 00 00 00 b0 70 51 a9 f3 a4 d1 01   .........pQ.....

REG_BINARY    UEME_RUNPATH:C:WINDOWSsystem32NOTEPAD.EXE : 
ID:             1
Count:          5
Last updated:   2016-05-03 04:29:24 UTC+0000
Raw Data:
0x00000000  01 00 00 00 0a 00 00 00 b0 cb 4e 5f f4 a4 d1 01   ..........N_....
root@kali:~/CTF# 

将内存中的某个进程数据以 dmp 的格式保存出来

root@kali:~/CTF# mkdir ctfmon
root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 memdump -p 1736 -D ctfmon/
Volatility Foundation Volatility Framework 2.6
************************************************************************
Writing ctfmon.exe [  1736] to 1736.dmp
root@kali:~/CTF# ls
ctfmon  mem.vmem  suspicion
root@kali:~/CTF# cd ctfmon/
root@kali:~/CTF/ctfmon# ls
1736.dmp
root@kali:~/CTF/ctfmon#

后续可以使用16进制编辑器分析,或使用strings提取其中的字符串分析。

提取内存中保留的 cmd 命令使用情况 。

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 cmdscan
Volatility Foundation Volatility Framework 2.6
**************************************************
CommandProcess: csrss.exe Pid: 616
CommandHistory: 0x55cc00 Application: TPAutoConnect.exe Flags: Allocated
CommandCount: 0 LastAdded: -1 LastDisplayed: -1
FirstCommand: 0 CommandCountMax: 50
ProcessHandle: 0x628
Cmd #19 @ 0xe300f7: ?????????????????????????????????????????????????????????????? 
????'+7;GKW|??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
root@kali:~/CTF# 

查看当时网络连接情况

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 netscan
Volatility Foundation Volatility Framework 2.6
ERROR   : volatility.debug    : This command does not support the profile WinXPSP2x86
root@kali:~/CTF# 

获取 IE 浏览器的使用情况

volatility -f mem.vmem --profile=WinXPSP2x86 iehistory

获取内存中的系统密码

获取内存中的系统密码,我们可以使用 hashdump 将它提取出来 。

ubuntu@DESKTOP-RO316QM:/mnt/d$ volatility -f easy_dump.img --profile=Win7SP1x64 hashdump
Volatility Foundation Volatility Framework 2.6
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
n3k0:1000:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
ubuntu@DESKTOP-RO316QM:/mnt/d$

或者:

volatility -f mem.vmem –profile=WinXPSP2x86 hashdump -y (注册表 system 的 virtual 地址 )-s (SAM 的 virtual 地址)

root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 hivelist
Volatility Foundation Volatility Framework 2.6
Virtual    Physical   Name
---------- ---------- ----
0xe1e9f9d8 0x0bf169d8 DeviceHarddiskVolume1Documents and SettingsAdministratorLocal SettingsApplication DataMicrosoftWindowsUsrClass.dat
0xe1cee5d0 0x0be075d0 DeviceHarddiskVolume1Documents and SettingsAdministratorNTUSER.DAT
0xe1b99b60 0x0ae0ab60 DeviceHarddiskVolume1Documents and SettingsLocalServiceLocal SettingsApplication DataMicrosoftWindowsUsrClass.dat
0xe1b95008 0x0adc6008 DeviceHarddiskVolume1Documents and SettingsLocalServiceNTUSER.DAT
0xe1a7c2a8 0x0a76b2a8 DeviceHarddiskVolume1Documents and SettingsNetworkServiceLocal SettingsApplication DataMicrosoftWindowsUsrClass.dat
0xe1a72b60 0x0a6e1b60 DeviceHarddiskVolume1Documents and SettingsNetworkServiceNTUSER.DAT
0xe146c398 0x084a3398 DeviceHarddiskVolume1WINDOWSsystem32configsoftware
0xe1699758 0x08246758 DeviceHarddiskVolume1WINDOWSsystem32configdefault
0xe166faa8 0x05e7eaa8 DeviceHarddiskVolume1WINDOWSsystem32configSECURITY
0xe16aab60 0x082a6b60 DeviceHarddiskVolume1WINDOWSsystem32configSAM
0xe12e9008 0x02d7f008 [no name]
0xe1035b60 0x02b08b60 DeviceHarddiskVolume1WINDOWSsystem32configsystem
0xe102e008 0x02b02008 [no name]
root@kali:~/CTF# 
root@kali:~/CTF# volatility -f mem.vmem --profile=WinXPSP2x86 hashdump -y 0xe1035b60 -s 0xe16aab60
Volatility Foundation Volatility Framework 2.6

timeliner

最大程度上将内存中的信息提取出来,那么你可以使用 timeliner 这个插件。它会从多个位置来收集系统的活动信息

volatility -f mem.vmem –profile=WinXPSP2x86 timeliner

查找镜像中的文件

ubuntu@DESKTOP-RO316QM:/mnt/d$ volatility -f easy_dump.img --profile=Win7SP1x64 filescan | grep  -E 'jpg|png|jpeg|bmp|gif'
Volatility Foundation Volatility Framework 2.6
0x000000002408c460     32      0 RW---- DeviceHarddiskVolume1phos.jpg
ubuntu@DESKTOP-RO316QM:/mnt/d$

Linux下命令

可以通过linux_route_cache参数查看路由表情况
使用linux_lsof命令查看1517和27157进程相关的文件
使用linux_netstat查看网络链接情况。
使用linux_psaux检查进程详细信息
使用linux_proc_maps参数,可以查看进程细节包括共享库、开始和结束的位置等信息
使用linux_find_file查看可疑文件的位置

Processes
linux_pslist
linux_psaux
linux_pstree
linux_pslist_cache
linux_pidhashtable
linux_psxview
linux_lsof
Process Memory
linux_memmap
linux_proc_maps
linux_dump_map
linux_bash
Kernel Memory and Objects
linux_lsmod
linux_moddump
linux_tmpfs
Rootkit Detection
linux_check_afinfo
linux_check_tty
linux_keyboard_notifier
linux_check_creds
linux_check_fop
linux_check_idt
linux_check_syscall
linux_check_modules
linux_check_creds
Networking
linux_arp
linux_ifconfig
linux_route_cache
linux_netstat
linux_pkt_queues
linux_sk_buff_cache
System Information
linux_cpuinfo
linux_dmesg
linux_iomem
linux_slabinfo
linux_mount
linux_mount_cache
linux_dentry_cache
linux_find_file
linux_vma_cache
Miscellaneous
linux_volshell
linux_yarascan

2. foremost

Foremost是基于文件开始格式,文件结束标志和内部数据结构进行恢复文件的程序。

foremost命令参数英文中文说明:

$ foremost [-v|-V|-h|-T|-Q|-q|-a|-w-d] [-t ] [-s ] [-k ]
[-b ] [-c ] [-o

] [-i <file]

-V - 显示版权信息并退出
-t - 指定文件类型. (-t jpeg,pdf ...)
-d -打开间接块检测 (针对UNIX文件系统)
-i - 指定输入文件 (默认为标准输入)
-a - 写入所有的文件头部, 不执行错误检测(损坏文件)
-w - 向磁盘写入审计文件,不写入任何检测到的文件
-o - 设置输出目录 (默认为为输出)
-c - 设置配置文件 (默认为 foremost.conf)
-q - 启用快速模式. 在512字节边界执行搜索.
-Q - 启用安静模式. 禁用输出消息.
-v - 详细模式. 向屏幕上记录所有消息。

foremost 扫描误删文件

如果误删一个png文件,可以 foremost -t png -i /dev/sda1

恢复内存中dump出的文件

先用volatility提取出对应pid的进程的数据,然后foremost 2616.dump

3. binwalk

递归提取 binwalk -Me firmware.bin
自动化(自动)提取 binwalk -e firmware.bin

https://www.freebuf.com/column/152545.html

https://www.freebuf.com/articles/system/26763.html

https://www.freebuf.com/articles/rookie/145262.html

https://bbs.ichunqiu.com/thread-46827-1-1.html

原文地址:https://www.cnblogs.com/0x4D75/p/11161822.html