Autopen is a very modular tool that automates the execution of scans during a penetration test.

Related tags

Networkingautopen
Overview

Autopen

Autopen is a very modular tool that automates the execution of scans during a penetration test. A Nmap scan result in the form of an XML file is required as the basis for the modules to be executed. This XML file can be passed as an argument. If no scan result is provided, autopen can perform the Nmap scan by itself.

Using multithreading, several scans are executed simultaneously. The use of different modules can be adapted on the fly by using module names, port numbers or IP addresses as a filter. Autopen is well suited to test a given user password combination on many machines and different services.

The core is the modules.json file, which contains the syntax of the executable commands. Variables can also be stored in this configuration file, which are automatically included in the arguments of Argparse.

Requirements

  • Python 3

Furthermore all modules specified in the configuration file are considered as dependencies.
If a module is not installed, an error is issued and the next module is executed.

Install

The setup script will only read the absolute path of the script location and insert this path into the modules.json file.

bash setup.sh

Configuration

The modules.json file contains all modules that can be executed by autopen.
The modules have the following structure:

[optional ] > 2>&1", "port": "portNumber1, portNumber2, [...]" }, ">
{
    "name": "nameOfModule",
    "riskLevel": "riskLevelAsInteger",
    "syntax": "commandSyntax 
     
       [optional 
      
       ] > 
       
         2>&1",
    "port": "portNumber1, portNumber2, [...]"
},

       
      
     

name, risklevel, port

The configuration can be extended as desired.
However, it should be noted that the modules cannot have the same name.

Each module requires a risk level between 1 to 5.
The higher the level, the higher the probability that the module can cause damage.

It is necessary to specify port numbers for the modules.
If a module is always applicable, a wildcard * can also be stored instead a port number.
In this case, the module will be executed once for each host and each port.

> 2>&1", "port": "445" }, { "name": "netcat", "riskLevel": "1", "syntax": "timeout 60 nc -nv > 2>&1", "port": "*" }, ">
{
    "name": "crackmapexec",
    "riskLevel": "1",
    "syntax": "crackmapexec smb 
       
         > 
        
          2>&1",
    "port": "445"
},
{
    "name": "netcat",
    "riskLevel": "1",
    "syntax": "timeout 60 nc -nv 
          
          
            > 
           
             2>&1", "port": "*" }, 
           
          
         
        
       

syntax - absolute path

If tools are not included in the environment path variables, absolute paths can also be specified.

-u -p > 2>&1", "port": "445" }, ">
{
    "name": "lsassy",
    "riskLevel": "2",
    "syntax": "/usr/bin/lsassy -d 
       
         -u 
        
          -p 
          
          
            > 
           
             2>&1", "port": "445" }, 
           
          
         
        
       

syntax - variables

Strings inside <...> are interpreted as variables.
The syntax must always end with an > 2>&1 so that the output can be written to a file.
Additionally the variable must always be included inside the syntax.

Furthermore it is possible to include custom variables. Custom variables are added to the arguments of Argparse. Camelcase notation sets the abbreviations for the Argparse's arguments.

Modules with custom variables are only executed if all occurring in the syntax are given by the user.
One exceptional variable that does not have to be passed explicitly when autopen is called is the variable . This variable is read from the Nmap scan result.
For example, the following module would add the values domain (-d) and userList (-ul) to the Argparse's arguments.

-U -w 30 -v -t > 2>&1", "port":"25" }, ">
{
    "name": "smtp-enum-user",
    "riskLevel": "1",
    "syntax": "smtp-user-enum -M VRFY -D 
      
        -U 
       
         -w 30 -v -t 
        
          > 
         
           2>&1",
    "port":"25"
},

         
        
       
      

Help

usage: autopen.py [-h] [-e] [-v] -o OUTPUT [-t TIMEOUT] (-ti TARGETIP | -xf XMLFILE) [-rl RISKLEVEL] [-ta THREADAMOUNT] [-em [EXCLUDEMODULES ...]] [-im [INCLUDEMODULES ...]] [-ii [INCLUDEIPS ...]]
                  [-ei [EXCLUDEIPS ...]] [-ip [INCLUDEPORTS ...]] [-ep [EXCLUDEPORTS ...]] [-d DOMAIN] [-dci DOMAINCONTROLERIP] [-p PASSWORD] [-u USER] [-ul USERLIST] [-upf USERPASSFILE]

Automatic Pentesting.
Please dont be evil.

Basic usage:
Print matching modules for a given nmap xml file:
./autopen.py -o /tmp/output -xf nmap-result.xml

Scan targets (top 1000 ports) and execute matching modules:
./autopen.py -o /tmp/output -ti 192.168.0.0/24 -e

Exclude ip addresses:
./autopen.py -o /tmp/output -xf nmap-result.xml -ei 192.168.1.1 192.168.3.4 -e

Only execute modules for given ip address and exclude ports:
./autopen.py -o /tmp/output -xf nmap-result.xml -ii 192.168.1.4 -ep 80 443 -e

Exclude all modules that have one of the given substrings in their name:
./autopen.py -o /tmp/output -xf nmap-result.xml -im smb netcat -e

Only execute modules that contains at least one given substring in ther name:
./autopen.py -o /tmp/output -xf nmap-result.xml -im hydra -e

Execute modules with higher risk level, use more threads and increase timeout:
./autopen.py -o /tmp/output -xf nmap-result.xml -rl 4 -ta 8 -t 900

optional arguments:
  -h, --help            show this help message and exit
  -e, --execute         execute matching commands
  -v, --verbose         print full command
  -o OUTPUT, --output OUTPUT
                        path to output directory
  -t TIMEOUT, --timeout TIMEOUT
                        maximal time that a single thread is allowed to run in seconds (default 600)
  -ti TARGETIP, --targetIp TARGETIP
                        initiate nmap scan for given ip addresses (use nmap ip address notation)
  -xf XMLFILE, --xmlFile XMLFILE
                        full path to xml nmap file
  -rl RISKLEVEL, --riskLevel RISKLEVEL
                        set maximal riskLevel for modules (possible values 1-5, 2 is default)
  -ta THREADAMOUNT, --threadAmount THREADAMOUNT
                        the amount of parallel running threads (default 5)
  -em [EXCLUDEMODULES ...], --exludeModules [EXCLUDEMODULES ...]
                        modules that will be excluded (exclude ovewrites include)
  -im [INCLUDEMODULES ...], --includeModules [INCLUDEMODULES ...]
                        modules that will be included
  -ii [INCLUDEIPS ...], --includeIps [INCLUDEIPS ...]
                        filter by including ipv4 addresses
  -ei [EXCLUDEIPS ...], --excludeIps [EXCLUDEIPS ...]
                        filter by excluding ipv4 addresses
  -ip [INCLUDEPORTS ...], --includePorts [INCLUDEPORTS ...]
                        filter by including port number
  -ep [EXCLUDEPORTS ...], --excludePorts [EXCLUDEPORTS ...]
                        filter by excluding port number
  -d DOMAIN, --domain DOMAIN
  -dci DOMAINCONTROLERIP, --domainControlerIp DOMAINCONTROLERIP
  -p PASSWORD, --password PASSWORD
  -u USER, --user USER
  -ul USERLIST, --userList USERLIST
  -upf USERPASSFILE, --userPassFile USERPASSFILE

Demo

Result Structure

output
├── dirsearch
│   ├── dirsearch-192.168.2.175-80
│   └── dirsearch-192.168.2.175-8080
├── hydra-ftp-default-creds
│   └── hydra-ftp-default-creds-192.168.2.175-21
├── hydra-ssh-default-creds
│   └── hydra-ssh-default-creds-192.168.2.175-22
├── netcat
│   ├── netcat-192.168.2.175-21
│   ├── netcat-192.168.2.175-22
│   ├── netcat-192.168.2.175-80
│   └── netcat-192.168.2.175-8080
├── nmap
│   ├── 192.168.2.175-p-sT.gnmap
│   ├── 192.168.2.175-p-sT.nmap
│   └── 192.168.2.175-p-sT.xml
├── ssh-audit
│   └── ssh-audit-192.168.2.175-22
└── whatweb
    └── whatweb-192.168.2.175-80

Currently included Modules

Sources

Pesquise, filtre e obtenha informações sobre animes. ( Módulo PIP )

Pesquise, filtre e obtenha informações sobre animes. ( Módulo PIP )

AimCaffe 3 Jan 30, 2022
The AKS cluster provisioner provisions AKS clusters :-)

Overview The AKS cluster provisioner provisions AKS clusters :-) It uses the Azure CLI to configure VNet and subnets before creating the cluster itsel

Gigi Sayfan 1 Nov 10, 2021
Best discord webhook spammer using proxy (support all proxy type)

Best discord webhook spammer using proxy (support all proxy type)

Iтѕ_Ѵιcнч#1337 25 Nov 01, 2022
Search ports in multiples hosts

Search Port ✨ Multiples Searchs ✨ Create list hosts Create list targets Start Require Python 3.10.0+. python main.py Struture Function Directory load_

Tux#3634 7 Apr 29, 2022
OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive models

OptiPLANT OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive mod

Intellia ICT 1 Jan 26, 2022
Edge static generator. Also Edge means: the outside limit of an object, area, or surface.

Edge Edge is a new static generator. Edge is onworking. Do not clone or do any changes. No P.R will be merged Also Edge means: the outside limit of an

AmirHossein Mohammadi 12 Jan 16, 2022
Out-of-box Python RPC framework

typed-jsonrpc Out-of-box Python RPC framework. WIP. Make LSP easy for everyone. The conception of final usage: from typed_jsonrpc import * ls = Langu

Taine Zhao 4 Dec 28, 2021
Serves some data over HTTP, once. Based on the built-in Python module http.server

serve-me-once Serves some data over HTTP, once. Based on the built-in Python module http.server.

Peder Bergebakken Sundt 2 Jan 06, 2022
track IP Address

ipX Table of Contents ipX Welcome Features Uses Author 📝 License Welcome find the location of an IP address. Specifically, you can get the following

Ali Shahid 15 Sep 26, 2022
DNSStager is an open-source project based on Python used to hide and transfer your payload using DNS.

What is DNSStager? DNSStager is an open-source project based on Python used to hide and transfer your payload using DNS. DNSStager will create a malic

Askar 547 Dec 20, 2022
(A)sync client for sms.ru with pydantic responses

🚧 aioSMSru Send SMS Check SMS status Get SMS cost Get balance Get limit Get free limit Get my senders Check login/password Add to stoplist Remove fro

Eugene Mayer 4 Jul 03, 2022
The Delegate Network: An Interactive Voice Response Delegative Democracy Implementation of Liquid Democracy

The Delegate Network Overview The delegate network is a completely transparent, easy-to-use and understand version of what is sometimes called liquid

James Bowery 2 Feb 25, 2022
Burp Extension that copies a request and builds a FFUF skeleton

ffuf is gaining a lot of traction within the infosec community as a fast portable web fuzzer. It has been compared and aligned (kinda) to Burp's Intruder functionality. Thus, Copy As FFUF is trying t

Desmond Miles 81 Dec 22, 2022
Build surface water network for MODFLOW's SFR Package

Surface water network Creates surface water network, which can be used to create MODFLOW's SFR. Python packages Python 3.6+ is required. Required geop

Mike Taves 20 Nov 22, 2022
NanoChat - nano chat server and client

NanoChat This is a work in progress! NanoChat is an application for connecting with your friends using Python that uses ONLY default Python libraries.

Miss Bliss 1 Nov 13, 2021
Flashes keyboard leds on incoming/outgoing network packets

LED Net Capture Flashes keyboard leds on incoming/outgoing network packets Usage Requires root priviledges to run usage: ledcapture.py [-h] --keyboard

Dan Habot 56 Oct 27, 2022
A repository to spoof ARP table of any devices and successfully establish Man in the Middle(MITM) attack using Python3 in Linux

arp_spoofer A repository to spoof ARP table of any devices and successfully establish Man in the Middle(MITM) attack using Python3 in Linux Usage: git

Surya Das N 1 Oct 30, 2021
Octodns-cloudflare - Cloudflare DNS provider for octoDNS

CloudflareProvider provider for octoDNS An octoDNS provider that targets Cloudfl

octoDNS 6 May 28, 2022
pyWhisker is a Python equivalent of the original Whisker made by Elad Shamir and written in C#.

PyWhisker pyWhisker is a Python equivalent of the original Whisker made by Elad Shamir and written in C#. This tool allows users to manipulate the msD

Shutdown 325 Jan 08, 2023
Py script to aid in setting up the boot chime in OpenCore.

BootChime Py script to aid in setting up the boot chime in OpenCore. It does so by helping you locate your IOHDACodecDevices, IOHDACodecAddress values

CorpNewt 7 Sep 19, 2022