On 9/16/20 6:10 AM, Chris Green wrote:
If I have opened an ssh connection to a remote server is there any
way to check if the session includes remote port forwarding?
I'm not aware of anything reliable.
You might be able to tell after the fact if there are established
connections from loopback (as the user that ran the outbound ssh
connection) to loopback.
It would be easy if the port forwarding had been done from the command
line, e.g. if the command was 'ssh -R 12345:localhost:54321 server' one
could simply use ps or psgrep to see if there's a "-R 12345" in there.
That relies on being able to see the command in ps's output. There are
a number of ways that make this unreliable. Admittedly, many of which
are darker grey in color.
However I can't see any way to do it if the remote forward has been
done by "RemoteForward 12345 localhost:54321" in the ssh config file.
There is also the fact that you can dynamically alter the port
forwarding mid-session. So yet another way, thus thing you would need
to check.
Is there anything one can check to see the internal configuration of
a running ssh process?
I think that you would have to enumerate the process space of the other
running client ssh processes. Something that I expect is non-trivial
and that OpenSSH is probably going to be hostile and try to protect against.
--
Grant. . . .
unix || die
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)