View previous topic :: View next topic |
Author |
Message |
jimlynch11 Guru
Joined: 21 Feb 2003 Posts: 590 Location: massachusetts
|
Posted: Mon Jun 16, 2003 1:15 pm Post subject: someone trying to hack my box? |
|
|
ok so it appears that someone is trying to hack my apache server, based on the logs. it also appears they are under the assumption that i have a NT based machine (suckers). here is a quick quote of what iv found:
Quote: |
24.189.230.118 - - [16/Jun/2003:01:08:43 -0400] "GET /scripts/root.exe?/c+dir HTTP/1.0" 404 274 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:43 -0400] "GET /MSADC/root.exe?/c+dir HTTP/1.0" 404 272 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:43 -0400] "GET /c/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 282 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:43 -0400] "GET /d/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 282 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:43 -0400] "GET /scripts/..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 296 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /_vti_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 313 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /_mem_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 313 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /msadc/..%255c../..%255c../..%255c/..%c1%1c../..%c1%1c../..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 329 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 295 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /scripts/..%c0%2f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 295 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 295 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:44 -0400] "GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 295 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:45 -0400] "GET /scripts/..%%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 279 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:45 -0400] "GET /scripts/..%%35c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 279 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:45 -0400] "GET /scripts/..%25%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 296 "-" "-"
24.189.230.118 - - [16/Jun/2003:01:08:45 -0400] "GET /scripts/..%252f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 296 "-" "-"
|
this occurs a few times in the logs, from a few different IP addresses. luckily it doesnt appear they have had much success. .bash_history doesnt have anything suspicious in it for root
Three questions:
1) how do i make sure that they havent gotten access
2) other than reporting them to their ISP, how do i let them know to watch out (i.e. a script that will block all connections from their IP or something)
3) any quick ways to tighten up my box? (iv only got the http and sshd ports open on my firewall
thanks for the help guys
Last edited by jimlynch11 on Mon Jun 16, 2003 1:24 pm; edited 1 time in total |
|
Back to top |
|
|
EvilN n00b
Joined: 13 Feb 2003 Posts: 47 Location: Stockholm, Sweden
|
Posted: Mon Jun 16, 2003 1:23 pm Post subject: |
|
|
Yes and no.
These seems to be worms form people who cant seem to realize the importance of keeping their machines up to date.
Their webservers are infected with worms that try to infect other machines.
Since you are running apache I think you are in the clear but it could be a good idea to check their site for security holes in you release of apache. _________________ Juniper Networks Certified Internet Associate
JNCIA-M #0090 |
|
Back to top |
|
|
dolbz Tux's lil' helper
Joined: 29 Mar 2003 Posts: 138 Location: Nuneaton,UK
|
Posted: Mon Jun 16, 2003 1:28 pm Post subject: |
|
|
well. First off notice that these are all windows based commands. i.e. cmd.exe is to access the windows dos prompt and people who have misconfigured iis could have this available. Therefore for entries like this in your logs you've got nothing to worry about as they are windows exploits. And if they aren't even clever enough to check what server you're running by trying to get a error 404 (assuming you're server shows the standard apache error message) then they're not gonna be able to do much damage to be honest.
As for blocking their IP it might not be the best idea if it's dynamically assigned because soemone else will end up with it, although it wont harm anyone unless they want to view your site. I dont know IP tables but it can be configured to deny access for specific IP addresses as far as I know.
As for quick tips for securing your box. just disable any server options you dont need and if anyone ever does get in you'll learn from your mistake (if you made one) lol
Dolbz |
|
Back to top |
|
|
paranode l33t
Joined: 06 Mar 2003 Posts: 679 Location: Texas
|
Posted: Mon Jun 16, 2003 1:43 pm Post subject: |
|
|
I get dozens of these a day. It's just something you have to put up with when you run a publicly-available web server. The Gentoo Linux Security Guide has some good pointers on how best to secure your machine in case it was somehow vulnerable to a new worm or exploit. _________________ Meh. |
|
Back to top |
|
|
DrkPlague Tux's lil' helper
Joined: 04 Jun 2003 Posts: 107
|
Posted: Mon Jun 16, 2003 3:46 pm Post subject: |
|
|
in the security groups, we call this background radiation. its when you start seeing multiple sweeps from the SAME IP that there is an issue. _________________ DKP
There are 10 kinds of people in the world:
Those who understand binary and those who don't... |
|
Back to top |
|
|
jimlynch11 Guru
Joined: 21 Feb 2003 Posts: 590 Location: massachusetts
|
Posted: Mon Jun 16, 2003 3:50 pm Post subject: |
|
|
DrkPlague wrote: | its when you start seeing multiple sweeps from the SAME IP that there is an issue. |
thats pretty much what is happening...iv had like 10 or so of the same attempts by 3 IPs |
|
Back to top |
|
|
uzik Apprentice
Joined: 17 Apr 2003 Posts: 257
|
Posted: Mon Jun 16, 2003 6:28 pm Post subject: |
|
|
EvilN wrote: | Yes and no.
These seems to be worms form people who cant seem to realize the importance of keeping their machines up to date.
|
Being up to date and being free of virii aren't necessarily synonymous.
A lot of times it's a matter of removing stuff you don't use, getting a
firewall setup right, and chosing the right software for the job you want
to do. If they were smart they probably would be running Gentoo and they
wouldn't have so many problems
EvilN wrote: |
Their webservers are infected with worms that try to infect other machines.
Since you are running apache I think you are in the clear but it could be a good idea to check their site for security holes in you release of apache. |
Apache has some vulns too, just not those vulns. |
|
Back to top |
|
|
Deathwing00 Bodhisattva
Joined: 13 Jun 2003 Posts: 4087 Location: Dresden, Germany
|
Posted: Mon Jun 16, 2003 6:48 pm Post subject: |
|
|
I also had lots of those kind of worm attacks everyday... it seems the ones that have the infected servers have knowledge of it and still do nothing. Perhaps they are VIRII and want to use this type of methods in order to propagate worms... |
|
Back to top |
|
|
dolbz Tux's lil' helper
Joined: 29 Mar 2003 Posts: 138 Location: Nuneaton,UK
|
Posted: Mon Jun 16, 2003 8:41 pm Post subject: |
|
|
DrkPlague wrote: | in the security groups, we call this background radiation. its when you start seeing multiple sweeps from the SAME IP that there is an issue. |
I like the analogy of background radiation very clever really. I'll remember that
Dolbz |
|
Back to top |
|
|
kleppari n00b
Joined: 08 Jun 2003 Posts: 2 Location: Akranes, Iceland
|
Posted: Tue Jun 17, 2003 1:48 am Post subject: |
|
|
Most people here are hackers, there's a big diffrence between a hacker and a cracker (Check the Jargon file)
But, that's probably some kind of a worm, nimda or something... _________________ Regards, kleppari.
The way humans perceive beauty is intimately related to our ability to process and understand complexity. |
|
Back to top |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Tue Jun 17, 2003 5:46 am Post subject: |
|
|
DrkPlague wrote: | in the security groups, we call this background radiation. its when you start seeing multiple sweeps from the SAME IP that there is an issue. |
haha - 'background radiation' really good
hmm - does one of u know portsentry - i dont use it anymore but watching the apache logs in a similar fashion would be interesting to sort the guys out that are a little bit too nosey - does someone know a tool like this - i have to admit that i'm too lazy to check manually or to write a script... _________________ To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be. |
|
Back to top |
|
|
EvilN n00b
Joined: 13 Feb 2003 Posts: 47 Location: Stockholm, Sweden
|
Posted: Tue Jun 17, 2003 6:55 am Post subject: |
|
|
slartibartfasz wrote: | DrkPlague wrote: | in the security groups, we call this background radiation. its when you start seeing multiple sweeps from the SAME IP that there is an issue. |
haha - 'background radiation' really good
hmm - does one of u know portsentry - i dont use it anymore but watching the apache logs in a similar fashion would be interesting to sort the guys out that are a little bit too nosey - does someone know a tool like this - i have to admit that i'm too lazy to check manually or to write a script... |
Didn't port sentry just add the IP of the port scanner to hosts.deny?
THat would only lock out useers from services run from inetd and not daemons right? _________________ Juniper Networks Certified Internet Associate
JNCIA-M #0090 |
|
Back to top |
|
|
DrkPlague Tux's lil' helper
Joined: 04 Jun 2003 Posts: 107
|
Posted: Tue Jun 17, 2003 7:04 am Post subject: |
|
|
slartibartfasz wrote: |
hmm - does one of u know portsentry - i dont use it anymore but watching the apache logs in a similar fashion would be interesting to sort the guys out that are a little bit too nosey - does someone know a tool like this - i have to admit that i'm too lazy to check manually or to write a script... |
Snort. either find a good ruleset or merge a couple together to get a set that will alert you to heavy probing but ignore "lighter" passes. _________________ DKP
There are 10 kinds of people in the world:
Those who understand binary and those who don't... |
|
Back to top |
|
|
Koon Retired Dev
Joined: 10 Dec 2002 Posts: 518
|
Posted: Tue Jun 17, 2003 7:23 am Post subject: |
|
|
jimlynch11 wrote: | thats pretty much what is happening...iv had like 10 or so of the same attempts by 3 IPs |
I got the same probes here (with the same URLs in the same order), everyone does. Noone will really try to hack you unless you respond positively to these automatic probes. And since you don't run an unpatched Windows setup you will not be noticed.
But if you run unpatched Windows NT 4 with IIS you *will* automatically get infected, although noone really wanted to hack you and probably noone is still listening to the probes return anymore.
-K |
|
Back to top |
|
|
Forse Apprentice
Joined: 26 Dec 2002 Posts: 260 Location: /dev/random
|
|
Back to top |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Tue Jun 17, 2003 2:07 pm Post subject: |
|
|
EvilN wrote: | Didn't port sentry just add the IP of the port scanner to hosts.deny?
THat would only lock out useers from services run from inetd and not daemons right? |
right - thats why i dont use it anymore - i'd like something similar in the way it dedected an attack - the response would be something different of course: mail, iptables, whatever...
[quote=DrkPlague]Snort. either find a good ruleset or merge a couple together to get a set that will alert you to heavy probing but ignore "lighter" passes.[/quote]
thx - good idea - i'll try that... _________________ To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be. |
|
Back to top |
|
|
Zu` l33t
Joined: 26 May 2002 Posts: 716 Location: BE
|
Posted: Tue Jun 17, 2003 2:40 pm Post subject: |
|
|
slartibartfasz wrote: |
right - thats why i dont use it anymore - i'd like something similar in the way it dedected an attack - the response would be something different of course: mail, iptables, whatever... |
Here's a very efficient solution, however OpenBSD-specific:
http://www.benzedrine.cx/pf/msg01273.html
Unless you actually happen to run OpenBSD, this might perhaps serve as inspiration for some script you could possibly put together that works with iptables.
I don't know enough about iptables to know if this is possible though.
Hope this is helpful. _________________ No growth without resistance.
No action without reaction.
No desire without restraint. |
|
Back to top |
|
|
EvilN n00b
Joined: 13 Feb 2003 Posts: 47 Location: Stockholm, Sweden
|
Posted: Tue Jun 17, 2003 5:32 pm Post subject: |
|
|
Niiiiice, why didnt I think of that! Too simple!
Thanks for the tip.
And of course, I am running OpenBSD on all my firewalls. _________________ Juniper Networks Certified Internet Associate
JNCIA-M #0090 |
|
Back to top |
|
|
wyvern Tux's lil' helper
Joined: 04 Apr 2003 Posts: 99 Location: Victoria, B.C.
|
Posted: Tue Jun 17, 2003 10:01 pm Post subject: |
|
|
Quote: | Unless you actually happen to run OpenBSD, this might perhaps serve as inspiration for some script you could possibly put together that works with iptables.
I don't know enough about iptables to know if this is possible though. |
It's definitely possible with iptables, as new rules can be added on the fly. I like this solution.
_________________ ---
ex nihilo nihil fit |
|
Back to top |
|
|
uzik Apprentice
Joined: 17 Apr 2003 Posts: 257
|
Posted: Wed Jun 18, 2003 1:44 am Post subject: |
|
|
Good idea. I don't have lynx on my box (that's the text only web browser
right?), but since wget is standard for all gentoo's I might try to update
this to use wget. |
|
Back to top |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Wed Jun 18, 2003 3:49 am Post subject: |
|
|
this looks very nice - does anyone know of a pf linux port? (dont have a dedicated firewall box) _________________ To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be. |
|
Back to top |
|
|
uzik Apprentice
Joined: 17 Apr 2003 Posts: 257
|
Posted: Sun Jun 22, 2003 6:40 pm Post subject: |
|
|
I just finished up a shell script that works with iptables to ban badly
behaved robots that access the web site. (Those that ignore the robots.txt
file specifically).
It uses iptables, bash, and a lot of the basic text handling stuff from
the command line ( grep, cut, etc.). If you're interested email me
and I'll share it with you. uzik @ reddawn.net |
|
Back to top |
|
|
tgoodaire Tux's lil' helper
Joined: 31 Jan 2003 Posts: 145 Location: Dartmouth, Nova Scotia, Canada
|
Posted: Mon Jun 23, 2003 3:55 pm Post subject: |
|
|
I wrote a little perl script that checks my apache logs for references to cmd.exe and default.ida. It then sees if the ip address is in /etc/firewall/blocked, and adds it if it's not already there. Then it restarts my firewall which blocks all ips in /etc/firewall/blocked. Works for me.
Also, portsentry has an option to run a command when it encounters a problem (can't remember what the option was called, but it's in the config file). If you wanted, you could have it add an iptables rule to block ips, or email you the output of "tail -n 20 /var/log/syslog", or whatever. _________________ I bent my wookie. |
|
Back to top |
|
|
uzik Apprentice
Joined: 17 Apr 2003 Posts: 257
|
Posted: Mon Jun 23, 2003 11:09 pm Post subject: |
|
|
LOL! I was just finishing up that script when I noticed your message.
I used wget to pop up a message on their box telling them it was
infected. I figure one message every half an hour should work |
|
Back to top |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Tue Jun 24, 2003 5:15 am Post subject: |
|
|
uzik wrote: | I figure one message every half an hour should work |
hehe - not if it is one of those freelance servers, where the admin takes a look at the machine every few weeks... the guy will have some fun getting rid of the notifications _________________ To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be. |
|
Back to top |
|
|
|