Friday, July 07, 2006

How to audit and track file deletions

  • Enable Audit Policy: On the machine where you want to track file deletion, go to Administrative Tools->Local Security Policy->Audit Policy , double click "Audit Object Access" on the right pane and switch-on "Success" & "Failure".
  • Enable auditing for user/group: You'll need to enable and add user/security group for auditing on the folder which needs to be captured for file deletion.
    • Right click on the target folder (ex. C:\Program Files\Honeywell), select Properties and go to Security Tab.
    • Click on Advanced , and select Auditing Tab.
    • Add here the security group which would include the user who you think might be deleting the file. If you are not sure, include EVERYONE .
    • On the next screen select "Successful" & "Failed" on "Delete subfolders and files" & "Delete". Apply new settings and exit from properties.
  • These configurations will generate file/folder access audit logs for the configured folder in Securit Event Logs . Since we are interested in only the logs that show details of file/folder deletions, we'll need to look for Security Logs with event ID 560 .
  • Any file deletion operation will generate two events with event ID 560. After you've realized that your target file has been deleted, you'll need to filter the security log view to show only logs with event ID 560 (right click on Event Viewer->Security, select Filter...).
  • If you quickly want to find out if your configured machine generated any file deletion event log, run the following command on your own (networked) machine. This will work only on XP and above, therefore, you can use this to query for security logs from Windows 2000 machines. Run cscript //h:cscript //s //nologo at least once on your system before executing the following command.

eventquery.vbs /S <Target_System_Name> /FI "ID eq 560" /L Security /V
/FI : Filter
/L : Log name {Application | Security | System}
/V : Verbose output

To know more about the above command, read here
.

  • A typical security log with file deletion details will look something like this:

Event Type: Success Audit
Event Source: Security
Event Category: Object Access
Event ID: 560
User: GKY\Raj
Computer: GKY
Description:
Object Open:
Object Server: Security
Object Type: File
Object Name: D:\Test\testdoc.txt
Handle ID: 1756
Operation ID: {0,3190200}
Process ID: 4040
Image File Name: C:\WINDOWS\explorer.exe
Primary User Name: Raj
Primary Domain: GKY
Primary Logon ID: (0x0,0x40C41)
Client User Name: -
Client Domain: -
Client Logon ID: -
Accesses: DELETE
SYNCHRONIZE

ReadAttributes

NOTE:

  • Ensure that security log is set not to overwrite itself, and has sufficient size to hold logs spanning many days. You can configure these settings by right-clicking on Security subfolder inside Event Viewer.
  • You might want to test these settings by deleting few files yourself before assuming it'll deliver what you expect!

Update:Just found a better alternative to built-in Event Viewer - http://www.eventlogxp.com/

3 Comments:

Blogger John said...

Hi Raj,

In regards to "Ensure that security log is set not to overwrite itself, and has sufficient size to hold logs spanning many days", I think that's a very important point, because so often, due to incorrectly configured settings, logs just roll over and potentially vital information gets lost!

By the way, I'm a Windows Security Analyst as well, and often blog on Active Directory Security stuff. If you have a few minutes, please feel free to drop by!

Thanks,
John

Wednesday, June 02, 2010 6:39:00 AM  
Blogger AGreenhill said...

I logged in as admin and still, this does not exist: Administrative Tools->Local Security Policy->Audit Policy

Probably because it's Win8.1.. you should specify that your instructions are not for the latest windows version.

Sunday, March 23, 2014 11:05:00 PM  
Blogger AGreenhill said...

.. per my previous comment about this article not applying to Win8.1, I have found that it simply doesn't apply to Win8.1 standard edition. You will require a Pro version to control your OS.

Sunday, March 23, 2014 11:19:00 PM  

Post a Comment

Links to this post:

Create a Link

<< Home