It has a very simple infrastructure with the tools you might need when working on a pentesting team.
It contains:
- WireGuard (VPN) - vpn.home.arpa
- PiHole (DNS) - dns.home.arpa
- PwnDoc - pwndoc.home.arpa
- Gitea - git.home.arpa
- Wiki.js - wiki.home.arpa
- Netdata - netdata.home.arpa
- Nginx
- KMS
- Rsyslog
To deploy the infraestructure, just execute the installation script, passing the PiHole password as argument and the IP or domain where the VPN server will be located.
bash ./install.shOnce everything is set and running, change the IP of /run/systemd/resolve/resolv.conf by 127.0.0.1.
Finally, you only need to add your telegram API key and CHATID to the netdata container so you can be notified if something odd happens on your machine. To do so, follow this link.
The client-setup.sh configures the Kali Linux machine to do the following:
- Create new user, with the auditors name
- Change hostname, to distinguish the kali machine from the different auditors
- Change time zone to UTC to keep track of logs
- Modify kali's rsyslog, to store the commands executed by the auditor and send them to the cloud.
Execute:
sudo bash client-setup.sh <username> <rsyslog_server_ip>"sudo tar -czf ~/Infra/BackUps/PwnDoc/pwndoc_mongo-data.tar.gz -C ~/Infra/PwnDoc/backend/mongo-data/ .
sudo tar -czf ~/Infra/BackUps/PwnDoc/pwndoc_templates.tar.gz -C ~/Infra/PwnDoc/backend/report-templates/ .docker exec -u git -d -w /backup gitea bash -c '/usr/local/bin/gitea dump --tempdir /backup/'docker exec -d -w /backup pihole bash -c "pihole-FTL --teleporter"
- Stop the backend container
docker stop pwndoc-backend- Restore the data Reference: https://pwndoc.github.io/pwndoc/#/installation?id=backup
sudo rm -rf ./PwnDoc/backend/mongo-data/*
sudo tar -xzf ~/Downloads/mongo-data.tar.gz -C ./PwnDoc/backend/mongo-data
sudo tar -xzf ~/Downloads/pwndoc_templates.tar.gz -C ./PwnDoc/backend/report-templates/- Restart the frontend container.
docker restart pwndoc-frontend- Stop the containers
- Copy the backup file, unzip it and move everything to its place. Reference: https://docs.gitea.com/administration/backup-and-restore#using-docker-rootless-restore
sudo cp ~/Downloads/gitea-dump.zip ./Gitea/backup/
sudo chown 1000:1000 ./Gitea/backup/gitea-dump.zip
docker exec -u git -it -w /backup gitea bash
unzip gitea-dump.zip
mv app.ini /etc/gitea/app.ini;
rm -rf /var/lib/gitea/* && mv data/* /var/lib/gitea;
cp -r ./repos/. /var/lib/gitea/git/repositories/
chown -R git:git /etc/gitea/app.ini /var/lib/gitea- Restore the database
sudo cp ./Gitea/backup/gitea-db.sql ./Gitea/postgres/
docker exec -it gitea-postgres bash
psql -U gitea -d gitea < /var/lib/postgresql/data/gitea-db.sql- Restart the containers.
docker restart gitea gitea-postgres- Access to
https://dns.home.arpa/admin/settings.php?tab=teleporter - Upload the backup file and press on restore.
- Access the container and update the list of ad-serving domains
docker exec -d pihole bash -c 'pihole -g'