Fingerprinting Port 80 Attacks 147
pg writes "I found an interesting article on www.cgisecurity.com that explains
common fingerprints in web server, and web application attacks. It goes to describe how to detect most known, and unknown attacks.
This may come in handy when trying to detect another internet worm."
It makes me angry (Score:2, Interesting)
Re:It makes me angry (Score:2, Informative)
It's not at all about the security of the server itself.
Re:It makes me angry (Score:1)
Re:It makes me angry (Score:1)
And it's the same with "manual" intrusions: the biggest problem are not the very few competent black hats, it's the hordes of script kiddies, and those do use mostly older attacks and try out every exploit they know one after another.
Besides, a main point of fingerprinting is attempting to find common elements that will be present even in currently unknown attack forms.
Re:It makes me angry (Score:2, Interesting)
Re:It makes me angry (Score:1)
Re:It makes me angry (Score:1)
Re:Well, it's not like you did anything. (Score:1)
AFTER THE FACT (Score:1)
Ok, sooooo, maybe we can enlist the aid of The Great Carnac? I'm not certain the writers of worms and perpetrators of DoS attacks are leaving their plans, hermetically sealed, on Funk and Wagnell's front porch.
Part of fighting an attack is certainly building a more attack resistant mechanism, but keep in mind that the ingenuity of the perpetrators is eventually their undoing, as attacks will have to become more and more sophisticated (except where gaping holes like those in a certain monopolies products are left in througn lack of ordinary foresight) as many aspects of the internet, as well as operating systems and applications get stronger.
Re:AFTER THE FACT (Score:1)
Re:AFTER THE FACT (Score:1)
What irony! (Score:5, Funny)
Re:What irony! (Score:2, Informative)
Hmmmm... (Score:1)
I don't see much more room for advanced technology there.
Is it possible to protect the web? (Score:1)
Re:Is it possible to protect the web? (Score:1)
while true; do press 'submit' button; done
can they stand it? No, well
One thing missed (Score:5, Insightful)
Re:One thing missed (Score:2)
152.163.160.44 - - [05/Nov/2001:14:50:00 -0500] "GET
152.163.160.44 - - [05/Nov/2001:14:50:00 -0500] "GET
152.163.160.44 - - [05/Nov/2001:14:50:00 -0500] "GET
Re:One thing missed (Score:2)
Re:One thing missed (Score:3, Informative)
Re:One thing missed (Score:1)
Re:One thing missed (Score:2)
Mine are from teh exact same address. Is this an AOL proxy used by AOL users, or can I safely firewall that address to deny access?
Re:One thing missed (Score:2)
For instance in my current logs, the only legitimate traffic from AOL addresses comes from
spider-mtc-tg014.proxy.aol.com and
spider-mtc-tk043.proxy.aol.com and
spider-mtc-tb054.proxy.aol.com.
Re:One thing missed (Score:2)
ACA19CF3.ipt.aol.com and
AC8D6E32.ipt.aol.com
I believe these are people who aren't using the default AOL browser, though.
incomplete document (Score:4, Informative)
Remember, these documenst are written to help server administrators get an idea of what to look out for, not to solve every single port 80 problem out there.
Re:incomplete document (Score:3, Informative)
While fingerprinting an OS is certainly a useful thing, we shouldn't confuse it with a fingerpinting and profiling effort aimed at categorizing and identifying buffer overrun and similar exploits aimed at web servers. Automated run-time detection of these attempts can lead to faster detection and elimination of threats. In addition, this is a passive measure, whereas nmap is an active measure.
Informative? (Score:1)
Nor does yours.
This discussion is about fingerprinting exploits. The article you reference discusses fingerprinting servers. Big difference.
Fingerprinting, CGI & Web Security (Score:3, Interesting)
By the same token, most well-written CGIs will block these sorts of attacks (and hopefully if you are writing CGIs you will have enough knowledge (and common sense) to write them in a reasonably secure manner).
At the least it's worth a quick five-minute scan.
hax0r bait... (Score:1)
set up a cgi program that fakes being a vulnerable system just to see what sort of attacks you get... call it 'perl', 'sh', or something especially enticing... and set up a fake file system for the hacker to explore, fake log files for them to modify, etc
this would be kind of like writing a text adventure game. you could put several fake encrypted files that are just random strings of characters..
Fingerprint Database (Score:5, Interesting)
Every hour or so, a web server could access a central fingerprint server and download what the latest exploits look like. If a exploit comes in, the server could deny that IP, or drop those accesses without needing to know what the particular exploit is. A self maintaining web server via the web.
What do you think?
Re:Fingerprint Database (Score:5, Interesting)
It's a good idea, but there's a problem when you create a central point of failure.
Re:Fingerprint Database (Score:2)
Re:Fingerprint Database (Score:1)
Next?
Re:Fingerprint Database (Score:1, Interesting)
Re:Fingerprint Database (Score:3, Insightful)
Then we could couple it with my favorite idea for an Apache module: mod_labrea. This way any 'undesirable' HTTP exploit could be given a reverse DoS by keeping the connections alive and stalled for as long as possible.
Re:Fingerprint Database (Score:1)
I had the same idea a while back myself.. but I myself wouldn't dare hassle with it. Perhaps there is some brave soul out there with the time and resources to fend off the countless attacks.
My $.02
portblocker (Score:2, Informative)
Re:portblocker (Score:2)
or you could just install ZoneAlarm (i.e. blocks all ports in & outbound), which is a proper firewall (and also free).
PS. Yes I know there are better firewalls around (e.g. smoothwall) but ZA does the job for simple windows boxes, IMHO the best of the "personal" firewalls.
Re:portblocker (Score:1)
Garbage requests (Score:3, Redundant)
Yes, I know I could grep 'em out while viewing, but I think garbage should be kept in a separate place to the real visitors' log entries.
Re:Garbage requests (Score:3, Informative)
What i do, is setup virtual hosts on apache, with my domain name pointing at the real website, and my numeric IP pointed at just a blank page, and have them log to seperate files. Since MOST attacks come randomly via numeric IP, and MOST real users come in using the domain name.
Re:Garbage requests (Score:1)
Re:Garbage requests (Score:2)
Re:Garbage requests, me too (Score:2)
I would go one step further. I would like an apache module that can recognize requests for certain resources, like
/scripts/root.exe?/c+dir
/c/winnt/system32/cmd.exe?/c+dir
/scripts/..%c0%af../winnt/system32/
etc.
and then just add that ip immediately to 127.0.0.1 without writing anything to access or error logs.
... as long as we're wishing...
Partial solution for log trash (Score:5, Informative)
SetEnvIf Request_URI "cmd\.exe" ATTACK /www/logs/access_log
common env=!ATTACK
/www/logs/attack_log common env=ATTACK
SetEnvIf Request_URI "root\.exe" ATTACK
CustomLog
CustomLog
<Location />
Order Allow,Deny
Allow from all
Deny from env=ATTACK
ErrorDocument 403 "
</Location>
And then optionally for individual bad directories:
<Location /scripts/>
Deny from all
ErrorDocument 403 "
</Location>
At this point requests for cgi.exe are not being logged in access_log but only attack_log (leave out the attack_log line if you don't want even that much). They'll still show in error_log (but with a shorter error statement). The ErrorDocument line instructs Apache to send back nothing and just drop the connection - not as nasty as a tar pit, but at least you don't waste outgoing bandwidth, generally tighter than incoming for a Webserver. Also, Apache doesn't waste any time checking the file system on these requests, since the rules preclude that.
Re:Partial solution for log trash (Score:2)
CustomLog
If you want to avoid a "client denied by server configuration" message in your error_log. I also added SetEnvIf rules for "WINNT" and "system32" for some extra paranoia.
Other than those minor modifications, your config changes are supurb! I just added it to my web server and it took less than 30 seconds for the new rules to be triggered. Works like a charm. Thanks a lot
Re:Partial solution for log trash (Score:1)
Looks good and a TFTP/FTP Question. (Score:3, Interesting)
I do have a question for my fellow slashdotters: Why does the author single out TFTP but not FTP? Does TFTP have inherrent weaknesses that would make it the file transfer protocol of choice for an attacker?
Re:Looks good and a TFTP/FTP Question. (Score:1)
Re:Looks good and a TFTP/FTP Question. (Score:3, Informative)
All it requires is a misconfiguration on the TFTP server, and you'll be able to fetch and overwrite any file anywhere on the filesystem; I've seen this happen in the real world from time to time.
Thanks and (yet another) question (Score:1)
I was wondering if you could block the port on TFTP, thus locking it out entirely, so I dug out my copy of Stevens, Volume I and skimmed the chapter on TFTP. The thing is, I see no mention of a port at all in this chapter. Am I just missing it or are ports a TCP concept (while TFTP runs UDP/IP)? Regardless of that, though, how do you defend against the use of TFTP in this manner?
Thanks again.
Answers. (Score:3, Informative)
It runs on udp port 69.
And, you hit the nail on the head.. embedded systems.
tftp is 'trivial' so it can be used for bootstrapping systems. The protocol is as simple as it could possibly be (but not fast nor efficient network wise).
It was designed so it could be implemented with very little code in order to bootstrap systems.
Given that.. it really has no reason to be enabled at all in most modern systems.
The only uses I've used it for recently are:
booting diskless clients
cisco router configuration files
embeded systems work
Re:Thanks and (yet another) question (Score:1)
type C:\WINNT\system32\drivers\etc\services | find "tftp"
Snort (Score:5, Informative)
Not very interesting (Score:4, Informative)
This paper includes very loose regex heuristics for requests that "might be" attacks. These may be interesting for anomaly detection, when coupled with an engine that records incidence rate (if you see an exponential surge in 'weird' requests, then maybe you're seeing a worm's infection growth curve ).
But the result of deploying these (say, matching for "%20" in a URI) as intrusion detection system rules would be a high false positive rate.
You would be better off looking at arachNIDS [whitehats.com] for rules that are more specific and less likely to drown you in alerts.Re:Not very interesting (Score:2, Informative)
From the article:
""%20" Requests
This is the hex value of a blank space. While this doesn't mean youre being exploited, it is
something you may want to look for in your logs. Some web applications you run may use these
characters in valid requests, so check your logs carefully. On the other hand, this request
is occasionally used to help execute commands."
What's your beef?
Re:Not very interesting (Score:1)
Re:Not very interesting (Score:1)
Great article for web server admins (Score:2)
Re:Great article for web server admins (Score:1)
So what do you do after.. (Score:1)
200 OK (Score:2)
GET /cgi-bin/phf?Jserver=a&Qalias=a%0Acat%20/etc/passw d HTTP/1.0
Re:Securing webservers (Score:3, Informative)
If you're really paranoid, you also shouldn't let your web server send any outgoing SYN packets from port 80. This will help prevent web-exploit worms like Code Red and Nimda from spreading.
Re:Securing webservers (Score:2)
Especially since I didn't mention the other effect of blocking outbound port 80 SYN packets. "No pr0n surfing from the web server console! Now get back to work!" (And yes, I do frequent The Monastery, how did you know?)
Re:Securing webservers (Score:1)
The important part is to carefully decide what kinds of communications you'll allow in and out... regardless of port. For instance, you may want to be able to FTP out, but not in.
suffix mapping (Score:2)
I did a worm blocker (Score:2, Interesting)
Based on the activity I detected I set the software up to look for a GET using any of the following substrings: SCRIPTS MSADC WINNT ADMIN.DLL _VTI_BIN and _MEM_BIN. If found then the requestor's IP address got added to a list. Anytime the TCP stack saw a SYN request from one of these addresses it just ignored it instead of starting the handshake. So far it has blocked 75 IP addresses and my log files are now pretty pristine.
Re:I did a worm blocker (Score:1)
_vti_bin is used by frontpage when it connects to the web server to edit. So is admin.dll.
Scripts is used by Interdev; a lot of the code that the design time controls and scriplets depend on is in there
_mem_bin is Site Server 3.0's membership files. If you've written your own login / error handling code for this, then you should DEFINITELY block access to it. Problem is, you can't just delete the folder; even when you write your own code, it still needs access to this folder.
Argh. Don't you love Windows?
Most are arguments for good sandboxes (Score:2)
Forgot & (Score:1)
URLSCAN (Score:2, Informative)
Re:URLSCAN (Score:1)
Good news is, it didn't start IIS despite the fact it was disabled in my services applet.
kewl. Thanks for the link - I'll dabble about with it when I have time.
Re:URLSCAN (Score:1)
Re:URLSCAN (Score:1)
Re: Port 80 scans (Score:1)
My two bits
Freshmeat.net is a good resource. (Score:3, Interesting)
I forget off the top of my head if portsentry has scriptable events, if it does then the possibility of having a "guarddog" type box would be interesting.
For instance, if attack is detected portsentry and it does its thing by putting the offending adderss in
Nothing beats calling up an ISP and saying "you have a windows/linux/whatever box probing for webservers/mailservers/(insert service) and is attempting to execute a vulnerability of that service".
Nmap and Nbtscan are excellent utilities, but from using them and playing around, nmap is more of a discovery tool, nbtscan is more of a retalitory tool. Or, at the very least they both can be used as such.
I know from personal experience that nbtscan's default setting (normal, aggressive, insane) is enough to knock a box off of a network.
I scanned my cable modem...had to power down to get back up and knocked my boss off even with his knowledge...only a complete power down would bring the box back on the network.
If you can have a "honeypot" why not a "watchdog" box for computer security?
Has the "security/watchdog" been done before?
Re:Freshmeat.net is a good resource. (Score:1)
Actually, one thing does beat that: when you call the ISP's tech support to report it, the person on the other end of the line asks you, "What's probing? What's a web server? What's Linux? These aren't on my script? Have you rebooted your cable modem?"
Sorry, was channelling a little bit of tech support rage. I feel much better now :)
Re:Freshmeat.net is a good resource. (Score:2)
Re:Freshmeat.net is a good resource. (Score:1)
Nothing beats finding a system like that and then "attacking" it by hitting it with spoofed packets pretending to be an attack, lets see how long it'd stand up to a) the load and b) the fact that it is blackholeing itself from all those fake IP addresses
Good article (Score:1)
Realistically. (Score:2)
Sure, more information is better.. but.. I'm just not at risk.
You make your servers secure, and then you forget about it. You keep on top of new vulnerabilities.... but seriously folks.
Why should I care one bit whether some code-red worm tried to exploit apache thinking it was IIS? I'm immune, it's not relevant to me.
Now.. knowing what goes on in a network in general, yes, that's important. Run snort or something.. keep an eye on traffic coming in/out of your net
But get real. There are better, more productive things to spend time on.
Re:Realistically. (Score:1)
Re:Realistically. (Score:2)
Even though you are immune to infection, it doesn't mean you don't have anything to worry about. If you are just admining a single home-based hobby server, you probably don't have anything else to worry about. But suppose you admin a unix machine in a big business; you run Samba so you can share files between your Unix box and all those M$ boxen that are somebody else's problem. If one of those M$ boxen gets compromised, now you DO have a problem, especially if you are using DOMAIN security and the PDC is the one that got hit. Even if the windoze boxen are not your responsibility, they can still impact you.
Even if you only have one box hanging off a cable modem, IIS-specific attacks SHOULD worry you. Just because a potential attacker is being clueless now doesn't mean he won't develop a clue later. If you see a bunch of suspicious activity coming from an address, you should definately be paying more attention to anything else that comes from that address in the future. The fact that it's infected with a worm is an indication that it's not being administered properly. Some clueful hacker could take that infected system and use it as a jumping off point to do somthing that COULD hurt you.
Snort (Score:2, Informative)
What to do after attack? (Score:4, Informative)
Slight problem of Trust (Score:1)
cat access_log| grep -i ".."
will find anything useful in the log? And why -i ???
Nice, but... (Score:1, Interesting)
Say user Foo runs cgi-scanner X against one system, without proper fingerprinting (as most lame script kiddies dont do), most scans will trigger an error because apache doesn't come with a
Apart from that, most network/security people should read the article; this is basic intrusion detection skills that should be mastered by you people, that include those apes (and that's an insult to primates!) who have those lame ass certifications.