store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Thu May 23, 2013 12:05 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Listening ports status has changed
Unread postPosted: Wed Jun 27, 2012 10:46 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
Thanks for the additional data. The alert isnt wrong, theres a bizarre process on these systems that opens a highport and doesnt report what process it is. For example:

tcp 0.0.0.0:22 0.0.0.0:* 29733/sshd
tcp 0.0.0.0:10050 0.0.0.0:* -

We ignore highports for known processes that do this (like ftp for example) lsof isnt catching the process on the systems I was given root to either, so its a race with fuser to try and find what it is. Its moot anyway, because whatever it is its only for a second and its not a named listener. I'm thinking it might be named, NFS or an RPC process, because FTP daemons always name their listeners. Are any of you using NFS, RPC or LDAP processes?

An update for an unnamed process is on the way in the next release. For now, blame the knuckleheads that wrote their code like this. Its baffling why they wouldnt expose the process thats holding the socket open.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Wed Jun 27, 2012 4:47 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
A testing build is available for this issue, if you want to try it run these commands as root:

yum --enablerepo=asl-3.0-testing upgrade asl asl-web asl-waf-module

asl -s -f

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Wed Jun 27, 2012 5:02 pm 
Offline
Forum Regular
Forum Regular

Joined: Thu May 07, 2009 12:46 pm
Posts: 219
Ok nice work will try it :)


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Wed Jun 27, 2012 5:24 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
And if you see it happen repeatedly, it means there is another mysterious process running on a high port that we need to ignore. Basically what we need, ideally, is a netstat -lntp with the socket listening.

But, thats not always feasible with these "on for a second" listeners.

I threw a super hack of a script together in a hurry to catch it, but I'll have to find it again. If I had more time I'd make it smarter, but it was all I needed at the time.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 3:25 am 
Offline
Forum Regular
Forum Regular

Joined: Thu May 07, 2009 12:46 pm
Posts: 219
This update has fixed the issue for me :)

Great work again


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 2:33 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
Sneaky little processes too. If you see any other examples, let us know. We're also on the look out for other apps that do this and will keep updating accordingly. That part of ASL is going to become part of the rule updates, which will make it simpler to update rules like this. Right now they are part of the asl rpms, and we dont want folks to have to upgrade for minor changes like this.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 4:44 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Nov 23, 2010 7:30 am
Posts: 247
Location: Glasgow, UK
mikeshinn wrote:
Are any of you using NFS, RPC or LDAP processes?

Nope - nothing like that in use here - unless it is active from a default Plesk 10.4 install?

Mine is still alerting, but just installed 27-1 and will leave it overnight to see if anything happens.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 4:49 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Nov 23, 2010 7:30 am
Posts: 247
Location: Glasgow, UK
Spoke to soon... just after I updated, two appeared.

Code:
ossec: output: `netstat -nltp | grep LISTEN | egrep -v "127.0.0.1|/[1-9][0-9][0-9][0-9].*(ftp|-)" | awk -f /var/asl/lib/ports.awk`:
Protocol IP:port Destination
tcp 0.0.0.0:3xxx 0.0.0.0:*
tcp 0.0.0.0:106 0.0.0.0:*
tcp 0.0.0.0:3306 0.0.0.0:*
tcp 0.0.0.0:587 0.0.0.0:*
tcp 0.0.0.0:465 0.0.0.0:*
tcp x.x.x.34:53 0.0.0.0:*
tcp x.x.x.32:53 0.0.0.0:*
tcp x.x.x.31:53 0.0.0.0:*
tcp x.x.x.3:53 0.0.0.0:*
tcp x.x.x.2:53 0.0.0.0:*
tcp x.x.x.114:53 0.0.0.0:*
tcp x.x.x.113:53 0.0.0.0:*
tcp x.x.x.112:53 0.0.0.0:*
tcp x.x.x.101:53 0.0.0.0:*
tcp x.x.x.40:53 0.0.0.0:*
tcp x.x.x.46:53 0.0.0.0:*
tcp x.x.x.35:53 0.0.0.0:*
tcp x.x.x.33:53 0.0.0.0:*


The 3xxx port is my altered SSH port (am I being too paranoid blanking it out here?! ha!) it is in the 3000's and is the only non-standard port on the list really?

Not quite sure about 106 though?


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 4:51 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
Quote:
Spoke to soon... just after I updated, two appeared.


You should get an alert when you update, the ports will have changed (because certain ports are ignored now).

Quote:
ossec: output: `netstat -nltp | grep LISTEN | egrep -v "127.0.0.1|/[1-9][0-9][0-9][0-9].*(ftp|-)" | awk -f /var/asl/lib/ports.awk`:


Thats a cached alert from your previous build, that line is different in .27.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 4:53 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Nov 23, 2010 7:30 am
Posts: 247
Location: Glasgow, UK
Thanks, will keep an eye on it in the morning then.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 5:00 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
Make sure you restart OSSEC just in case it has not loaded the new config:

/etc/init.d/ossec-hids restart

We're going to add in reporting the application name in the next release. We thought about including the pid, but havent sorted out how we want to do that yet - its gonna change and that might not be important and we dont want to alert on that.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 5:27 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Nov 23, 2010 7:30 am
Posts: 247
Location: Glasgow, UK
Restarted and just checked again... still happening - four of them in quick succession:

Code:
ossec: output: `netstat -nltp | grep LISTEN | egrep -v "127.0.0.1|/[1-9][0-9][0-9][0-9].*(ftp|-)" | awk -f /var/asl/lib/ports.awk`:
Protocol IP:port Destination
tcp 0.0.0.0:3xxx 0.0.0.0:*
tcp 0.0.0.0:106 0.0.0.0:*
tcp 0.0.0.0:3306 0.0.0.0:*
tcp 0.0.0.0:587 0.0.0.0:*
tcp 0.0.0.0:465 0.0.0.0:*
tcp x.x.x.34:53 0.0.0.0:*
tcp x.x.x.32:53 0.0.0.0:*
tcp x.x.x.31:53 0.0.0.0:*
tcp x.x.x.3:53 0.0.0.0:*
tcp x.x.x.2:53 0.0.0.0:*
tcp x.x.x.114:53 0.0.0.0:*
tcp x.x.x.113:53 0.0.0.0:*
tcp x.x.x.112:53 0.0.0.0:*
tcp x.x.x.101:53 0.0.0.0:*
tcp x.x.x.40:53 0.0.0.0:*
tcp x.x.x.46:53 0.0.0.0:*
tcp x.x.x.35:53 0.0.0.0:*
tcp x.x.x.33:53 0.0.0.0:*


After double checking I was running the correct version:
Code:
#  asl -v
ASL Version 3.0.27-1.el5.art: UNSUPPORTED: An update is available.


I've checked and no new updates are available!
Code:
# asl -u
Checking for updates..
  ASL version is current: 3.0.27-1.el5.art                 [OK]
  APPINV rules are current: 201201041122                   [OK]
  CLAMAV rules are current: 201206281623                   [OK]
  GEOMAP rules are current: 201206281617                   [OK]
  MODSEC rules are current: 201206281623                   [OK]
  Updating OSSEC to 201206281701: updated                  [OK]
    Updating Self Healing modules: updated                 [OK]
    Updating Brute Force Protection: updated               [OK]
    Updating Rootkit Protection: updated                   [OK]


Am I missing something obvious here?


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 5:38 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
Quote:
Am I missing something obvious here?


Maybe not obvious, but yum isnt as clever as you might hope, your cache probably needs to be cleaned. Just run this command:

yum clean all

yum probably doesnt think the update isnt an update (it probably thinks it already has it, when it doesnt).

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Thu Jun 28, 2012 5:46 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3245
Location: Chantilly, VA
So we wrote a new tool to do this, it will be going out in 3.0.28. You'll see the process name now, which will help alot to figure out what may be there.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Listening ports status has changed
Unread postPosted: Fri Jun 29, 2012 2:49 pm 
Offline
Forum User
Forum User

Joined: Sat Jan 21, 2012 6:37 pm
Posts: 98
Location: Canada
Incase this helps :)

cPanel Box.

Code:
ossec: output: `netstat -nltp | grep LISTEN | egrep -v "127.0.0.1|/[1-9][0-9][0-9][0-9].*(ftp|-)" | awk -f /var/asl/lib/ports.awk`:
Protocol IP:port Destination
tcp xxxxxx:53 0.0.0.0:*
tcp xxxxxx:53 0.0.0.0:*
tcp xxxxxx:53 0.0.0.0:*
tcp xxxxxx:53 0.0.0.0:*
tcp 0.0.0.0:21 0.0.0.0:*
tcp 0.0.0.0:xxxx(ssh) 0.0.0.0:*
tcp 0.0.0.0:25 0.0.0.0:*
tcp 0.0.0.0:26 0.0.0.0:*
tcp 0.0.0.0:443 0.0.0.0:*
tcp 0.0.0.0:993 0.0.0.0:*
tcp 0.0.0.0:2082 0.0.0.0:*
tcp xxxxxx:64738 0.0.0.0:*
tcp 0.0.0.0:2083 0.0.0.0:*
tcp 0.0.0.0:995 0.0.0.0:*
tcp 0.0.0.0:2086 0.0.0.0:*
tcp 0.0.0.0:2087 0.0.0.0:*
tcp 0.0.0.0:3306 0.0.0.0:*
tcp 0.0.0.0:587 0.0.0.0:*


Although these aren't showing up that often, maybe only after updates or something. But I'll keep looking. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group