A2P2V : Automated Attack Path Planning and Validation

A2P2V ( Automated Attack Path Planning and Validation) is a planning and cyber-attack tool that provides the capability for users to determine a set of ranked attack sequences given a specific attacker goal. The aim of the tool is to simplify process so that non-security experts can generate clear, actionable intelligence from basic inputs using as much automation as possible and generating easy to interpret reporting.

The system uses known network topology and system vulnerability information to determine all sets of attack sequences to obtain the attacker goal and outputs the required steps (as Metasploit commands) for the selected sequence.

The input to the system includes:

  • Initial conditions: modeling the knowledge and current access of the attacker
  • Attacker goal: indicating a change in state (e.g. change temperature on an ICS system) or remote access to a specific target host
  • Vulnerability information: results of Nessus or Nmap scans or data custom (CVS) input format
  • Network topology: a custom XML format describing host information and network connectivity
  • Capability details: a custom XML format describing a set of known services and exploits specified using a PAP (Pre-condition, Action and Post-condition) model.

Prerequisites

A2P2V has the following prerequisites beyond what is installed via requirements.txt during setup:

  • python >= 3.6
  • Metasploit RPC daemon running. (Default configuration uses port 55552, username msf, password welcome1)
  • python-tk installed

To install python tk on Ubuntu (assuming python 3.9)

sudo apt install python3.9-tk

To start the Metasploit RPC daemon

msfrpcd -P welcome1 -S -U msf -a 127.0.0.1 -f -p 55552

Installation

Installing in a virtualenv is recommended.

First create a venvs directory:

mkdir $HOME/.venvs/

Create the virtual environment:

python3 -m venv .venvs/a2p2v

Activate the virtual environment:

source .venvs/a2p2v/bin/activate

Install:

cd a2p2v/
pip install

Load Capability Definitions

The first time that the tool is run, the capabilities definitions needs to be imported. For example, to load the provided default capabilities definitions:

a2p2v –importdb lab_config/capabilities.xml

Getting Started: System Goal

The system is run in planning mode using the following command line arguments

$ a2p2v –plan

The following selections are shown:

TREE#SCOREHOPSFINAL CAPABILITY OPTIONSGOALS
06.17GW(1)>HMI(4)>OPC(4)>PLC(1)auxiliary/scanner/scada/modbusclientchange_temp
16.17GW(1)>HMI(4)>USER2(4)>PLC(1)auxiliary/scanner/scada/modbusclientchange_temp

Select an attack tree to execute (or any other value to exit):

A detailed report and corresponding set of attack trees can be found in the reports/ directory.

Getting Started: Single Host Target

The tool can also be run against a single target, assuming network connectivity to the target.

The system is run in single host mode by specifying a target in the command line arguments:

a2p2v –target USER1

The list of all known exploits are shown in the selection. You can choose a specific exploit to use, or all of them.

TREE#SCORECAPABILITY
08.4exploit/windows/smb/ms17_010_eternalblue
—–—–————————————————–
18.4exploit/windows/smb/ms17_010_psexec
—–—–————————————————–
28.4exploit/windows/smb/ms10_061_spoolss
—–—–————————————————–
38.2exploit/windows/rdp/cve_2019_0708_bluekeep_rce

Select a capability to execute, ‘a’ for all, or any other value to skip: a

The corresponding report is similar to that generated for the system use case.

R K

Recent Posts

Install Asterisk on Ubuntu 18.04: Source Build and Secure Config

Asterisk is the most widely deployed open-source PBX (Private Branch Exchange) platform in the world. It…

12 hours ago

Install Ghost on Ubuntu 18.04: Node.js, MySQL, and Nginx SSL

Ghost is an open-source publishing platform built on Node.js. It is designed for bloggers, journalists, and…

12 hours ago

Install Mattermost on Ubuntu 18.04: Nginx SSL Reverse Proxy Setup

Mattermost is an open-source, self-hosted team messaging platform and a direct alternative to Slack. It is…

12 hours ago

Install Ruby on Ubuntu 18.04: apt, Rbenv, and RVM Methods

Ruby is a dynamic, open-source programming language known for its clean, readable syntax. It powers the…

12 hours ago

Install PyCharm on Ubuntu 18.04: Community Edition via Snap

PyCharm is a full-featured Python IDE developed by JetBrains. It includes built-in debugging, embedded Git control,…

12 hours ago

Install PHP on Ubuntu 26.04: Apache, Nginx, and Multiple Versions

PHP 8.5 is included in Ubuntu 26.04's default repositories and is the recommended version for…

2 days ago