LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-13-2012, 03:55 PM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
Crack attempt trying to grab the passwd file


Hello --

One of our servers was subjected to a crack attempt that tried to grab the /etc/passwd file. The file does not appear to have been touched due to the timestamp on the file not being of a recent date. However, just to make sure, I wanted to know if there are other tests that can be done to verify this.

One thought that I had was the following: The server is regularly backed up, and I could do a restore of an older version of the passwd file to a temporary directory. Once there, the diff command could be used to compare the two files.
 
Old 06-13-2012, 05:06 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
You could compare but with the timestamps more than likely nothing was modified. However, the timestamps won't tell you if it was read successfully by the request which would give the cracker the list of user accounts set up on the server. The /etc/passwd file is world readable by default so it could be read by any other user that attempted to get it. Wikipedia has some info on this type of attack: http://en.wikipedia.org/wiki/Directory_traversal_attack

You can do some searching on how to prevent this but its usually only prevented with input sanitation done on the web server level.
 
Old 06-13-2012, 06:57 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by kaplan71 View Post
One of our servers was subjected to a crack attempt that tried to grab the /etc/passwd file.
How exactly did you determine this? Wasn't it only one line in a long line of what appears to be web stack application probes?
Being as verbose as possible would be appreciated.
 
Old 06-13-2012, 07:11 PM   #4
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hello --

I was informed of the attack via e-mail from our Information Security team. The text of the e-mail is shown below:

Quote:
Open Time: 06/07/12 20:32:32
Summary: Host_Query:Raw Event:Host Query eventId=6823616802413 vendor=Cisco eventType=evIdsAlert hostId=eips1 appName=sensorApp appInstanceId=13530 tmTime=1339119106675 severity=3 interfaceGroup=vs0 Interface=PortChannel0/0 Protocol=tcp riskRatingValue=75 sigId=32
Priority: High
Device Name: <name> (Primary)
Site ID: <site location>

The incident has been classified by our support engineers:

Alarm Source: Malicious
Sub Category: Exploits
Actions: No Action

Classification Details:
Malicious packet triggered on Sig-ID 3201/1.

Alarm triggered on Unix Password File Access Attempt traffic from the external host at <ip address> to the external host at <ip address>.

These alarms triggers when any cgi-bin script attempts to retrieve password files on various operating systems. Such as the /etc/passwd. This may indicate an attempt to illegally access system resources, in particular the /etc/passwd file. This may be the prelude to a more serious attack. No valid reason to access these files via this mechanism exists. Hosts that attempt to access the these files, especially from outside your network, should be shunned. The internal host should also be checked for possible compromise.
I am going through the system and web server log files to determine if a successful connection was made, and the file in question was accessed from the remote system.
 
Old 06-13-2012, 09:06 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Changing passwords now and often may help.

Not sure how much help a modern linux disto's file is vulnerable to a common hacker even.
 
Old 06-14-2012, 10:17 AM   #6
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
You have the event date and time. Look at your Apache error and access logs for a query that contains passwd and, or shadow, probably with a bunch of ../../ in it. Normally, a user should not be able to browse outside of the document path, but it is prudent to see if access to this file were gained.
 
Old 06-14-2012, 01:23 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
//Also don't forget the recent CVE-2012-1823.
 
  


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
How to grab certain data from trace file? yida Linux - Newbie 16 08-03-2010 04:49 PM
How to grab certain data from trace file? yida Linux - Networking 2 07-31-2010 06:20 AM
LXer: How to crack a wireless WEP key using AIR Crack LXer Syndicated Linux News 1 05-09-2010 07:59 AM
SSH crack attempt, How to manage? dbrooke Linux - Security 8 11-18-2007 10:09 PM
Shadow File Crack Elbryan Linux - Security 2 02-22-2005 05:00 PM

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

All times are GMT -5. The time now is 12:28 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