Scripts for building a Covert Pentesting Infrastructure using RedSocks and DNScrypt.
This repository contains a set of Bash scripts to assist in setting up a transparent proxy infrastructure. It routes traffic through a SOCKS5 proxy (via RedSocks) and encrypts DNS queries (via DNScrypt).
Original Source: CPH-SEC/CPH-SEC.github.io
- Linux (Debian/Ubuntu based)
- Root privileges (sudo)
python3iptablesnano(or editor of choice)curl
-
Install dependencies: Run the installation script to set up
dnscrypt-proxyandresolvconf.sudo ./installdnscrypt.sh
-
Edit RedSocks configuration: Configure your remote SOCKS5 proxy details.
sudo ./editREDconf.sh
To start the transparent proxy (this will restart DNS services and apply iptables rules):
sudo ./startREDsocks.shThis script acts as the main entry point. It will keep running. Press Ctrl+C to stop and clean up.
-
Route Traffic: Apply iptables rules manually.
sudo ./iproute.sh
-
Reset Routing: Clear iptables rules and stop redirection.
sudo ./resetiproute.sh
-
Restart DNS: Restart DNScrypt and networking.
sudo ./restartDNScrypt.sh
-
Check IP: Verify your external IP address.
./myip.sh
-
Fetch Proxies: (Requires
fetch-some-proxiessubmodule)sudo ./fetch.sh
This repository has been audited and modernized.
- Safety: Scripts check for root privileges and required dependencies.
- Logging: All scripts use structured logging.
- Error Handling:
set -euo pipefailis enabled to catch errors early.