Skip to content

Commit 4d3e35a

Browse files
committed
Adding att_* drivers and support for them
1 parent 7fabbd0 commit 4d3e35a

File tree

7 files changed

+33
-14
lines changed

7 files changed

+33
-14
lines changed
34.8 KB
Binary file not shown.
44.3 KB
Binary file not shown.

volatility/memtriage.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"10.0.15063.0":"Win10x86_15063",
7474
"10.0.15063.608":"Win10x64_15063",
7575
"10.0.16299.15":"Win10x86_16299",
76+
"10.0.16299.492": "Win10x86_16299",
7677
"10.0.10240.17770":"Win10x86_10240_17770",
7778
"10.0.17134.1":"Win10x86_17134",
7879
"10.0.17763.0":"Win10x86_17763",
@@ -105,6 +106,7 @@
105106
"10.0.15063.608":"Win10x64_15063",
106107
"10.0.14393.479":"Win10x64_14393",
107108
"10.0.16299.0":"Win10x64_16299",
109+
"10.0.16299.492": "Win10x64_16299",
108110
"10.0.10240.17770":"Win10x64_10240_17770",
109111
"10.0.17134.1":"Win10x64_17134",
110112
"10.0.17763.0":"Win10x64_17763",
@@ -303,7 +305,7 @@ def parse_yarascan_data(data, out, output = "text"):
303305
]))
304306
out.write("\n\n")
305307
else:
306-
out.write("{0},{1},{2},{3}\n".format("Rule", "Owner", "Address", "Data"))
308+
out.write("{0},{1},{2},{3}\n").format("Rule", "Owner", "Address", "Data"))
307309
for rule, owner, addr, content in datas:
308310
out.write("{0},{1},{2},{3}\n".format(rule, owner, addr, content))
309311
out.write("\n\n")
@@ -336,8 +338,7 @@ def parse_malfind_data(data, out, output = "text"):
336338
])))
337339
out.write("\n\n")
338340
else:
339-
out.write("{},{},{},{},{},{},{}\n").format(
340-
"Process", "Pid", "Address", "VadTag", "Protection", "Flags", "Data")
341+
out.write("{},{},{},{},{},{},{}\n".format("Process", "Pid", "Address", "VadTag", "Protection", "Flags", "Data"))
341342
for proc, pid, address, vadtag, protection, flags, data in datas:
342343
out.write("{},{},{},{},{},{},{}\n".format(proc, pid, address, vadtag, protection, flags, data))
343344
out.write("\n\n")
@@ -470,10 +471,10 @@ def main():
470471
profile = "Win10x64_18362"
471472
version = get_version_number("ntdll.dll")
472473
if platform.machine() == "AMD64":
473-
driver = "winpmem_x64.sys"
474+
driver = "att_winpmem_64.sys"
474475
profile = WindowsVersionsX64.get(version, "UNKNOWN")
475476
else:
476-
driver = "winpmem_x86.sys"
477+
driver = "att_winpmem_32.sys"
477478
profile = WindowsVersionsX86.get(version, "UNKNOWN")
478479
if profile == "UNKNOWN":
479480
profile = first_try_brute_force(debugg, version)
@@ -483,7 +484,10 @@ def main():
483484
if profile not in profs:
484485
if debugg:
485486
print "Incorrect profile found: {0}, version: {1}".format(profile, version)
486-
profile = "Win10x64_18362"
487+
if platform.machine() == "AMD64":
488+
profile = "Win10x64_18362"
489+
else:
490+
profile = "Win10x86_18362"
487491
if debugg:
488492
print "Trying profile", profile
489493
if debugg:
@@ -495,14 +499,25 @@ def main():
495499
sys.exit(-1)
496500

497501
pmem_service = Service(driver = driver, service = service_name, debug = debugg)
498-
499-
500502
if not service_running(service_name):
501503
setup(driver, service_name, pmem_service, debugg)
502504
try:
503-
pmem_service.start()
505+
ret_code = pmem_service.start()
506+
if ret_code == -1:
507+
if platform.machine() == "AMD64":
508+
driver = "winpmem_64.sys"
509+
else:
510+
driver = "winpmem_32.sys"
511+
driver = resource_path(driver)
512+
if not service_name or not os.access(driver, os.R_OK):
513+
out.write("Make sure the driver is in place: {0}".format(driver))
514+
sys.exit(-1)
515+
pmem_service = Service(driver = driver, service = service_name, debug = debugg)
516+
if not service_running(service_name):
517+
setup(driver, service_name, pmem_service, debugg)
518+
pmem_service.start()
504519
except:
505-
print "Unable to start winpmem service"
520+
out.write("Unable to start winpmem service\n")
506521
out.close()
507522
return
508523

volatility/pyinstaller/hook-service.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Openpyxl hook
1+
# Service hook
22
#
3-
# This currently contains the hardcoded location for the .constants.json file
3+
# This currently contains the hardcoded location for the driver files
44
# It could be improved by carrying out a search, or using sys.path
55
#
66
# This also requires the openpyxl module to be modified with the following patch:
@@ -15,5 +15,7 @@
1515
datas = []
1616
path = os.path.join(os.getcwd(), "drivers")
1717

18-
datas.append((os.path.join(path, "winpmem_x64.sys"), "."))
19-
datas.append((os.path.join(path, "winpmem_x86.sys"), "."))
18+
datas.append((os.path.join(path, "winpmem_64.sys"), "."))
19+
datas.append((os.path.join(path, "winpmem_32.sys"), "."))
20+
datas.append((os.path.join(path, "att_winpmem_64.sys"), "."))
21+
datas.append((os.path.join(path, "att_winpmem_32.sys"), "."))

volatility/service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ def start(self):
139139
# If the problem is different, we need to terminate.
140140
elif self.debug:
141141
print "Unable to start service: {0}".format(e)
142+
return -1
142143

143144
self.wait_status()
145+
return 0
144146

145147
def svcStatus(self):
146148
return win32serviceutil.QueryServiceStatus(self.service_name, None)[1] # scvType, svcState, svcControls, err, svcErr, svcCP, svcWH

0 commit comments

Comments
 (0)