LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-26-2009, 06:06 PM   #1
M_F_H
LQ Newbie
 
Registered: Jun 2006
Posts: 12

Rep: Reputation: 0
Multiple ssh's running protected by tcpwrappers -- but nmap reports different results


I have two Ubuntu 8.04 boxes, called BoxA and BoxB. These boxes are connected on a LAN whose network is 192.168.1.0/24. Each box runs two ssh daemons that are bound to ports 22 and 2222. On both boxes, tcpwrappers is running, and each box's /etc/hosts.allow look like:

ALL: 127.0.0.1, localhost, 192.168.1.0/24 : ALLOW

On each box, /etc/hosts.deny looks like:

All: PARANOID
ALL: ALL

From BoxA, sudo namp -A -p22,2222 localhost yields:

PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)
2222/tcp open tcpwrapped

Also from BoxA, sudo nmap -A -p22,2222 BoxB yields

PORT STATE SERVICE VERSION
22/tcp open tcpwrapped
2222/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)

Notice how the reported service is flipped between ssh and tcpwrapped.

Now, from BoxB, sudo nmap -A -p22,2222 localhost yeilds

PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)
2222/tcp open tcpwrapped


Again from BoxB, sudo nmap -A -p22,2222 BoxA yeilds

PORT STATE SERVICE VERSION
22/tcp open tcpwrapped
2222/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)


So I observe the same flipping behaviour from each box. What I don't understand is, why does nmap report one port as tcpwrapped, and the other as ssh with a complete version number? Any does it make any difference whether the scan is local or remote?

Ideally, I'd like nmap to show both ports 22 and 2222 as tcpwrapped on both boxes. How can that be done?

TIA.
 
Old 01-26-2009, 06:19 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Running nmap against your loopback device is generally a useless exercise.

Let's back up a moment -- in spite of what nmap says when being run from another box, have you confirmed that both sshd daemons (i.e. the one listening on tcp 22 and the one listening on tcp 2222) are indeed protected by tcp wrappers? You can check this, for example, by temporarily adding B to A's deny list. Check both daemons.
 
Old 01-26-2009, 06:53 PM   #3
M_F_H
LQ Newbie
 
Registered: Jun 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Problem solved. I had /etc/inetd.conf misconfigured on both boxes. Now they are fixed and I'm getting everything I wanted. nmap reports that the ports are open, but are tcpwrapped.

Thanks for your help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nmap reports 5190/tcp to be open GSMD Linux - Networking 2 08-20-2008 03:57 PM
Different nmap results Andriy Linux - Security 3 06-01-2006 08:22 AM
df reports wrong results jjrowan Linux - Software 4 05-11-2006 10:01 AM
nmap results djcomplex Linux - Software 3 03-20-2004 01:46 PM
nmap results richlawson Linux - Security 6 12-16-2003 03:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration