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 12-30-2003, 10:03 PM   #1
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
How many hack attempts should be expected?


I just read my apache logs, and it seems that something was looking for some windows exploits on the machine. How much should I expect stuff like this, is this something that is going to happen multiple times in a day, or is this a rarity and a cause for alarm?
 
Old 12-30-2003, 10:19 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
It can vary depending on what range of IP addresses you're in, but for the most part you should just get used to it as it's a common thing. You can filter them out, but it's really costly in terms of system resources to do so. I just mostly ignore the windows-related stuff. If you think it's bad now, just wait until the next Microsoft IIs exploit comes out You'll be wishing you could pipe your logs to /dev/null.
 
Old 12-31-2003, 01:09 AM   #3
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Original Poster
Rep: Reputation: 30
Okay, I was just amazed that I was being scanned by nimda in such a short time. I was barely online and the scans started coming in. It seems that they come in every few hours.
Thanks.
 
Old 12-31-2003, 01:49 AM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Most people don't realize how nasty the 'net can be, so seeing your Apache logs fill with malicious traffic can be a kind of startling at first. You'll notice that some of the worms/viruses have a pretty static level, while others like several of the Code Red worms have engines that only attack hosts on certain parts of the month. It's been awhile, but I think a couple of them will only scan for vulnerable hosts after the 19th or something like that. So on the 19th of every month you'd walking in and see your Apache logs fill with hundreds of the CodeRed trademark XXXXXXXXXXX or NNNNNNNNNNNNN buffer overflow attempts. Kind of amusing looking back on it. Most variants were hard-coded not to spread after a certain date, so you don't see them nearly as much.

But you'll see plenty of IIs exploits, people hunting for open proxies, spiders looking for email addresses, etc. What you'll want to keep you're eyes open for is concerted probing. Someone starting out doing some info and banner-grabbing, then moving on to more malicious things like trying linux and even distro-specific exploits. It can be hard to spot that in the see of noise, and the more proficient the attacker the less obvious it will be. In general though, if you make sure to keep up to date with any patches for Apache and are smart about your systems security overall, you should be alright.
 
Old 01-09-2004, 04:42 PM   #5
katmai90210
Member
 
Registered: Nov 2003
Location: Romania
Distribution: Redhat Linux , Fedora & SuSe
Posts: 46

Rep: Reputation: 15
if you keep your apache up 2 date you need to worry not .. if you keep your server up2date you don't need to worry quite much ...
 
Old 01-09-2004, 05:32 PM   #6
zepplin611
Member
 
Registered: Jan 2004
Distribution: AIX 4.3 RH 7,8,9 / Fedora C1/
Posts: 187

Rep: Reputation: 30
can you post a sample of what your Apache logs looked like...that is, the scans and malicious activity?

thanks
 
Old 01-09-2004, 10:45 PM   #7
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Original Poster
Rep: Reputation: 30
Sure. A scan for nimba would look something like this in your error log:

Code:
[Mon Jan  5 05:11:51 2004] [error] [client 24.2.175.163] File does not exist: /scripts/root.exe
[Mon Jan  5 05:11:52 2004] [error] [client 24.2.175.163] File does not exist: MSADC/root.exe
[Mon Jan  5 05:11:52 2004] [error] [client 24.2.175.163] File does not exist: /c/winnt/system32/cmd.exe
[Mon Jan  5 05:11:53 2004] [error] [client 24.2.175.163] File does not exist: /d/winnt/system32/cmd.exe
[Mon Jan  5 05:11:53 2004] [error] [client 24.2.175.163] File does not exist: /scripts/..%5c../winnt/system32/cmd.exe
[Mon Jan  5 05:11:54 2004] [error] [client 24.2.175.163] File does not exist: /_vti_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe
[Mon Jan  5 05:11:55 2004] [error] [client 24.2.175.163] File does not exist: /_mem_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe
[Mon Jan  5 05:11:55 2004] [error] [client 24.2.175.163] File does not exist: /msadc/..%5c../..%5c../..%5c/..Á../..Á../..Á../winnt/system32/cmd.exe
[Mon Jan  5 05:11:56 2004] [error] [client 24.2.175.163] File does not exist: /scripts/..Á../winnt/system32/cmd.exe
[Mon Jan  5 05:11:57 2004] [error] [client 24.2.175.163] File does not exist: /scripts/..À¯../winnt/system32/cmd.exe
[Mon Jan  5 05:11:57 2004] [error] [client 24.2.175.163] File does not exist: /scripts/..Áœ../winnt/system32/cmd.exe
[Mon Jan  5 05:11:59 2004] [error] [client 24.2.175.163] File does not exist: /scripts/..%5c../winnt/system32/cmd.exe
[Mon Jan  5 05:12:00 2004] [error] [client 24.2.175.163] File does not exist: /scripts/..%2f../winnt/system32/cmd.exe
Also other weird trafic shows up in the logs, sucha connections to ports like 1.3.3.7, attempts to use the server as a proxy, long urls.
You kind of can tell if something is seriously probing, the thousands of GET request from nikto are fairly easy to find if someone isn't using evasion detection.
 
Old 01-10-2004, 01:00 AM   #8
katmai90210
Member
 
Registered: Nov 2003
Location: Romania
Distribution: Redhat Linux , Fedora & SuSe
Posts: 46

Rep: Reputation: 15
well i get all sort of scans on my server as well every day ... but as i said ... if you keep your software up2 date no need to worry ... i am currently running httpd2.0.48 with php4.3.4 , proftpd 1.2.9 mysql 4.0.17 and openssh 3.7.p2 ... all i need now is to make it stealth ...
 
Old 01-10-2004, 02:29 PM   #9
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Keeping your software updated is by no means the only step you should take in securing your box. Proper firewalling/access control, turning off un-needed services, setiing up a NIDS, and installing a file integrity scanner are all equally important steps in locking down your system.
 
Old 01-10-2004, 05:25 PM   #10
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Original Poster
Rep: Reputation: 30
Also, make sure that all services are configured properly, especially ones that are available from the internet.
 
Old 01-10-2004, 06:26 PM   #11
katmai90210
Member
 
Registered: Nov 2003
Location: Romania
Distribution: Redhat Linux , Fedora & SuSe
Posts: 46

Rep: Reputation: 15
setiing up a NIDS, and installing a file integrity scanner cpt caveman could u tell me more about those 2 things ??
 
Old 01-10-2004, 08:07 PM   #12
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
NIDS is an acronym for Network Intrusions Detection System. These are programs that analyze network traffic in order to detect port scans, attacks and other malicious traffic. In most cases they are simply rule-based and attempt to match traffic to what those rules define as being "bad traffic". They are extremely helpfull in alerting you to the scans and probes that often preceed an attack or system compromse. Some even allow you to dynamically block traffic from a remote host if it detects malicious traffic. I've also seen (but never used) some NIDS which can do dynamic learning of what is "normal" traffic and then alert you when it detects something it considers abnormal (i.e. one of your hosts mysteriously sprouts a FTP server and starts producing Mb of traffic at 2am). There are lots available, with varying amounts of complexity, but some of the more common ones are Snort, and PortSentry.

A file integrity scanner is a piece of software which essentially detects changes in your filesystem. Of course you change your file system just by booting your system, but one best ways to detect compromise is to look for filesystem changes that indicate a rootkit has been installed and your system commands have been replaced with hacked versions that are designed to hide files that a cracker has placed on your system. That's actually how the compromises of Debian, Gentoo, and the FSF servers were discovered and the as of then unknown do_brk() exploit was identified. Usually a file integrity scanner functions by going through your entire system and making a hash of each file which it then enters into an encrypted database. When it performs a scan, it does the same thing but then compares the hash of each file to the hash in the database. Some include the file permisions and alteration dates in the hash as well. There are also a bunch of these available as well: tripwire, AIDE, AFICK, Samhain, etc.

The Security Refernces thread has link to most of those tools as well as more comprehensive docs as well :
http://www.linuxquestions.org/questi...threadid=45261
 
Old 01-11-2004, 10:18 PM   #13
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Quote:
Originally posted by katmai90210
well i get all sort of scans on my server as well every day ... but as i said ... if you keep your software up2 date no need to worry ... i am currently running httpd2.0.48 with php4.3.4 , proftpd 1.2.9 mysql 4.0.17 and openssh 3.7.p2 ... all i need now is to make it stealth ...
Is that a publicly accessible webserver? If yes, then attempting to "stealth" a publicly accessible server is like camoflaging the fort to blend into the mountain yet painting the front gate hot pink. Running publicly accessible services on your computer makes your server visible on the network.
 
Old 01-11-2004, 10:52 PM   #14
zepplin611
Member
 
Registered: Jan 2004
Distribution: AIX 4.3 RH 7,8,9 / Fedora C1/
Posts: 187

Rep: Reputation: 30
Inexactitude -- > where on the machine (directory and file name) did you find this error?

thanks!
 
Old 01-11-2004, 11:09 PM   #15
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Original Poster
Rep: Reputation: 30
It's in the /var/log/httpd-error.log. Also, you can see who is accessing the server with /var/log/httpd-access.log.
 
  


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
expected unqualified id Shwetha GS Linux - Software 0 10-21-2005 09:42 AM
how to change Seeing this instead of the website you expected nuurul_basar Linux - General 2 07-27-2005 10:27 PM
Is it worth posting lame hack attempts? Tuttle Linux - Security 2 04-23-2005 08:09 AM
I never expected such a reply velan Debian 6 05-25-2004 05:16 PM
Fluxbox...not quite what I had expected HoosTrax Linux - Software 12 02-17-2004 11:49 PM

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

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