LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-17-2009, 12:37 PM   #1
mejohnsn
Member
 
Registered: Sep 2009
Posts: 174

Rep: Reputation: Disabled
Is it an Attack? Or a Very Stupid Robot?


If it is an attack, it looks like a pretty stupid one. But I would really like a second opinion.

The situtation: I have an HTTP Proxy Server set up running Apache under Ubuntu 9.10 (desktop) running behind my home firewall, secured with Digest Authentication. But about once a day, I get lines in the error log that look like this:

Code:
[Thu Dec 17 09:19:26 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/phpmyadmin
[Thu Dec 17 09:19:26 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/pma
[Thu Dec 17 09:19:26 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/admin
[Thu Dec 17 09:19:27 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/dbadmin
[Thu Dec 17 09:19:27 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/mysql
[Thu Dec 17 09:19:27 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/php-my-admin
[Thu Dec 17 09:19:28 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/myadmin
[Thu Dec 17 09:19:29 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/PHPMYADMIN
[Thu Dec 17 09:19:29 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/phpMyAdmin
[Thu Dec 17 09:19:29 2009] [error] [client 85.17.154.200] client denied by server configuration: /var/www/p
The IP address is different each time: sometimes Japan, sometimes not. I haven't even bothered running geolocate on the one above.

I do know, however, that neither of the two authorized users of the proxy did these requests. It looks to me like the culprit doesn't even know that it is a proxy server, not an origin server.

The corresponding lines in access.log are a little more informative, but I still cannot figure out how he even got that far, since I have the following lines in the Main section of my Apache config:

Code:
<Location />
Order deny,allow
Deny from all
</Location>
Before I put in these lines, he was getting "404 not found" on the GETs, now he gets "403 forbidden".

Another reason I am surprised he gets this far: there is no Listen directive on port 80, only on 8080, which is for the proxy.

So here are the above-mentioned corresponding lines in access.log:

Code:
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:25 -0800] "GET //phpmyadmin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 482 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:26 -0800] "GET //pma/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 478 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:26 -0800] "GET //admin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 479 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:27 -0800] "GET //dbadmin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 480 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:27 -0800] "GET //mysql/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 480 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:27 -0800] "GET //php-my-admin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 484 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:28 -0800] "GET //myadmin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 480 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:29 -0800] "GET //PHPMYADMIN/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 484 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:29 -0800] "GET //phpMyAdmin/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 482 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.168.4.100:8080 85.17.154.200 - - [17/Dec/2009:09:19:29 -0800] "GET //p/m/a/config/config.inc.php?p=phpinfo(); HTTP/1.1" 403 479 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
So recapping, my questions are:

1) how was he even able to do these GETs in the first place?
2) is this an attack, or just a very poor robot?
3) how concerned should I be about this? Is it ignorable? I find it hard to take seriously anyone still using Win98

Last edited by mejohnsn; 12-17-2009 at 12:39 PM. Reason: forgot to say what Linux version
 
Old 12-17-2009, 01:34 PM   #2
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 110Reputation: 110
Don't really know much about the log files, but in regards to the Win98 thing, it's possible that they are using wine to run firefox in.
 
0 members found this post helpful.
Old 12-17-2009, 02:07 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
@mejohnsn: Whether it's a targeted attack by a human or a random attack by a bot isn't too important (at least not yet). What you have is someone looking for low hanging fruit. They're hoping to get lucky by landing on a phpMyAdmin installation with poor / improper file permissions so that they can get your data.

FWIW, I see log entries like this daily on many hosts. The best advice I can give is:
  • Run a secure httpd.conf configuration
  • Keep Apache httpd up to date with security fixes
  • If you're running phpMyAdmin, be sure that you have secured it properly
 
Old 12-17-2009, 03:56 PM   #4
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
every webserver in the world is "attacked" in that way, believe me, i'm seeing this everyday. i mean every, having white (internet) IP.
these attacks won't get far if you don't install phpmyadmin(in this case, there are also buggy apps like roundcube that are also being searched) in default or predictable locations on hostname=your_IP or on default hostname. in fact i don't remember seeing same attacks with specified known hostname. if there are, then someone knows it is you and purposefully trying to get your serv.
 
Old 12-17-2009, 06:20 PM   #5
mejohnsn
Member
 
Registered: Sep 2009
Posts: 174

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by anomie View Post
@mejohnsn: Whether it's a targeted attack by a human or a random attack by a bot isn't too important (at least not yet). What you have is someone looking for low hanging fruit. They're hoping to get lucky by landing on a phpMyAdmin installation with poor / improper file permissions so that they can get your data.

FWIW, I see log entries like this daily on many hosts. The best advice I can give is:
  • Run a secure httpd.conf configuration
  • Keep Apache httpd up to date with security fixes
  • If you're running phpMyAdmin, be sure that you have secured it properly
Thanks for the advice and feedback. But this only pushes back the question: what is a 'secure' httpd.conf? I have seen only a few examples on the net, or in books on Apache, there are lots of differences between them; some people seem to think it is 'secure' if it has the "Order allow deny, deny from all" directives I already have.

Why, one Apache tutorial I read incredibly implies that it is secure just for that reason.

As you can tell, I am not convinced. But I also have Digest Authentication, so I would have supposed mine is already pretty secure -- except I thought it should not be responding to those GETs at all, that it should only respond to Proxy requests.
 
Old 12-17-2009, 07:14 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
How about using fail2ban ?
 
Old 12-18-2009, 01:39 AM   #7
mejohnsn
Member
 
Registered: Sep 2009
Posts: 174

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
How about using fail2ban ?
How many realistic attackes does fail2ban protect from? Since you suggested it, I Googled it, and found that all it does is ban a given IP address when it shows up in the logs with failed login attempts.

But there ARE no failed login attempts from this attack -- and it keeps coming in from different IP addresses, so it would have no effect at all.

Now perhaps this suggests something else I should do: I have the Digest password authentication only on the Proxy. I thought I didn't need it on the main server, since 1) There is no Listen directive except for the Proxy and 2) there is nothing to serve back, since I have "Order deny, allow...Deny from all" in the <Location /> context.
 
Old 12-18-2009, 06:40 PM   #8
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
As a starting point for securing Apache web server, read here: http://www.petefreitag.com/item/505.cfm

Many of the suggestions are inspired by the book Apache Security by Ivan Ristic (which I heartily recommend). If fact, I implement several of those as part of a standard Apache deployment. (However, I generally do not mess around with mod_security nor chroot. In your case, mod_security in particular might be worth some further research.)

-------

In any event, are you running a normal proxy (i.e. allowing your internal clients to reach the 'net) or a reverse proxy (which would allow 'net hosts to access one of your internal web servers)? If the former case, you should not be accepting any connections from the outside world at all. That should be locked down at the IP level using a firewall. If the latter case, these sorts of bogus requests are simply going to be a fact of life. Your server is doing the correct thing by replying with an HTTP 403.
 
Old 12-19-2009, 03:59 AM   #9
mejohnsn
Member
 
Registered: Sep 2009
Posts: 174

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by anomie View Post
As a starting point for securing Apache web server, read here: http://www.petefreitag.com/item/505.cfm

Many of the suggestions are inspired by the book Apache Security by Ivan Ristic (which I heartily recommend). If fact, I implement several of those as part of a standard Apache deployment. (However, I generally do not mess around with mod_security nor chroot. In your case, mod_security in particular might be worth some further research.)

-------

In any event, are you running a normal proxy (i.e. allowing your internal clients to reach the 'net) or a reverse proxy (which would allow 'net hosts to access one of your internal web servers)? If the former case, you should not be accepting any connections from the outside world at all. That should be locked down at the IP level using a firewall. If the latter case, these sorts of bogus requests are simply going to be a fact of life. Your server is doing the correct thing by replying with an HTTP 403.
Thanks for the recommendation of the freitag site. It looks pretty good.

As for what kind of proxy, it is definitely abnormal I want it to allow an authenticated user anywhere to access the outside net, and inside the firewall, allow any user from a range of IP addresses -- again accessing outside net.

But thanks for confirming that 403 is the right response. Although today I got a 400 and a 407, the former one from the "toata dragostea mea pentru diavola" spider.

And oh, yes: the passwords for the authenticated users are quite strong.
 
Old 12-19-2009, 08:53 AM   #10
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:53 PM.
 
  


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
recovering "lost" users..... probably stupid question (stupid user.......) bigjohn Linux - Newbie 6 11-07-2009 06:51 PM
LXer: Linux robot site launches with user-controllable robot LXer Syndicated Linux News 0 01-12-2006 02:46 AM
Stupid, stupid question; I lost Klaptop. :( Surfrider Slackware 2 08-31-2005 09:12 PM
Stupid Dumb Stupid Question... drigz Linux - Software 3 09-23-2004 03:09 PM
stupid stupid newb ? what to use instead of xconfigurator h00ligan Fedora 3 01-25-2004 09:51 PM

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

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