自动化攻击路径规划与验证(A2P2V)是一款规划与网络攻击工具,能够根据特定攻击者目标,为用户提供一组排序后的攻击序列。该工具旨在简化流程,使非安全专家也能通过尽可能自动化的基本输入,生成清晰、可操作的威胁情报,并产出易于解读的报告。
该系统利用已知网络拓扑和系统漏洞信息,确定所有能够达成攻击者目标的攻击序列,并为所选序列输出所需步骤(以 Metasploit 命令形式)。
系统输入包括:
除通过 requirements.txt 在安装过程中安装的依赖外,A2P2V 还需满足以下前提条件:
在 Ubuntu 上安装 python tk(假设使用 python 3.9):
sudo apt install python3.9-tk
启动 Metasploit RPC 守护进程时,我们建议在 Docker 容器中运行,使用提供的脚本:
$ cd scripts/
$ ./run_msfrpcd.sh
建议在虚拟环境中安装。
首先创建虚拟环境目录:
mkdir $HOME/.venvs/
创建虚拟环境:
python3 -m venv ~/.venvs/a2p2v
激活虚拟环境:
source ~/.venvs/a2p2v/bin/activate
安装:
pip install -r requirements.txt
pip install .
首次运行该工具时,需要导入能力定义。例如,加载提供的默认能力定义:
a2p2v --cpdb [path_of_yml_file]
使用以下命令行参数在规划模式下运行系统:
$ a2p2v --plan
将显示如下选择列表:
TREE#|SCORE|HOPS |FINAL CAPABILITY OPTIONS |GOALS
-----|-----|-----------------------------------|--------------------------------------------------|---------------
0| 6.24|GW(1)>HMI(4)>OPC(4)>PLC(1) |action=WRITE_REGISTERS |change_temp
-----|-----|-----------------------------------|--------------------------------------------------|---------------
1| 6.24|GW(1)>HMI(4)>EWS10(4)>PLC(1) |action=WRITE_REGISTERS |change_temp
------------------------------------------------------------------------------------------------------------------
Select an attack tree to execute (or any other value to exit):
详细报告及对应的攻击树可在 reports/ 目录中找到。
该工具也可针对单个目标运行,前提是网络能连通该目标。
通过在命令行参数中指定目标,以单主机模式运行系统:
a2p2v --target USER1
所有已知利用模块将显示在选择列表中。你可以选择某个特定的利用模块,或全部使用。
TREE#|SCORE|CAPABILITY
-----|-----|--------------------------------------------------
0| 8.4|exploit/windows/smb/ms17_010_eternalblue
-----|-----|--------------------------------------------------
1| 8.4|exploit/windows/smb/ms17_010_psexec
-----|-----|--------------------------------------------------
2| 8.4|exploit/windows/smb/ms10_061_spoolss
-----|-----|--------------------------------------------------
3| 8.2|exploit/windows/rdp/cve_2019_0708_bluekeep_rce
----------------------------------------------------------------
Select a capability to execute, 'a' for all, or any other value to skip: a
生成的报告与系统用例生成的报告类似。
Copyright (C) 2018-2023 Toshiba Corporation and Peraton Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
文件 lab_config/capabilities_metasploit.yml 基于 Metasploit Framework 的模块信息。
该文件不包含任何攻击模块的信息,仅包含 BSD 许可证。
Metasploit Framework 的许可证如下所示。
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://www.metasploit.com/
Files: *
Copyright: 2006-2020, Rapid7, Inc.
License: BSD-3-clause
# The Metasploit Framework is provided under the 3-clause BSD license provided
# at the end of this file.
#
# The copyright on this package is held by Rapid7, Inc.
#
The Original Code and all software distributed under the License are
distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
Please see the License for the specific language governing rights and
limitations under the License."