Secure Shell (SSH), commonly known as as Secure Socket Shell, is usually a UNIX-based command interface and protocol for securely getting access to your remote computer.
Socket Secure (SOCKS) is definitely an Internet protocol that routes network packets coming from a client and server by using a proxy server. SOCKS5 additionally provides authentication so only authorized users may access a server.
Secure Shell proxy for SOCKS5:
Synopsis:
/usr/lib/ssh/ssh-socks5-proxy-connect
[-h socks5_proxy_host]
[-p socks5_proxy_port] connect_host connect_port
Description:
A proxy command for ssh(1) using SOCKS5 (RFC 1928). Typical use is where connections external to your network are simply just allowed by using a socks gateway server.
This proxy command isn't going to provide the SOCKS5 authentication mechanisms defined in RFC 1928. Only anonymous connections are possible.
Options:
The following choices are supported:
-h socks5_proxy_host
Specifies the proxy web server in which to connect. Overrides the SOCKS5_SERVER environment variable.
-p socks5_proxy_port
Specifies the port what is the best the proxy web server runs. If not specified, port 80 is assumed. Overrides the SOCKS5_PORT environment variable.
Operands:
The following operands are supported:
socks5_proxy_host
The host name or IP address (IPv4 or IPv6) on the proxy.
socks5_proxy_port
The numeric port number for connecting to on socks5_proxy_host.
connect_host
The name from the remote host in which the socks gateway is in order to connect you.
connect_port
The numeric port number with the socks gateway to attach you to on connect_host.
Problem:
Currently setup a SSH session by using a SOCKS5 proxy with all the OpenSSH command:
ssh -o "connect -5 -S proxy.socks5.ip.name %h %p" target.ip.name
Now, I want to have my existing perl programs which use Net::SSH::Perl, so as to use a SOCKS5 proxy, as required. What is the simplest way to make this happen?
My current thought should be to patch Net::SSH::Perl to work with Net::SOCKS.Is there a better/easier/faster way?
We discussed video bit inside chatterbox, and items that were said went such as "use LD_PRELOAD to load a socksifier". I have little idea on either these things are.
I have existing perl programs which use Net::SSH::Perl, and I'd like to "just use them", but have the ssh stuff feel the SOCKS5 proxy.
Solution:
The dante debian package gives a program called socksify which:
Uses LD_PRELOAD environment variable to wrap all networking-related system calls to ensure programs can be thought a SOCKS server that had been installed included in a firewall.
I'd imagine such as socksify ./script.pl will work the trick.
If your program must also access some non-socksified subnet you will need to split your program into two parts which talk using a pipe (or similar).
The challenge with this option is that I have to have a socksify program developed for all my platforms (MacOS, SunOS, Windows, linux), and I'm uncertain that socksify will build its them. This is why I like Net::SSH::Perl a great deal. The native perl code affords the ssh protocol directly, so my perl code is definitely plopped onto a platform, all of which will mostly, "just run".
I think the higher quality long-term way is usually to somehow hold the Net::SSH::Perl module make use on the Net::SOCKS module to offer this functionality, when requested. Maybe I'll just "dig-in" and find out what happens.
Create a fresh class produced by Net::SSH::Perl and redefine the _connect solution to do anything you want. For instance, implementing the SOCKS5 protocol yourself (it is a very simple one) or utilising an external SOCKS5 adapter connected using a pipe or perhaps a unix socket.
Actually trying to modify Net::SSH::Perl to optionally utilize Net::SOCKS, when requested. If I might get this working, I'll provide my patches on the author for consideration making it official.
Proxy List 26 December 2015 :
We will come back with niche article and share proxy list daily. Don't miss it.