Analyzes Windows LNK files and Jump Lists using LECmd, JLECmd, and Shell Link binary parsing to extract evidence of file access, program execution, and user activity in digital forensics.
npx claudepluginhub killvxk/cybersecurity-skills-zhThis skill uses the workspace's default tool permissions.
Windows LNK(快捷方式)文件和 Jump List 是关键的取证制品(forensic artifact),提供文件访问、程序执行和用户行为的证据。当用户通过 Windows 资源管理器或"打开/保存"对话框打开文件时,会自动创建 LNK 文件,其中存储了目标文件的元数据,包括原始路径、时间戳、卷序列号、NetBIOS 名称以及主机系统的 MAC 地址。Windows 7 引入的 Jump List 通过维护每个应用程序最近和频繁访问文件的列表来扩展这一功能。即使目标文件被删除,这些制品仍然存在,使其成为证明用户在特定时间访问特定文件的宝贵手段。
Analyzes Windows LNK shortcut files and Jump Lists to establish evidence of file access, program execution, and user activity using LECmd, JLECmd, and Shell Link binary parsing.
Analyzes Windows LNK files and Jump Lists for file access, program execution, and user activity evidence using LECmd, JLECmd, and Shell Link binary parsing.
Parses Windows LNK shortcut files to extract target paths, timestamps, volume info, machine IDs, and artifacts for digital forensics timeline reconstruction.
Share bugs, ideas, or general feedback.
Windows LNK(快捷方式)文件和 Jump List 是关键的取证制品(forensic artifact),提供文件访问、程序执行和用户行为的证据。当用户通过 Windows 资源管理器或"打开/保存"对话框打开文件时,会自动创建 LNK 文件,其中存储了目标文件的元数据,包括原始路径、时间戳、卷序列号、NetBIOS 名称以及主机系统的 MAC 地址。Windows 7 引入的 Jump List 通过维护每个应用程序最近和频繁访问文件的列表来扩展这一功能。即使目标文件被删除,这些制品仍然存在,使其成为证明用户在特定时间访问特定文件的宝贵手段。
| 位置 | 描述 |
|---|---|
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent\ | 最近访问的文件 |
%USERPROFILE%\Desktop\ | 用户创建的快捷方式 |
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\ | 开始菜单快捷方式 |
%USERPROFILE%\AppData\Roaming\Microsoft\Office\Recent\ | Office 最近文档 |
| 偏移 | 大小 | 字段 |
|---|---|---|
| 0x00 | 4 | HeaderSize(始终为 0x0000004C) |
| 0x04 | 16 | LinkCLSID(始终为 00021401-0000-0000-C000-000000000046) |
| 0x14 | 4 | LinkFlags |
| 0x18 | 4 | FileAttributes |
| 0x1C | 8 | CreationTime(FILETIME) |
| 0x24 | 8 | AccessTime(FILETIME) |
| 0x2C | 8 | WriteTime(FILETIME) |
| 0x34 | 4 | 目标文件大小 |
| 0x38 | 4 | IconIndex |
| 0x3C | 4 | ShowCommand |
| 0x40 | 2 | HotKey |
# 解析 Recent 文件夹中的所有 LNK 文件
LECmd.exe -d "C:\Evidence\Users\suspect\AppData\Roaming\Microsoft\Windows\Recent" --csv C:\Output --csvf lnk_analysis.csv
# 解析单个 LNK 文件并输出完整详情
LECmd.exe -f "C:\Evidence\Users\suspect\Desktop\Confidential.docx.lnk" --json C:\Output
# 解析 LNK 文件并附加详细级别
LECmd.exe -d "C:\Evidence\Users\suspect\AppData\Roaming\Microsoft\Windows\Recent" --csv C:\Output --csvf lnk_all.csv --all
# 解析自动 Jump List
JLECmd.exe -d "C:\Evidence\Users\suspect\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations" --csv C:\Output --csvf jumplists_auto.csv
# 解析自定义 Jump List
JLECmd.exe -d "C:\Evidence\Users\suspect\AppData\Roaming\Microsoft\Windows\Recent\CustomDestinations" --csv C:\Output --csvf jumplists_custom.csv
# 解析所有 Jump List 并输出详细信息
JLECmd.exe -d "C:\Evidence\Users\suspect\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations" --csv C:\Output --csvf jumplists_auto.csv --ld
这些是 OLE 复合文件(结构化存储),由文件名中的 AppID 哈希标识:
| AppID 哈希 | 应用程序 |
|---|---|
| 5f7b5f1e01b83767 | Windows 资源管理器固定/频繁 |
| 1b4dd67f29cb1962 | Windows 资源管理器最近 |
| 9b9cdc69c1c24e2b | Notepad |
| a7bd71699cd38d1c | Notepad++ |
| 12dc1ea8e34b5a6 | Microsoft Paint |
| 7e4dca80246863e3 | 控制面板 |
| 1cf97c38a5881255 | Microsoft Edge |
| f01b4d95cf55d32a | Windows 资源管理器 |
| 9d1f905ce5044aee | Microsoft Excel |
| a4a5324453625195 | Microsoft Word |
| d00655d2aa12ff6d | Microsoft PowerPoint |
| bc03160ee1a59fc1 | Outlook |
当用户将条目固定到应用程序 Jump List 时创建。这些文件包含连续的 LNK 条目。
import struct
import os
from datetime import datetime, timedelta
FILETIME_EPOCH = datetime(1601, 1, 1)
def filetime_to_datetime(filetime_bytes: bytes) -> datetime:
"""将 Windows FILETIME(自 1601 年起的 100 纳秒间隔)转换为 datetime。"""
ft = struct.unpack("<Q", filetime_bytes)[0]
if ft == 0:
return None
return FILETIME_EPOCH + timedelta(microseconds=ft // 10)
def parse_lnk_header(lnk_path: str) -> dict:
"""解析 LNK 文件的 Shell Link 头部。"""
with open(lnk_path, "rb") as f:
header = f.read(76)
header_size = struct.unpack("<I", header[0:4])[0]
if header_size != 0x4C:
return {"error": "无效的 LNK 头部"}
link_flags = struct.unpack("<I", header[0x14:0x18])[0]
file_attrs = struct.unpack("<I", header[0x18:0x1C])[0]
result = {
"header_size": header_size,
"link_flags": hex(link_flags),
"file_attributes": hex(file_attrs),
"creation_time": filetime_to_datetime(header[0x1C:0x24]),
"access_time": filetime_to_datetime(header[0x24:0x2C]),
"write_time": filetime_to_datetime(header[0x2C:0x34]),
"file_size": struct.unpack("<I", header[0x34:0x38])[0],
"has_target_id_list": bool(link_flags & 0x01),
"has_link_info": bool(link_flags & 0x02),
"has_name": bool(link_flags & 0x04),
"has_relative_path": bool(link_flags & 0x08),
"has_working_dir": bool(link_flags & 0x10),
"has_arguments": bool(link_flags & 0x20),
"has_icon_location": bool(link_flags & 0x40),
}
return result
最新研究(IEEE 2025)表明 Windows 11 产生不同的 LNK 和 Jump List 制品: