Author |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Wed 03 Feb '16 11:29 Post subject: Unknown apache2.4 access log |
|
|
I have installed apache server and i found my access log is not showing something normal. I have search for this error in google and this forum but there are no detail solution on how to fix this problem.
Here is some unknown log :
Code: |
"GET http://www.google.com/?nord=1#nord=1&q=blogesaurus HTTP/1.1" 200 146
"GET http://zc.qq.com/cgi-bin/common/attr?id=260714&r=0.0235660493602285 HTTP/1.1" 404 217
"CONNECT l.yimg.com:80 HTTP/1.1" 200 146
"GET http://www.carljzhou.com/azenv.php HTTP/1.1" 404 207
|
There are many logs like this in my access log.
How to avoid this ? Should I concern/ignore this ? What should i do ?
Many thanks for the help |
|
Back to top |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
Posted: Wed 03 Feb '16 19:49 Post subject: |
|
|
Those messages in your access logs are showing that someone somewhere is poking and prodding your Apache Server looking for clues as to what you have and how they might be able to exploit any vulnerabilities.
As to what to do, make sure that you have "hardened and secured" your Apache Server.
What you can do also, is report these hacking/exploit attempts to ABUSE for the domain and/or ISP they are originating from.
-S |
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
|
Back to top |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
Posted: Tue 16 Feb '16 18:09 Post subject: |
|
|
You want to see that information in your logs. It is informational, letting you know what is going on with your WEB server.
The 404 error is letting you know that the connection attempt was unsuccessful/was not granted.
If you want to stop it completely, you can trace the IP address where the so called connection attempt originated and block it upstream (i.e. at your firewall).
I get log entries like that all the time in my access logs and use configurations in my htttpd.conf to stop them.
Look at it this way, its basically good guys (US) versus the bad guys (THEM). It is a battle that will never end. Just do your best and exercise caution to deter them the best you can. |
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Wed 17 Feb '16 2:18 Post subject: |
|
|
thank you DnvrSysEngr for reply.
what kind of configuration in httpd.conf (directives) should i add to stop these logs?
should i use htaccess for this purpose? |
|
Back to top |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
Posted: Wed 17 Feb '16 3:09 Post subject: |
|
|
I used Mod_ip2location (not sure if Gregg of Steffen has a 32 or 64 bit version readily available) to create a blocklist by country. I placed the entries in my httpd.conf file.
However, you may want to be careful as to how you use it if you are hosting more than one site on your Web server.
You can also use mod_maxmind, which is available at https://www.apachehaus.net/temp/ |
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Wed 17 Feb '16 5:41 Post subject: |
|
|
unfortunately, Mod_ip2location is not free...
thank you DnvrSysEngr. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Wed 17 Feb '16 16:20 Post subject: |
|
|
Thank you glsmith, i will try mod_iplocation lite because i use VC11 Apache 2.4.
Is mod_security able to solve this issue?
Anyone has suggestion about this? I think it's quite frustrating to only avoid these access logs...or should i ignore them? From what i have read, status code of 200,404 and 400 with 200 of size is not a "thread to my server" right?? |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Wed 17 Feb '16 20:13 Post subject: |
|
|
No, mod_security might turn those 200s in your first post into 400s or 403s however.
200 means it was served, I personally like to know what has been viewed and downloaded. For instance I can see that someone from Indonesia looked on my server, came from this forum thread and was using Google Chrome on 32bit Win7. The connection was over the HTTP/2 protocol.
404 is File Not Found, I like to know this as well because there may something I think should be available but through some mistake of mine it is not.
400, 403 & 500 end up in error.log as well so I do not care if they are in the access.log, I do not block them however.
The only thing I block from my access.log is my own hits to my server. When building a site or script I hit it 100s of times to view/debug as I go, I do not need all my hits polluting up the access.log file.
<soapbox>
It's good to keep an eye on your logs. I rotate my access.log daily (mod_log_rotate) and I know what is the usual size of these files an I know that weekend traffic is typically 1/5 to 1/4 of weekdays. If all of a sudden I see a day that is more than 3 times the average size, I know something is going on and I can investigate.
</soapbox>
The question however is how to keep certain requests from being logged. It's pretty easy using SetEnvIf and CustomLog.
See the "Conditional Logs" section at
http://httpd.apache.org/docs/2.4/logs.html#accesslog
I'm pretty sure you can use any of the available environment variables (like HTTP_STATUS). |
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Sat 20 Feb '16 11:58 Post subject: |
|
|
I will try with setenvif and custom log. I hope this might solve my problems.
Thanks... |
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Sat 20 Feb '16 12:21 Post subject: |
|
|
glsmith , i have read your previous post
Code: |
RewriteEngine on
# [Multi-Useragent]
..
..
..
# [HTTP_USER_AGENT]
# ::ELNSB50 EmailHarvesting & GuestbookSpamming
..
..
# Send them home to mama or a dead connection
RewriteRule
|
i write them in my httpd.conf and it gives me error "invalid command 'RewriteEngine' , perhaps misspelled or defined by a module not included in the server configuration"
Do you use .htaccess? |
|
Back to top |
|
andihdr
Joined: 03 Feb 2016 Posts: 8 Location: indonesia
|
Posted: Sat 20 Feb '16 13:20 Post subject: |
|
|
how to RewriteCond for this?
Code: |
"GET http://www.google.com/?nord=1#nord=1&q=blogesaurus HTTP/1.1" 200 146
"GET http://zc.qq.com/cgi-bin/common/attr?id=260714&r=0.0235660493602285 HTTP/1.1" 404 217
"CONNECT l.yimg.com:80 HTTP/1.1" 200 146
"GET http://www.carljzhou.com/azenv.php HTTP/1.1" 404 207
|
|
|
Back to top |
|