Solved

Identify users accessing or deleting files from server?

Posted on 2007-12-06
10
252 Views
Last Modified: 2010-04-05
Hi,
need to log entries of files deleted and get info such as remote user,remote ip from the same on a lan..
ex:- if someone deletes a file c:/test.txt from my machine i need to know how to get the user and the ip of the machine which deleted the file ...
is this possible?

i hope i am asking this the rt way..
im a delphi developer so would love it if i get a solution in delphi.
have looked at alfa file monitor/dirmon and others available components
dosentget me what i want...
0
Comment
Question by:pramodpatel
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 18

Expert Comment

by:Johnjces
ID: 20421055
Simply, I do not know how to do this. But....

I do know how to audit such using Windows Security Audit and using the Event Viewer.

And... (maybe this will jog some experts memory who knows how to use this), I do know that you might be able to get some information using NetFileGetInfo and/or NetFileEnum.

I did a Google search on "Delphi NetFileGetInfo" and found some code to get connected users to a file, but nothing specific on who deleted a file.

Hope this gets you going. If you want details on setting up your audit policy let me know.

John
0
 
LVL 21

Expert Comment

by:developmentguru
ID: 20427356
 First, what application would you think you need to be aware of?  Are people using Explorer to delete these files?  FTP?  Web Browser?  If you have a limited application set you need to be aware of then it may simplify the solution.

  There are functions in Windows to get notifications of when a directory is accessed, but I don't know that they tell you who did it just that it happened.

  I think, honestly, that you will need to do a file system level hook into windows on the machine you want to monitor.  Here is a link to many sources of information on doing Windows File System Drivers.  

http://www.acc.umu.se/~bosse/

  If you do a file system driver and replace the one window is using currently, but have your drivers calls pass through to the normal OS driver then you can look for things you want to be notified on.  Then you define an interface that programs can call to request notifications.  This is not a trivial project though.

  Rather than trying to start the project yourself you may be able to use some components from 3rd parties.  Check these out.
http://www.eldos.com/
http://www.vclcomponents.com/Delphi/Tools/WinDriver_for_Windows-info.html
http://uranus.it.swin.edu.au/~jn/linux/ext2ifs.htm

I hope this helps.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 20437325
Firstly, determine if the system event logs contain sufficient information for you:

1. turn on auditing level that includes file Deletion detection
2. set your event log to wrap or make sure you dump/reset the log so that nothing is lost
3. delete files from a remote location
4. examine the logs to see what data is captured

If there is enough information in the event logs, you can monitor these logs in a service or application program.  There are also log-aggregating utilities you might consider, although they aren't cheap.

Similar EE question:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Q_22976287.html
indicates events 560 and 564 should have this information.

===============
If the above doesn't work, you will probably have to hook your monitoring code into the server's shell as suggested earlier.

===============
At some point, the file system will change to WinFS and this monitoring should be easier.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:pramodpatel
ID: 20439734
Hi,

thnx for the answers ..dosent get me what i need :(
i am looking  doing a file system level hook into windows on the machine i need to monitor ..
the major problem here ican see is
i need to monitor 4 servers..
2 are windows and the other 2 are linux
i have ppl deleteing stuff from there from allover the lan... need to stop this

regards
pramod
0
 
LVL 45

Expert Comment

by:aikimark
ID: 20440085
Time for you to set directory permissions to prevent folks from being able to delete.  This is available with both NTFS and Linux file systems.

Forget about monitoring.  That is just a stick approach to your problem.
0
 
LVL 21

Expert Comment

by:developmentguru
ID: 20442195
I have to agree with aikimark, that is the simple approach.  Writing file system level drivers to hook the OS is no small task (especially with two different OSes).
0
 

Author Comment

by:pramodpatel
ID: 20447403
Hi aikimark,developmentguru,

I understand .. but im in a 3d environment(Maya with file referencing)
i cannot limit access
i am thinking of the 2 options here..

1:
how abt i write a basic application which checks shell events ..
logs a delete if the files deleted are not on local drives
then get this installed on all machines...
that way i can track deletions on the server  .. am i thinking rt here?

2:
also another way to look at this would be to hook a delete .. check what file is abt to be deleted then aloow or deny the delete ... can this be done

regards
pramod

0
 
LVL 21

Accepted Solution

by:
developmentguru earned 250 total points
ID: 20450645
Either way it still sounds like a file system level hook.  One of the links I gave you also has a set of components that would let you set up a virtual file system based on your own code.  This would allow you to have all of the notifications for any files residing in your virtual file system.  The virtual file system can appear to be an entire drive but reside in a single file.
0
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 250 total points
ID: 20451502
file/directory access rights are very granular.  You specify what the user CAN do.  All other actions are prevented.  In this case, you might allow Read, Write, Create rights.  The application should function normally.  Without deletion rights, the file is protected from any user deletion activities, whether directly or through an application.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now