在res workspace manager应用程序限制中可视化和查找旁路的简单脚本
reswmsecanalyzer的Python项目详细描述
res workspace manager应用程序安全规则分析器
说明
在res workspace manager应用程序限制中可视化和查找旁路的简单脚本
功能
- 找到可能的路径以到达目标资源,如可执行程序
- 将规则可视化地显示为有向图
选项
$ python reswmsecanalyzer.py -h
Usage: reswmsecanalyzer.py [options]
Version: 1.0
Options:
-h, --help show this help message and exit
Main parameters:
-i INPUT_FILE, --input-file=INPUT_FILE
sec_globauth.xml file containing the security rules
-t TARGET, --target=TARGET
Program or file name you want to reach, globbing
format accepted (Ex: cmd.exe, *cmd*)
Optional parameters:
-g, --graph Draw and show the graph with matplot
-o OUTPUT_GRAPH, --output-graph=OUTPUT_GRAPH
Filename to save the png graph (Ex. -o test.png)
先决条件
在受保护的环境(物理/逻辑/虚拟化工作站)上:
- 整个配置存储在此目录中
C:\Program Files (x86)\RES Software\Workspace Manager\Data\DBCache\Objects\
- 应用程序安全规则存储在此文件中
C:\Program Files (x86)\RES Software\Workspace Manager\Data\DBCache\Objects\sec_globauth.xml
- workspace访问控制(如果已实现)在以下文件中定义
C:\Program Files (x86)\RES Software\Workspace Manager\Data\DBCache\Objects\workspaces.xml
示例
- 在^{
} 文件夹中提供了一些示例规则及其关联图。对于每个示例,还包括pretty print版本_prettyprint.xml
- 对于^{
} :- res控制台中定义的策略如下:
- 搜索到
cmd
的路径会得到:
$ python reswmsecanalyzer.py -i examples/multiple-rules/sec_globauth.xml -t cmd -g [+] Number of enabled rules: 4 [+] Possible path to 'cmd.exe': ['.', 'calc.exe', 'cmd.exe'] [+] Possible path to 'cmd.exe': ['.', 'notepad.exe', 'cmd.exe']
依赖项和安装
- 最简单的方法:
pip install reswmsecanalyzer
- 或
pip install -r requirements.txt
- 或者手动安装每个依赖项:
- python网络x:
apt-get install python-networkx
或pip install networkx
- python matplotlib:
apt-get install python-matplotlib
或pip install matplotlib
- python网络x:
路线图
- 改进可能的路径输出说明
- 添加CSV输出
- 考虑边缘约束,如工作区访问控制
- 使用一些动态表示,如d3js