[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sample Code for SSH Port Forwarding Server


On Tue, Sep 25, 2018 at 3:11 PM, <g4-lisz@xxxxxxxxxxxx> wrote:

> Hi there
> I need a stripped down / minimal SSH server daemon with port forwarding
> functionality only. Does anybody know some sample code or a similar
> project using libssh?

once upon a time, I tried to implement HaaS (Honeypot as a Service) project
from CZ.NIC written in Python to something 'smaller' to be able to put it
on my OpenWrt .....

The result is here: https://github.com/OgarSkali/HaaS-libssh

Basically it waits for SSH connection, captures username+password and the
makes another SSH connection to the haas.nic.cz 'real' honeypot.
It kind of supports the port forwarding in 5 modes :-)

1) deny
2) allow, forwards it to the other side through the 2nd ssh connection
3) fake acceptance, but simulate the other side close after 500msec
4) fake acceptance, but act as /dev/null
5) fake acceptance, but act as 'echo'

Hope this helps and inspire you.

The overall problem with libssh is that the 'server side' part is not
documented at all - the only documentation is the source code of the libssh
itself and their examples :-)


Zdenek OGAR Skalak

> Cheers,
> Till


Re: Sample Code for SSH Port Forwarding Serverg4-lisz@xxxxxxxxxxxx
Archive administrator: postmaster@lists.cynapses.org