Zurück

Cobalt Strike - DNS Listener

In diesem Blogeintrag möchte ich Schritt für Schritt dokumentieren, wie man in Cobalt Strike (ab Version 4.0) einen DNS-Listener in Kombination mit einem Domain-Registrar wie GoDaddy und der Cloud-Plattform Microsoft Azure erstellt und im Detail konfiguriert. Bei meinen Recherchen zu diesem Thema habe ich nur verstreute Informationen gefunden und möchte daher die Gelegenheit nutzen, den Prozess bzw. die Vorgehensweise für mich zu dokumentieren und gleichzeitig mit anderen zu teilen.


Disclaimer 


Der Zweck dieses Artikels ist rein akademischer Natur; die hier geteilten Informationen sind ausschließlich für Forschungszwecke bestimmt und sollten unter keinen Umständen für unethische oder illegale Aktivitäten verwendet werden. Ich erhebe keinen Anspruch auf Richtigkeit oder Vollständigkeit.

# Start a new screen session with a specific name
screen -S CSDNS  # Creates a new screen session named "CSDNS"
# Detach from the current screen session
# Press Ctrl + A, then D  # This will detach from the "CSDNS" session without closing it

# List all active screen sessions
screen -ls  # Shows a list of all current screen sessions

# Reattach to an existing screen session
screen -r CSDNS  # Reattaches to the "CSDNS" session

# Terminate the screen session
# Inside the screen session, type:
exit  # Ends the "CSDNS" screen session
# Allow incoming DNS requests on port 53 (UDP and TCP)
iptables -I INPUT -p udp --dport 53 -j ACCEPT

# Forward incoming DNS traffic to the internal IP 10.0.0.5 on port 53 (UDP and TCP)
iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to-destination 10.0.0.5:53

# Allow forwarding of the DNS traffic
iptables -I FORWARD -p udp --dport 53 -j ACCEPT

# Enable masquerading for NAT (source NAT) to ensure proper routing of responses
iptables -t nat -A POSTROUTING -j MASQUERADE

# Enable IP forwarding (required for routing packets)
sysctl net.ipv4.ip_forward=1
Zuletzt aktualisiert 04.09.24 15:22:48 04.09.24
Daniel Feichter