Socat: Unterschied zwischen den Versionen
Die Seite wurde neu angelegt: „mini|400px|https://www.instagram.com/p/DPvzjdrEUSV/“ |
Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
Linux socat Command Examples | |||
v socat - TCP:192.168.0.10:80 | |||
Send data from stdin to 192.168.0.10:80 over TCP and show response | |||
v socat TCP-LISTEN:8080,fork TCP:192.168.0.10:80 | |||
Listen on port 8080 and forward traffic to 192.168.0.10 at port 80 | |||
v socat TCP-LISTEN:9000,reuseaddr fork EXEC:/bin/cat | |||
Create a simple TCP echo server on port 9000 | |||
v socat TCP4-LISTEN:1234 fork TCP4:localhost:5678 | |||
Relay traffic between ports 1234 and 5678 on localhost u | |||
Created by | |||
v socat STDIN UDP:192.168.0.10:5678 Dan Nanni | |||
Read input from the terminal and send it to UDP server study-notes.org | |||
v socat TCP-LISTEN:8081,fork FILE:/path/to/output.log | |||
Serve a file over TCP. Connect to port 8081 to read the log file | |||
v socat TCP-LISTEN:6000,reuseaddr OPEN:/path/to/file,create,append | |||
Receive data over TCP at port 6000 and append it to a local file | |||
v socat TCP-LISTEN:7000,fork /dev/ttyUSB0,b115200,raw | |||
Forward TCP traffic on port 7000 to a serial device at 115200 baud rate | |||
v socat UNIX-LISTEN:/tmp/mysocket,fork EXEC:/bin/cat | |||
Listen on a UNIX socket and echo incoming data | |||
v socat TCP4-LISTEN:12345,fork,delay=500ms TCP4:localhost:80 | |||
Introduce 500ms delay to forwarded traffic between ports 12345 and 80 | |||
v socat - OPENSSL:example.com:443,verify=0 | |||
Connect to example.com on port 443 while disabling certificate verification | |||
v socat OPENSSL-LISTEN:8443,cert=server.pem,verify=0,fork EXEC:/bin/cat | |||
Listen on port 8443 over SSL/TLS as a simple SSL echo server | |||
v socat TCP-LISTEN:8080,fork OPENSSL:www.example.com:443,verify=0 | |||
Listen on local port 8080 and forward traffic to example.com over SSL/TLS | |||
v socat OPENSSL-LISTEN:8443,cert=test.pem,verify=0,fork TCP:localhost:8080 | |||
Accept SSL connections on 8443 and forward them to non-SSL 8080 |
Version vom 14. Oktober 2025, 11:43 Uhr
Linux socat Command Examples
v socat - TCP:192.168.0.10:80 Send data from stdin to 192.168.0.10:80 over TCP and show response v socat TCP-LISTEN:8080,fork TCP:192.168.0.10:80 Listen on port 8080 and forward traffic to 192.168.0.10 at port 80 v socat TCP-LISTEN:9000,reuseaddr fork EXEC:/bin/cat Create a simple TCP echo server on port 9000 v socat TCP4-LISTEN:1234 fork TCP4:localhost:5678 Relay traffic between ports 1234 and 5678 on localhost u Created by v socat STDIN UDP:192.168.0.10:5678 Dan Nanni Read input from the terminal and send it to UDP server study-notes.org v socat TCP-LISTEN:8081,fork FILE:/path/to/output.log Serve a file over TCP. Connect to port 8081 to read the log file v socat TCP-LISTEN:6000,reuseaddr OPEN:/path/to/file,create,append Receive data over TCP at port 6000 and append it to a local file v socat TCP-LISTEN:7000,fork /dev/ttyUSB0,b115200,raw Forward TCP traffic on port 7000 to a serial device at 115200 baud rate v socat UNIX-LISTEN:/tmp/mysocket,fork EXEC:/bin/cat Listen on a UNIX socket and echo incoming data v socat TCP4-LISTEN:12345,fork,delay=500ms TCP4:localhost:80 Introduce 500ms delay to forwarded traffic between ports 12345 and 80 v socat - OPENSSL:example.com:443,verify=0 Connect to example.com on port 443 while disabling certificate verification v socat OPENSSL-LISTEN:8443,cert=server.pem,verify=0,fork EXEC:/bin/cat Listen on port 8443 over SSL/TLS as a simple SSL echo server v socat TCP-LISTEN:8080,fork OPENSSL:www.example.com:443,verify=0 Listen on local port 8080 and forward traffic to example.com over SSL/TLS v socat OPENSSL-LISTEN:8443,cert=test.pem,verify=0,fork TCP:localhost:8080 Accept SSL connections on 8443 and forward them to non-SSL 8080