最近在win10上做取证相关的东西,记录一下一些有意思的东西,比如想要获取电脑的历史打开文档。这里有两个办法:

  • win+r输入recent查看
  • 注册表编辑器输入路径:计算机\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs

在处理注册表编辑器的时候,发现这个路径下的数据是编码,但是找了很久也没找到怎么去解码,有幸在别人的项目中找到了一段代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def decode_recent_docs_mru(value):
"""
Decodes recent docs MRU list
Returns an array with 1st element being the filename, the second element being the symbolic link name
"""
value_decoded = []
index = value.find(b"\x00\x00")
try:

decoded = value[0:index + 1].decode("utf-16-le")
except UnicodeDecodeError:
try:
decoded = value[0:index + 1].decode("utf-8")
except UnicodeDecodeError:
decoded = "".join([c for c in value[0:index + 1]])

value_decoded.append(decoded)
# index+3 because the last char also ends with \x00 + null bytes \x00\x00, +14 is the offset for the link name
index_end_link_name = value.find(b"\x00", index + 3 + 14)
value_decoded.append(value[index + 3 + 14:index_end_link_name])
return value_decoded

需要注意的是,不是所有的文本都能够被正常解码,目前为止,都还是会出现乱码的情况。问题还在解决。。。

Github地址