渗透基础——在 Win7 下运行 csvde
0x00 前言
在之前的文章 《渗透基础——活动目录信息的获取 2:Bypass AV》 介绍了使用 csvde 获取活动目录信息的方法,优点是 Windows Server 系统自带,能够导出 csv 格式便于查看。但是在 Win7 系统下,默认不支持这个命令。
本文将要介绍在 Win7 下运行 csvde 的方法,提高适用范围。
0x01 简介
本文将要介绍以下内容:
- 背景知识
- 移植思路
- 实现方法
0x02 背景知识
参考资料:
- https://docs.microsoft.com/en-us/previous-versions/orphan-topics/ws.10/cc772704(v=ws.10)?redirectedfrom=MSDN
- https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc732101(v=ws.11 )
1.csvde 的依赖库
需要理清以下结构:
- Windows Server 2003,默认支持 csvde
- Windows Server 2008 及更高版本,需要开启 Active Directory Domain Services (AD DS) 或 Active Directory Lightweight Directory Services (AD LDS) 服务器角色
- Windows XP Professional,需要安装 Active Directory Application Mode (ADAM)
- Windows 7 及更高版本,需要安装 Remote Server Administration Tools (RSAT)
2.安装 Remote Server Administration Tools (RSAT)
- Remote Server Administration Tools for Windows 7:微软已经不再提供下载
- Remote Server Administration Tools for Windows 8 下载地址: https://www.microsoft.com/en-us/download/details.aspx?id=28972
- Remote Server Administration Tools for Windows 10 下载地址: https://www.microsoft.com/en-us/download/details.aspx?id=45520
3.Win7 安装 Remote Server Administration Tools (RSAT)
(1) 下载安装 KB958830
微软已经不再提供手动下载,可选择安装 Win7 自动更新补丁
(2) 安装功能
打开 控制面板
,选择 Turn Windows features on or off
在 Windows Features
界面中能够找到 Remote Server Administration Tools
,如下图
为了能够支持 csvde,需要安装 AD DS Snap-ins and Command-line Tools
,路径如下: Remote Server Administration Tools
-> Role Administration Tools
-> AD DS and AD LDS Tools
-> AD DS Tools
-> AD DS Snap-ins and Command-line Tools
,如下图
安装成功后,当前 Win7 系统支持 csvde 命令
0x03 移植思路
csvde 默认安装路径为 c:\windows\system32
,可以使用 Process Monitor 监控 csvde 的启动过程,定位 csvde 需要的依赖文件,如下图
从图中可以看出,csvde 启动时需要依赖文件 C:\Windows\System32\en-US\csvde.exe.mui
经过一段时间的测试,最终得出以下移植思路:
- 复制文件
C:\Windows\System32\csvde.exe
- 复制文件
C:\Windows\System32\en-US\csvde.exe.mui
0x04 实现方法
我们知道,在 C:\Windows\System32\
下创建文件需要管理员权限,为了能够在普通用户权限下进行移植,这里可以采取相对路径的方法实现:
- 复制 csvde.exe 至任意普通用户权限可访问的路径
- 在同级目录创建文件夹 en-US,复制 csvde.exe.mui
为了便于测试,我将自己测试系统的 csvde 已上传至 github,地址如下:https://github.com/3gstudent/test/blob/master/csvde.zip
0x05 小结
本文介绍了在 Win7 下运行 csvde 的方法,提高适用范围,可按照同样的方法,分别实现在 Win8 和 Win10 下运行。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论