maurizi0 / pentest-python

A simple pentest container equipped with common python pentest tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pentest Python

A simple pentest container equipped with common python pentest tools.

The following tools are supported:

Usage

The scripts use podman but can be easily adjusted to use docker (CONTAINER_PROVIDER=docker) instead.

Firstly run build-pentest-container.sh once to build the container.

$ ./build-pentest-container.sh
[2/2] STEP 1/13: FROM debian:bullseye-slim
Resolved "debian" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/debian:bullseye-slim...
Getting image source signatures
Copying blob 3f4ca61aafcd done
Copying config dd94cb6119 done
Writing manifest to image destination
Storing signatures
[...]

Then use run-pentest-container.sh to start an interactive session on the container.

$ ./run-pentest-container.sh
[+] Starting Container
[+] Usage: ./run-pentest-container.sh [-s /path/to/your/local/share] [<command>]
[+] Shared folder: local:/tmp/container-share -> container:/share

pentest-python-daa15e39f171:/share# python3 --version
Python 3.10.12

To use a custom share:

$ ./run-pentest-container.sh -s /home/user/work
[+] Starting Container
[+] Usage: ./run-pentest-container.sh [-s /path/to/your/local/share] [<command>]
[+] Shared folder: local:/home/user/work -> container:/share

pentest-python-a1ca5c50fb20:/share#

Alternatively, you can start the desired tool tools directly:

$ ./run-pentest-container.sh nmap -sSV -p 22 scanme.nmap.org -oN nmap-scanme-%D
[+] Starting Container
[+] Usage: ./run-pentest-container.sh [-s /path/to/your/local/share] [<command>]
[+] Shared folder: local:/tmp/container-share -> container:/share

Starting Nmap 7.80 ( https://nmap.org ) at 2023-08-28 13:03 UTC
Nmap scan report for scanme.nmap.org (45.33.32.156)
Host is up (0.040s latency).
Other addresses for scanme.nmap.org (not scanned): 2600:3c01::f03c:91ff:fe18:bb2f

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.13 (Ubuntu Linux; protocol 2.0)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.86 seconds

Share the container to a system without internet

# on a machine with internet access
$ ./build-pentest-container.sh
[...]
$ podman save --output pentest-python-container.tar pentest-python
[...]

# copy the pentest-python-container.tar and ./run-pentest-container.sh to the target machine
$ podman load --input pentest-python-container.tar
[...]
./run-pentest-container.sh
[...]

About

A simple pentest container equipped with common python pentest tools.


Languages

Language:Shell 83.3%Language:Dockerfile 16.7%