Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


August 2000

Archiving and Analyzing the NT Security Log


RSS
Subscribe to Windows IT Pro | See More Security Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Free and inexpensive tools help you track event-log activities

Windows NT thoroughly captures security events, but the OS doesn't provide many tools to track those events. Given the difficulty and time-consuming nature of manual event-log analysis, you might neglect Security-log analysis activities. But if you ignore these important tasks, you might lose security-event data or miss the signs of an attempted (and possibly successful) attack. In this final article of the NT Security log series, I describe several free or inexpensive tools that can help you archive, merge, and analyze your systems' event logs. (For information about the previous articles, see "Other Articles in This Series," page 82.) I also show how to import your logs into one Microsoft Access database so that you can write custom reports.

Archiving Event Logs
As I explain in "Introducing the NT Security Log," March 2000, you can keep only a limited history of events in the Security log. Regardless of the maximum log size and event-wrapping options that you use, you eventually need to clear the log or overwrite older events. I recommend that you use your job scheduler (e.g., the NT Scheduler service) and a batch-file utility to archive the Security log before each nightly tape backup. If you choose a log size that accommodates the average amount of recorded activity that occurs between backups, you'll have a contiguous Security log archive that dates back as far as your tape rotation permits.

To automate event-log archival, you need a batch-file utility that can import your Security logs into an output file. The following four tools have certain strengths and peculiarities; one of the four will likely suit your environment. (For information about other available tools, see Mark Joseph Edwards, "The Handy Security Toolkit Revisited," October 1999.)

Dumpel. The Microsoft Windows NT Resource Kit's Dumpel is a well-known utility that can dump NT's three event logs (i.e., Security, System, and Application) to an output file. Dumpel lets you specify the log to dump, an output file, and filtering criteria. The utility dumps the log only in text format, delimiting each record with a carriage return or line feed. To copy the local system's Security log to a file called sec_archive.txt, type

dumpel ­f sec_archive.txt 
­l security

Unfortunately, the utility doesn't let you dump an event log in the log's native .evt file format, which NT Event Viewer uses. Dumpel's inability to save .evt output files is this tool's primary flaw. However, you can use the utility's c parameter or t parameter to specify comma-delimited or tab-delimited columns, respectively. So ostensibly, you can easily import the files into a database such as an Access database, from which you can view and write reports. However, Dumpel's format for each event record's free-form description field doesn't match the Access parsing algorithm and causes conversion problems.

The description field is a series of text strings; each event ID has a different set of strings. Some strings are dynamic (i.e., different for each occurrence of the event ID). Others are static (i.e., identical for each occurrence). Figure 1 shows an example description of event ID 528. The only information that NT stores in the event log is the dynamic string—for example, Administrator, DOMAIN, (0x0,0x3779C), 7, User32, Negotiate, and TECRA. NT stores the static string (i.e., Successful Logon:, User Name:, Domain:, Logon ID:, Logon Type:, Logon Process:, Authentication Package:, and Workstation Name:) in a separate standard message file. The Event Viewer and other programs that dump event logs in text file format must merge the dynamic and static strings. This requirement presents no problem for events that native NT components generate because NT's standard message files are present on every NT system. However, when you use third-party drivers and applications to generate an event from a particular system, that event might display correctly only on that system because the application's static message is unavailable on other systems. In this situation, the event description notes that the message text is unavailable and displays only the event's dynamic data string. (For example, you might see only the dynamic data string when you view a Microsoft SQL Server event from a workstation that doesn't have SQL Enterprise Manager installed.)

A key aspect of event-log archiving is the need to collect logs from multiple systems. Many systems administrators prefer to keep all the systems' event logs in a central directory. Dumpel lets you use the ­s parameter followed by a computer's name to retrieve and dump a remote system's event logs.

EventSave. Frank Heyne Software's EventSave (which you can download free at http://www.heysoft.de/) copies all three event logs in .evt file format and thus addresses Dumpel's primary flaw. EventSave collects the event logs from each of your crucial systems and maintains the logs in a central archive. The program checks the recorded time of each event in each log, then sorts the events into one file per log per computer per month. The program uses the format year_month_computername_eventlogname for these files. For example, on a system with event logs that contain events only from April 2000, EventSave will produce three files: 2000_04_oraclesvr_security.evt, 2000_04_oraclesvr_system.evt, and 2000_04_oraclesvr_application.evt. When a destination file already exists (e.g., because you previously ran EventSave that month), the tool appends new events to the existing file so that regardless of how often you run EventSave, you end up with only one file per month.

You can use the tool's /A switch to automatically save the event logs of each system in a domain, or you can use the /C switch to specify one computer. (If you want a subset of the domain's systems, you must write a batch file that executes EventSave for each computer.) For example, to save server2's event logs to the eventlogs shared directory on server1, type

eventsave \\server1\eventlogs /Cserver2

If you don't specify an archive path, EventSave puts the archive files in the directory that is active; if you don't add a computer name after the /C switch, the program saves the archive files in the local system's event logs.

One warning about EventSave: The tool unconditionally clears the logs after saving them, so you can't keep a constant amount of activity in each system's logs. If this restriction is a problem for you, consider Frank Heyne Software's EventCopy, which functions like EventSave but doesn't clear the logs. To archive the logs and still keep a month of activity on each system, you can set your event logs to overwrite events older than 30 days, then run EventCopy daily to add new events to the central archive directory. Frank Heyne Software also offers EventSave+, which lets you specify an event log to save for each system. The vendor negotiates pricing for these two utilities on a case-by-case basis.

EventSave and its siblings use Win32 event-log-dumping APIs that save event logs only to the local computer's hard disk. To support remote saves across a network, EventSave instructs the remote computer to dump the log to its local \%systemroot%\system32\config directory, then the tool uses file sharing to copy that information to the specified output directory. The remote systems must run the NT Server service, and if you've disabled administrative shares, you need to share the boot drive's root and use eventsave's /S switch to specify the share to EventSave. The user account that you use to run EventSave also requires change access to \%systemroot%\system32\config, read access to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog Registry key, and rights to Manage Auditing and Security Log on each system for which the utility accesses event logs.

NTOLog. NT OBJECTives' NTOLog (which you can download as part of NTO Tools at http://www.ntobjectives.com/) also makes an .evt backup of your local and remote systems' event logs. The free product uses a date and time filename format (i.e., DD-MM-YY-HH-MM-SS) and an extension (i.e., .secbak, .sysbak, or .appbak) that depends on the type of saved event log. NTOLog lets you use the /sec, /sys, or /app switches to save only the Security, System, or Application log, respectively. For example, if you type

ntolog \\oraclesvr /sec

at 10:02:32 on April 3, 2000, NTOLog will create a file called 03-04-00-10-02-32.secbak in OracleSvr's C:\winnt\system32\config directory. You can also use the tool's /c switch to clear a log after saving it.

NTOLog doesn't let you choose where to put the output files; the tool puts the files in the C:\winnt\system32\config directory of the archived logs' system. This restriction can be a problem if that path is invalid on your system. NT OBJECTives plans to remove this hard-coded path, but until then you can use a binary file editor to modify the NTOLog executable. And although NTOLog can help archive and back up your event logs, the product doesn't offer a way to automatically distinguish and collect output files from remote systems. If you want to maintain a central event-log archive, you need to append a computer name to each output filename, then copy the output files to a central directory. I recommend that you use NTOLog if you want to dump event logs only in .evt format for inclusion in your backups; use EventSave, which produces a clean set of appropriately named monthly files for each system, if you want to maintain a central online archive.

ELDump. You might consider Jesper Lauritsen's ELDump (which you can download free at http://www.ibt.ku.dk/
jesper/eldump/) if you need to dump your event logs in text format but require more functionality than Dumpel offers. The product is especially useful for importing the logs into an Access or SQL Server database. ELDump dumps a system's current event logs or lets you read .evt files that you previously dumped using other utilities. The tool provides excellent flexibility for specifying which events to output (e.g., events for a particular time period or specific event ID). ELDump also provides control over the output data format, including the output file's date and time format.

Another notable feature is ELDump's method of handling each event record's free-form description field. To prevent the display problem that I described earlier, ELDump uses the remote system's message files when dumping a remote event log.

Merging Event Logs
In "Introducing the NT Security Log," I explain how NT's fragmented logging nature isolates each system's Security log and provides no way to assess security events for your entire network (e.g., scan for all failed logon attempts throughout the network). If you're responsible for multiple systems, you need a way to merge the saved event logs from all systems into one file from which you can track events for the network. If you want one .evt file that contains all your systems' Security logs, try Frank Heyne Software's Merge Eventlog Records (MER), which is available with the registered version of Report Event for Windows NT/2000. This utility imports the .evt files that EventSave creates and uses them to produce one output file. You can then use Event Viewer to view your entire network's security activity. You can specify a wildcard filename (which tells MER which log files to read) and a destination filename. You can use the /E switch followed by comma-delimited event IDs to specify the event IDs that you want the program to merge. For example, to scan all your computers' Security logs that EventSave archived in C:\events\ for May 2000 and write logon failure event ID 529 and event ID 539 to a new file (e.g., 2000_05_failedlogon_security.evt) in the default (i.e., active) directory, type

mer C:\events\2000_05*security
.evt 2000_05_failedlogon_security
.evt /E529,539

Or to create one file (e.g., securitymerged.evt) that comprises all the Security logs from EventSave's archived directory, type

mer C:\events\*security.evt securitymerged.evt
   Previous  [1]  2  Next 


Reader Comments
Where can I get hold of the R528 and R529 utils?

Rob Williams August 04, 2000


Have a look at http://www.heysoft.de/index.htm. The utilities are posted there, plus some similar tools for reporting on other event codes in the EVT files.

Phil Spencley August 08, 2000


<i>The first tool that comes to mind is auditpol.exe, a Microsoft Windows NT Server 4.0 Resource Kit utility that lets you set audit policy on remote computers from the command line. Assuming that you have Domain Administrators authority and that the Server service is running on the workstations (it does by default), you can write a simple script that calls Auditpol once for each workstation. If the Server service isn't running, you can call Auditpol from the logon script if your users are members of the local Administrators group on their workstations (which isn't a good idea, by the way). Like any other program that sets audit policy, Auditpol requires you to be running with local Administrator privileges. Bear in mind that you might be able to use Tivoli if the Tivoli agent has Administrator authority on the workstations. (Windows 2000 completely solves this problem with Group Policy.) <br><br>
--Randy Franklin Smith</i>

Randy Franklin Smith August 10, 2000


I've enjoyed reading Randy Franklin Smith's articles about the Windows NT Security log (March through August 2000), but I have a question that I haven't been able to find an answer to. My network policy is not to audit workstations (i.e., auditing isn't turned on through User Manager). I want to turn on auditing, and I need to accomplish this task remotely. I have the ability to use a KiXtart script during logon, or I can use Tivoli to send a software package. Is there a way to handle this task remotely? I have more than 3600 workstations in a four-state area. Obviously, sneaker net isn't an option.

Fred Montney August 10, 2000


<i>I found the auditcat.hlp file in the Microsoft Windows NT Server 4.0 Resource Kit to be very informative. You also can learn a lot from searching the Microsoft Knowledge Base (http://support
.microsoft.com) and experimenting on your own. <br><br>
--­Randy Franklin Smith<i/>

Randy Franklin Smith September 14, 2000


I've been searching for books, articles, and vendor information about the Windows NT event logs. Randy Franklin Smith's articles about the NT Security log (March through August 2000) are especially useful in clarifying the meaning of a lot of the events I see every day in the Security log. Can you tell me other sources I can get my hands on to dive more deeply into this subject?<br><br>

Ed Ziots September 14, 2000


<br><br><i>Unfortunately, the user account doesn't maintain this information. Your only option is to catch all occurrences of event ID 624 in each domain controller's Security log. Event ID 624 identifies newly created user accounts.<br><br>
­--Randy Franklin Smith</i>

Randy Franklin Smith December 01, 2000


I'm trying to find a couple of thing. 1) what event number will tell me when a users has entered a bad password? I know 529 will but it also shows up under other actions. What about 675? 2) What is a good tool to report on the Security log? I need a could of all bad password by user and then a listing of each. Something automated.

morgandoyle June 15, 2007 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...


Security Whitepapers The Impact of Messaging and Web Threats

Why SaaS is the Right Solution for Log Management

Protecting (You and) Your Data with Exchange Server 2007

Related Events Top 10 Email Security Challenges and Solutions

Introduction to Identity Lifecycle Manager "2"

SQL Server Security: How to Secure, Monitor & Audit Your Databases

Check out our list of Free Email Newsletters!

Security eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Related Security Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing