egrepping mod_security logs

egrepping mod_security logs

Posted on May 22, 2010 by Paulino Calderon

Today I'd like to share a couple of commands to extract interesting information from your mod_security logs.

Lists user agents ordered by the number of occurrences.

egrep 'User-Agent' modsec_audit.log | sort | uniq -c | sort -rn

Lists all HTTP codes in requests

egrep "^HTTP/" modsec_audit.log | sed  "s/HTTP\/[01].[019] //g" | sort | uniq

Lists referrers and counts occurrences.

egrep 'Referer' modsec_audit.log | sort | uniq -c | sort -rn

And simple variations to see the most attacked scripts.

egrep 'GET' modsec_audit.log | sort | uniq -c | sort -rn
egrep 'POST' modsec_audit.log | sort | uniq -c | sort -rn

Latest Blog Entries

Belkin Wemo Switch NMap Scripts
Belkin Wemo Switch Smart Plug is a network controlled power outlet. The current firmware version does not requiere authentication to switch the power ON or OFF or to gather information such as nearby wireless networks. Two NMap scripts have been published

Downloading an Application's Entire Source Code Through an Exposed GIT Directory
Website administrators sometimes inadvertently leave an exposed .git directory, from which it is possible to download the entire source code of the web application using just wget and a common server misconfiguration.

credmap: The Credential Mapper
An overview of credmap, an open source penetration testing tool that automates the process of testing for credential reuse. It does so by testing supplied user credentials on known websites and verifies if the password has been reused on any of these.

Latest News

Blackhat EU 2015
Websec participated with two tools at the Blackhat, EU Arsenal held in Amsterdam, NL from the 10-13 of November, 2015. During this event, we introduced our brand new tool "credmap: The Credential Mapper" and also presented an amped-up version of Panoptic.

BSides Vancouver 2015
Websec is proud to announce that we will be attending the 3rd annual edition of BSides Vancouver, a local non-profit information security conference held in the heart of Vancouver, BC on March 16 and 17.