Difference between revisions of "Ncat"
Jump to navigation
Jump to search
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[wikipedia:ncat| | + | <code>[[wikipedia:ncat|ncat]]</code> is improved reimplementation of not anymore maintained [[netcat]] software by <code>[[nmap]]</code> developers. It Includes support for chain Ncats together, redirect both TCP and UDP ports to other sites, SSL support, and proxy connections via SOCKS4 or HTTP (CONNECT method) proxies (with optional proxy authentication as well). |
== Usage examples == | == Usage examples == | ||
− | * Connect to example.org on TCP port 8080 | + | * Connect to example.org on TCP port 8080: |
− | * Listen for connections on TCP port 8080 | + | :<code>ncat example.org 8080</code> |
− | * Redirect TCP port 8080 on the local machine to host on port 80 | + | * Listen for connections on TCP port 8080: |
− | * Bind to TCP port 8081 and attach /bin/bash for the world to access freely | + | :<code>ncat -l 8080</code> |
+ | * '''[[Redirect]]''' TCP port 8080 on the local machine to host on port 80: | ||
+ | :<code>ncat --sh-exec "ncat example.org 80" -l 8080 --keep-open</code> | ||
+ | * Bind to TCP port 8081 and attach /bin/bash for the world to access freely: | ||
+ | : <code>ncat --exec "/bin/bash" -l 8081 --keep-open</code> | ||
* Bind a shell to TCP port 8081, limit access to hosts on a local network, and limit the maximum number of simultaneous connections to 3: | * Bind a shell to TCP port 8081, limit access to hosts on a local network, and limit the maximum number of simultaneous connections to 3: | ||
− | + | :<code>ncat --exec "/bin/bash" --max-conns 3 --allow 192.168.0.0/24 -l 8081 --keep-open</code> | |
− | * Connect to smtphost:25 through a SOCKS4 server on port 1080: <code>ncat --proxy socks4host --proxy-type socks4 --proxy-auth user smtphost 25</code> | + | * Connect to smtphost:25 through a SOCKS4 server on port 1080: |
− | * Create an HTTP [[proxy server]] on localhost port 8888 | + | :<code>ncat --proxy socks4host --proxy-type socks4 --proxy-auth user smtphost 25</code> |
+ | * Create an HTTP [[proxy server]] on localhost port 8888: | ||
+ | :<code>ncat -l --proxy-type http localhost 8888</code> | ||
* Send a file over TCP port 9899 from host2 (client) to host1 (server).<syntaxhighlight lang="console"> | * Send a file over TCP port 9899 from host2 (client) to host1 (server).<syntaxhighlight lang="console"> | ||
user@HOST1$ ncat -l 9899 > outputfile | user@HOST1$ ncat -l 9899 > outputfile | ||
Line 19: | Line 25: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | == Related commands == | ||
+ | * <code>[[cat]]</code> | ||
+ | * [[nc -v]] | ||
== See also == | == See also == | ||
− | * | + | * {{netcat}} |
− | * | + | * {{ssh}} |
+ | * {{nmap}} | ||
[[Category:Networking]] | [[Category:Networking]] | ||
[[Category:Computer Networks]] | [[Category:Computer Networks]] | ||
[[Category:IT Security| ]] | [[Category:IT Security| ]] |
Latest revision as of 07:07, 31 May 2023
ncat
is improved reimplementation of not anymore maintained netcat software by nmap
developers. It Includes support for chain Ncats together, redirect both TCP and UDP ports to other sites, SSL support, and proxy connections via SOCKS4 or HTTP (CONNECT method) proxies (with optional proxy authentication as well).
Usage examples[edit]
- Connect to example.org on TCP port 8080:
ncat example.org 8080
- Listen for connections on TCP port 8080:
ncat -l 8080
- Redirect TCP port 8080 on the local machine to host on port 80:
ncat --sh-exec "ncat example.org 80" -l 8080 --keep-open
- Bind to TCP port 8081 and attach /bin/bash for the world to access freely:
ncat --exec "/bin/bash" -l 8081 --keep-open
- Bind a shell to TCP port 8081, limit access to hosts on a local network, and limit the maximum number of simultaneous connections to 3:
ncat --exec "/bin/bash" --max-conns 3 --allow 192.168.0.0/24 -l 8081 --keep-open
- Connect to smtphost:25 through a SOCKS4 server on port 1080:
ncat --proxy socks4host --proxy-type socks4 --proxy-auth user smtphost 25
- Create an HTTP proxy server on localhost port 8888:
ncat -l --proxy-type http localhost 8888
- Send a file over TCP port 9899 from host2 (client) to host1 (server).<syntaxhighlight lang="console">
user@HOST1$ ncat -l 9899 > outputfile user@HOST2$ ncat HOST1 9899 < inputfile </syntaxhighlight>
- Transfer in the other direction, turning Ncat into a “one file” server.<syntaxhighlight lang="console">
user@HOST1$ ncat -l 9899 < inputfile user@HOST2$ ncat HOST1 9899 > outputfile </syntaxhighlight>
Related commands[edit]
See also[edit]
telnet
,netcat, nc, nc -l
,ncat
,socat, ngrok
- SSH:
ssh
, TLS,.ppk, .pem, .crt, .pub
, ED25519, Key exchange method (KEX), public key, private key,ssh -Q kex
,IAMUserSSHKeys
,known_hosts
, ssh tunnel, Dropbear - Security tools: Vulnerability scanner, port scan, Host sweep,
nmap
,nping
,ncat, nc
,psad
, Gordon Lyon
Advertising: