Docker for Pentest is an image with the more used tools to create an pentest environment easily and quickly.
Features
Tools Installed
Operative system tools
Network tools
Developer tools
Pentest tools
Port scanning
Recon
Wordlist
Git Repositories
OWASP
Mobile
Brute force
Cracking
OS Enumeration
Exploits
Windows
Reverse shell
Other resources
Custom functions
Other services
Usage
Prerequisites
You can use the docker image by the next two options:
git clone –depth 1 https://github.com/aaaguirrep/pentest.git
cd pentest
docker build -t pentest .
docker run –rm -it –name my-pentest pentest /bin/zsh
Use image from docker hub: aaaguirrep/pentest
docker pull aaaguirrep/pentest
docker run –rm -it –name my-pentest pentest /bin/zsh
Considerations to run the container
There are differents use cases for use the image and you should know how to run the container properly.
docker run --rm -it --cap-add=NET_ADMIN --device=/dev/net/tun --sysctl net.ipv6.conf.all.disable_ipv6=0 --name my-pentest aaaguirrep/pentest /bin/zsh
docker run --rm -it -v /path/to/local/directory:/pentest --name my-pentest aaaguirrep/pentest /bin/zsh
docker run --rm -it --name my-pentest -p 80:80 -p 3128:3128 aaaguirrep/pentest /bin/zsh
Inside the container start apache2 and squid services by the aliases. apacheUp squidUp
docker run --rm -it --privileged --name my-pentest aaaguirrep/pentest /bin/zsh
Nice Configurations
You can set up the docker image with nice configurations like as:
1. Alias to connect to HTB (Hack the Box) VPN
To use both options you should use -v option to map local directoty with /pentest container directory.
Option 1 – HTB VPN using github repository
Add the next line in step “Create shorcuts” in Dockerfile, build a new image and run a new container with the -v option.
RUN echo “alias vpnhtb=\”openvpn /pentest/path/to/ovpn/file\”” >> /root/.zshrc
Option 2 – HTB VPN using docker hub image
Create a new Dockerfile with the next steps, build a new image and run a new container with -v option.
FROM aaaguirrep/pentest
# Create a shortcut and load the ovpn file from workstation RUN echo “alias vpnhtb=\”openvpn /pentest/path/to/ovpn/file\”” >> /root/.zshrc
2. Save and load command history in your local environment
When you delete a container all information is deleted incluide command history. The next configuration provides you an option for save the command history in your local environment and load it when you run a new container. So, you wont lose your command history when run a new container.
To use both options you should use -v option to map local directoty with /pentest container directory.
Option 1 – Command history using github repository
Add the next line in step “Create shorcuts” in Dockerfile, build a new image and run a new container.
# Save and load command history in your local environment
RUN sed -i ‘1i export HISTFILE=”/pentest/.zsh_history”‘ /root/.zshrc
Option 2 – Command history using docker hub image
Create a new Dockerfile with the next steps, build a new image and run a new container.
FROM aaaguirrep/pentest
# Save and load command history in your local environment RUN sed -i ‘1i export HISTFILE=”/pentest/.zsh_history”‘ /root/.zshrc
Environment Tested
The image was tested in the following environments:
Warning
docker run --rm -it -v /path/to/local/directory:/pentest --name my-pentest aaaguirrep/pentest /bin/zsh
The above command specify a path local directory mapped with /pentest container directory. You should save all information under /pentest directory.shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…
Extract and execute a PE embedded within a PNG file using an LNK file. The…
Embark on the journey of becoming a certified Red Team professional with our definitive guide.…
This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…
This took me like 4 days (+2 days for an update), but I got it…
MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…