Security > Security Discussion
SSH port forwarding vs. communication security
michalkubik:
Hi, i'm getting desperate
Situation description:
I have 2 computers, they are connected over the switch .
Computer A has:
ip 192.168.0.6 name hostA
there is running SSH server
server part of my TCP/Ip application, listening on port 36000
Computer B has:
ip 192.168.0.14 name hostB
there is running SSH client
client part of my TCP/IP application, sending data on port 36000
I create on host B SSH tunnel with port forwarding by command
ssh -L 34000:hostA:36000 hostB
Afterwards i connect from my client application on ip 127.0.0.1 and port 34000
Until here everything is OK.
Problem description :
I wanted to be sure that my datas are encrypted, so i installed on hostB network monitor, called Ethereal and i can see all my datas, i mean not encrypted as they are going from 192.168.0.14 to 192.168.0.6
Could it be possible that net monitor capture data before the "get into" tunnel and they are encrypted?
Or where else could be the problem?
I also tryed to run net monitor on 3rd computer, but all computers are connected to the switch, so i can not capture communication betwean hostA and host B.
Thanks for help,
Michal
Metgod:
Could you please tell me the exact commands you're typing (copy and paste them if that helps) so I can see where anything might be wrong ?
All of the commands... on each host.
I just did a test and I didn't have any problems (through a tunnel and otherwise). Mind you, I use tcpdump and pipe it through grep to search for things .. but shouldn't make a difference which sniffer you use.
But if you show me the commands and on which host those commands are in, maybe we can pinpoint the problem ...
Also, what version of (I assume openssh) are you using, etc. ?
(just so we can compare better this way)
michalkubik:
Hi, that all commands what i'm using. Should i do something more? (At the end is screen shot of ssh in debug mode)
1 more thing, i'm using Windows XP, if it's relevant.
1st computer
hostname: rastovpc
ip: 192.168.0.6
there is running SSh server
my server TCP application is listening on port 36000
2nd computer
hostname: johe
ip: 192.168.0.14
there is running SSh client
and my TCP client application
Commands:
1st i start SSh tunnel with port forwarding
ssh -L 34000:rastovpc:36000 johe
then i connect with my client application on
ip 127.0.0.1 port 34000
and connection works, but i still can see datas in net monitor.
I ran ssh in debug mode and saved it. Maybe it can be handy too:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
c:\Programme\OpenSSH\bin>ssh -c des -v -L 34000:rastovpc:36000 johe
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to johe [192.168.0.14] port 22.
debug1: Connection established.
debug1: identity file /home/mito/.ssh/identity type -1
debug1: identity file /home/mito/.ssh/id_rsa type 1
debug1: identity file /home/mito/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1
debug1: match: OpenSSH_3.8.1p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
No valid ciphers for protocol version 2 given, using defaults.
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'johe' is known and matches the RSA host key.
debug1: Found key in /home/mito/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
****USAGE WARNING****
This is a private computer system....
debug1: Authentications that can continue: publickey,password,keyboard-interacti
ve
debug1: Next authentication method: publickey
debug1: Trying private key: /home/mito/.ssh/identity
debug1: Offering public key: /home/mito/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interacti
ve
debug1: Trying private key: /home/mito/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interacti
ve
debug1: Next authentication method: password
mito@johe's password:
debug1: Authentication succeeded (password).
debug1: Connections to local port 34000 forwarded to remote address rastovpc:360
01
debug1: Local forwarding listening on 127.0.0.1 port 34000.
debug1: channel 0: new [port listener]
debug1: channel 1: new [client-session]
debug1: Entering interactive session.
Last login: Thu Apr 6 13:51:14 2006 from johe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Dokumente und Einstellungen\mito>debug1: Connection to port 34000 forwarding
to rastovpc port 36000 requested.
debug1: channel 2: new [direct-tcpip]
debug1: channel 2: free: direct-tcpip: listening port 34000 for rastovpc port 36
001, connect from 127.0.0.1 port 4637, nchannels 3
Metgod:
A few things to note:
1. SSH protocol version 2 does not use DES (as you'll see in that output you posted). It does use defaults, but you might want to specify say, dsa for instance. (You shouldn't have to specify it at all though, after configuring the sshd - that is, the 'sshd_config' file)
2. I suspect you don't have a tunnel properly formed.
You have typed in:
ssh -L 34000:rastovpc:36000 johe
I'd try changing it to:
ssh -L 34000:rastovpc:36000 rastovpc
Try 'netstat -a' (on the command line) to see the difference..
Do these things solve the problem, or no ?
Metgod:
Btw...
http://www.openssh.com/faq.html#2.11
But then I'm not sure of any differences in Win versus *nix (except that I have to specify '-l <user>' in the tunnel command). Willing to try to solve the problem either way though ...
Navigation
[0] Message Index
[#] Next page
Go to full version