Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Weird problem with gentoo-router 0_o
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
darookee
Apprentice
Apprentice


Joined: 02 Jan 2003
Posts: 162
Location: Long Beach, CA.

PostPosted: Fri Jan 09, 2004 2:18 pm    Post subject: Weird problem with gentoo-router 0_o Reply with quote

I've got a very weird problem with one of our companies gentoo-routers. When I try to ssh into it it says 'Connection Refused' but sshd _is_ definately running. From localhost and the local network I can use ssh.
As I first noticed the problem I did a nmap portscan on the machine... It looked like this
Quote:

Starting nmap 3.45 ( http://www.insecure.org/nmap/ ) at 2004-01-09 15:07 CET
Interesting ports on pxxxxxxxx.xxx.x-xxxxxx.xxx (xx.xxx.xxx.xxx):
(The 1638 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
45/tcp open mpm
53/tcp open domain
131/tcp open cisco-tna
133/tcp open statsrv
195/tcp open dn6-nlm-aud
237/tcp open unknown
285/tcp open unknown
395/tcp open netcp
442/tcp open cvc_hostd
446/tcp open ddm-rdb
487/tcp open saft
557/tcp open openvms-sysipc
585/tcp open imap4-ssl
715/tcp open unknown
737/tcp open unknown
848/tcp open unknown
1471/tcp open csdmbase
1511/tcp open 3l-l1
5232/tcp open sgi-dgl

So... I was surprised... 0_o
Than I restarted the sshd and again did a portscan which looked like this
Quote:

Starting nmap 3.45 ( http://www.insecure.org/nmap/ ) at 2004-01-09 15:09 CET
Interesting ports on pxxxxxxxx.xxx.x-xxxxxx.xxx (xx.xxx.xxx.xxx):
(The 1640 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
104/tcp open acr-nema
152/tcp open bftp
529/tcp open irc-serv
567/tcp open banyan-rpc
636/tcp open ldapssl
649/tcp open unknown
711/tcp open unknown
811/tcp open unknown
854/tcp open unknown
937/tcp open unknown
1011/tcp open unknown
1445/tcp open proxima-lm
1472/tcp open csdm
1495/tcp open cvc
1510/tcp open mvx-lm
5432/tcp open postgres
5680/tcp open canna

I thought it may be a kernel patch or something that would try to trick the portscanner by open random ports when noticing a portscan but it is a clean vanilla-kernel and i don't think that it does this out-of-the-box 0_o
It isn't even a process running, that could do such a thing...
The router now seems to be verry secure... but the bad thing is, that i can't access it from outside :/
Is there a way I can turn this off? Or... mainly... wtf is this? 0_o

thx in advance
a confused rookee 0_o
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Fri Jan 09, 2004 2:22 pm    Post subject: Re: Weird problem with gentoo-router 0_o Reply with quote

Are you running the sshd on one of those ports? Are you trying to connect with ssh on another port? If not, you should have port 22/sshd open.

If your firewall rules won't allow ssh in, then it's not going to come in, unless you are doing it on some other port.

Also, I don't think there are any kernel patches that will create/alter your firewall rules. ...unless I am missing something about the "security" kernel patch. All those rules should be made by the firewall administrator.
_________________
http://dkap.info
Back to top
View user's profile Send private message
darookee
Apprentice
Apprentice


Joined: 02 Jan 2003
Posts: 162
Location: Long Beach, CA.

PostPosted: Fri Jan 09, 2004 2:30 pm    Post subject: Reply with quote

sshd is running on port 22
it is a very simple router which only masquerades outgoing traffic so there are no firewall rules except the one that masquerades
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Fri Jan 09, 2004 4:38 pm    Post subject: Reply with quote

I guess I'm not clear on what the problem is exactly. If you can ssh to that box from the LAN and from localhost, I imagine that a port scan from the LAN/localhost will reveal an open port 22. Otherwise, how are you connecting locally but not remotely?

You did call this box a router. Is it doing some kind of packet filtering? If so, then that's likely the cause of your problem. Packet filtering will block certain ports (which whoever set the packet filtering up defined).

If this box is behind a NAT'ed gateway/firewall/router, then you are going to have to set up some kind of redirection on that gateway/firewall/router that allows/forwards TCP requests on port 22 from the rest of the world into that machine on the LAN. There is no way for the outside client to know which box it's connecting to if the box has a private IP like 192.168.x.x or 10.x.x.x., etc.

Post some more details, please.

Thanks,

Dave
_________________
http://dkap.info
Back to top
View user's profile Send private message
darookee
Apprentice
Apprentice


Joined: 02 Jan 2003
Posts: 162
Location: Long Beach, CA.

PostPosted: Fri Jan 09, 2004 5:12 pm    Post subject: Reply with quote

A portscan from the local network shows port 22 open.
The 'router' does no packet filtering because we don't restrict any kind of internet access from our employees. they can do what they want ;) The router is just for dialing up to our isp so that the network is connected...
And it is not behind anything. it directly dials into the isp.
did you notice that those 2 portscans have different ports open? each time i portscan this box on it's external ip-address it seems to open random ports...
i even can't detect the os with nmap -O o_0
Quote:

the network scheme:
{INTERNET}
|
| ___________ Client01
| /
(Router) ----------------------------------------------- Client02
\
----------------- Client03

evil-ascii-art 0_o
Back to top
View user's profile Send private message
fleed
l33t
l33t


Joined: 28 Aug 2002
Posts: 756
Location: London

PostPosted: Fri Jan 09, 2004 5:20 pm    Post subject: Reply with quote

ISP block perhaps?
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Fri Jan 09, 2004 7:41 pm    Post subject: Reply with quote

what gives
Code:
netstat -plunt


is sshd listening on your external ip?

what is configured in /etc/ssh/sshd_config for 'ListenAddress'?
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
darookee
Apprentice
Apprentice


Joined: 02 Jan 2003
Posts: 162
Location: Long Beach, CA.

PostPosted: Sun Jan 11, 2004 12:27 am    Post subject: Reply with quote

netstat -plunt gives me a line containing
Quote:

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3244/sshd

The ListenAddress is set to default (0.0.0.0 i think 0_o).
The ISP doesn't seem to block ssh connections cause in our other company-building we use the same ISP and i can get a ssh connection to the router in that building : /
*confused*
Back to top
View user's profile Send private message
darookee
Apprentice
Apprentice


Joined: 02 Jan 2003
Posts: 162
Location: Long Beach, CA.

PostPosted: Fri Jan 30, 2004 9:26 am    Post subject: Reply with quote

Another weired thing... I forwarded port 3389 to a Terminal Server which is behind the Router... And I can connect to it through the Router 0_o But I still can't connect to the Router using SSH :/
Back to top
View user's profile Send private message
triwebb1
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2003
Posts: 87

PostPosted: Sat Jan 31, 2004 12:25 am    Post subject: Reply with quote

Try reseting the router. I have had wierd iptables problems with my router before, but a reset fixed it. Yeah....... Its hard to explain...... It wasn't doing what it was supposed to, but a restart fixed it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum