|
|
Netcat |
Aus Wiki.csoft.at
Client/Server ModellServer auf Port 1234 tcp startennc -l 1234 nc wartet nun auf Port 1234 tcp auf Eingaben Prüfennetstat -an | grep :1234 ergibt tcp 0 0 0.0.0.0:1234 0.0.0.0:* LISTEN Verbindung über das Netzwerk aufbauennc 127.0.0.1 1234 Alles, was in der ersten Konsole eingegeben wird, wird auch in der zweiten angezeigt und umgekehrt. Die Verbindung wird mit EOF (^D) getrennt. Datei über das Netzwerk übertragenServer startennc -l 42 > target.txt Datei sendennc localhost 42 < source.txt Mit Servern sprechenSMTPnc localhost 25 << EOF HELO host.example.com MAIL FROM: <user@host.example.com> RCPT TO: <user2@host.example.com> DATA Body of email. . QUIT EOF Portscantcpnc -z localhost 1-65535 ergibt z. B. Connection to localhost 25 port [tcp/smtp] succeeded! Connection to localhost 110 port [tcp/pop3] succeeded! Connection to localhost 143 port [tcp/imap] succeeded! Versionen ermittelnecho "QUIT" | nc localhost 1-65535 man ncOpen a TCP connection to port 42 of host.example.com, using port 31337 as the source port, with a timeout of 5 seconds nc -p 31337 -w 5 host.example.com 42 Open a UDP connection to port 53 of host.example.com nc -u host.example.com 53 Open a TCP connection to port 42 of host.example.com using 10.1.2.3 as the IP for the local end of the connection nc -s 10.1.2.3 host.example.com 42 Create and listen on a Unix Domain Socket: nc -lU /var/tmp/dsocket Connect to port 42 of host.example.com via an HTTP proxy at 10.2.3.4, port 8080. This example could also be used by ssh(1); see the ProxyCommand directive in ssh_config(5) for more information. nc -x10.2.3.4:8080 -Xconnect host.example.com 42 An ssh_config(5) line to ssh(1) through an HTTP proxy at host.example.com, port 8080: ProxyCommand /usr/bin/nc -X connect -x host.example.com:8080 %h %p Siehe auchWeblinks |