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

How Web Application Firewalls (WAFs) Work

General Working of a Web Application Firewall (WAF) A Web Application Firewall (WAF) acts as…

5 days ago

How to Send POST Requests Using curl in Linux

How to Send POST Requests Using curl in Linux If you work with APIs, servers,…

5 days ago

What Does chmod 777 Mean in Linux

If you are a Linux user, you have probably seen commands like chmod 777 while…

5 days ago

How to Undo and Redo in Vim or Vi

Vim and Vi are among the most powerful text editors in the Linux world. They…

5 days ago

How to Unzip and Extract Files in Linux

Working with compressed files is a common task for any Linux user. Whether you are…

5 days ago

Free Email Lookup Tools and Reverse Email Search Resources

In the digital era, an email address can reveal much more than just a contact…

5 days ago