Home > Enterprise Desktop Tips > > Identify Web-based attack attempts with Log Parser
Enterprise Desktop Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


Identify Web-based attack attempts with Log Parser


By Serdar Yegulalp
07.25.2005
Rating: -4.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Log Parser is one of the more useful free Web server tools available. It uses SQL-type queries to parse Web server log files, and then returns a report of all entries in the log that match the query. You can use Log Parser to create search queries that look for signatures left by programs that attempt to attack your Web server and execute arbitrary code.

If you're worried about whether or not your system is being attacked, running regular inspections with Log Parser can help you get a handle on what types of attacks are being made and where they're coming from.

Using Log Parser to do this sort of work, as opposed to a general purpose string-search tool (like the UNIX grep command) has several advantages:

  1. The program uses standard SQL querying. If you're already familiar with SQL, you can use your existing knowledge of the language to get the best from the program.
  2. You can perform structured queries directly in the logs, so you can narrow the results down by time, date or IP cluster without having to perform additional filtering.
  3. Queries can be saved as scripts, reused indefinitely, or invoked from batch files or VB shell scripts.

One important caveat about Log Parser is that it requires the logs to be used in a consistent format, including column headers, and that you properly specify which format is to be used. Log Parser supports most of the common types (IIS, W3C, NCSA, etc.), but the column definitions for each type of server log format differ widely. This will affect how you construct your query, since you need to know which columns to parse.

If you're using the standard W3C format for your logs, for instance, a query to look for attacks that attempt to execute arbitrary code through CMD.EXE might look something like this:

select * from C:\WINDOWS\system32\LogFiles\W3SVC752518\*.log where cs-uri-query like '%cmd.exe%' 

Note, of course, that the exact path to the log files would vary from system to system. The cs-uri-query column name (which contains the data passed for a GET or POST query) will change depending on the type of logging being used. The program's own documentation details what column types are valid for each variety of log.

Most attack signatures are visible as ordinary GET requests, making them relatively easy to find when you're using a tool like Log Parser. Several common signatures to look for are:

CMD.EXE
ROOT.EXE
AAAAAAAA / XXXXXXXX (used in many common buffer overflow exploits)

Another useful feature for doing queries of logs with Log Parser is the iCheckpoint function, which lets you do incremental processing. This allows Log Parser to "bookmark" a given log file, so that the next time Log Parser is run on that file, it will pick up where it left off instead of reparsing everything from the beginning. To use iCheckpoint with a particular script, pass this parameter in the command line used to invoke Log Parser:

-iCheckPoint:.lpc 

The checkpoint file is used to preserve the state of every file parsed with Log Parser, so you can use the same checkpoint file for all the logs in a given system. If you run Log Parser on a weekly or even daily basis, this feature's a great timesaver.

About the author: Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!


More information from SearchWindowsSecurity.com

  • Ask the Experts: Keep track of data in the event log
  • Tip: Make the most of your security log data
  • Learning Center: Windows forensics


  • Rate this Tip
    To rate tips, you must be a member of SearchEnterpriseDesktop.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    Endpoint security management tools
    The right security tools for finding Windows desktop weaknesses
    Using BitLocker in Windows 7
    20 days to a more secure enterprise
    How to get -- and keep -- user support with security
    MDOP for Windows 7 available now
    Microsoft's Online Desktop Manager caters to small IT shops
    Monitoring user activity with network analyzers
    Using third-party technologies with Microsoft's NAP
    Understanding Microsoft's NAP's internal and external components
    Microsoft's NAP can ensure security compliance

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    system tray  (SearchEnterpriseDesktop.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    Enterprise Desktop Security - Virus Protection, Malware Protection, Intrusion Detection
    HomeTopicsITKnowledge ExchangeTipsMultimediaWhite PapersBlogs
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2008 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts