Teknisk > Generelt teknisk

CentOS 7 nmap-ncat does not support SOCKS5

(1/1)

Floyd-ATC:
Tunneling an ssh session through a SOCKS5 proxy (e.g. using Tor) should be possible by adding the following to your
--- Kode: ---/etc/ssh/ssh_config
--- Slutt kode ---
file:


--- Kode: ---Host *.example.com
        CheckHostIP no
        Compression yes
        Protocol 2
        ProxyCommand ncat --nodns --proxy-type socks5 --proxy 127.0.0.1:9050 %h %p
--- Slutt kode ---

Unfortunately, RHEL7/CentOS 7 ships with a rather antiquated version of nmap-ncat (a modern replacement for the now unmaintained BSD netcat) and this version only supports socks4.

Trying to use socks4 is similar to using no proxy at all, it fails with the following rather cryptic error message:

--- Kode: ---get_sock_port: getnameinfo NI_NUMERICSERV failed: ai_family not supported
--- Slutt kode ---

Solution:
Uninstall the useless version of nmap-ncat:
--- Kode: ---yum erase nmap-ncat
--- Slutt kode ---
Download the newest RPM from https://nmap.org/download.html
Install it. Example:
--- Kode: ---yum localinstall ncat-7.30-1.x86_64.rpm
--- Slutt kode ---
Fix your
--- Kode: ---/etc/ssh/ssh_config
--- Slutt kode ---
as shown above.

Navigering

[0] Oversikt

Skift til full visning