A way to monitor your files
Harry Skelton
harrys at tons61.UUCP
Fri Sep 15 21:38:27 AEST 1989
Some of the security features I have installed here can catch the unsupecting
snooper pretty quick. Some of the tricks are as follows:
Front ends to the following commands ( record directory information and
other environment information for future parsing - also the arguments):
ls cat sh less more pg and others....
Monitor the processes with a deamon.
1) (if not SU) popen() a ps -ef and parse your directory information,
2) run a "strings" of memory (if possible) and grep our your
file/directory information,
3) Monitor lock files or use fuser(1?) on your files from time to time,
4) write a program to parse the proc tables and get the full arguments
to what people are running (knowledge of kernal helpful :-) ).
5) Monitor changes in files (access information, modification times, etc)
use stat() to check them and record your findings from time to time.
Be sure you understand stat() as any novice can get confused by
what happens to some of the time stamps after you have stat'ed a file.
6) Read the user's $HOME/.history file (Korn Shell) if possible. But that
will make you as bad as the other guy...
Secure your files with 000 perms and change them back when you need to read
the file or modify the file. Although SU can read it, it's still a better
way of security.
If you have access to source, you can modify the shell by adding an
audit trail fuction.
There are other ways of doing it as well, I'm sure a lot of the readers have
known about these and many more tricks. Some problems you will face are:
pg < file
- this will not show up in the 'ps -ef' listing. Only the pg will show
while read line
do
echo $line
done < file
- same here, you can bypass any security clicks in most programs
this way. Good for install disks too when you don't know what's
out there and the install disk is missing 'ls' (Hi SCO!).
echo *
- good for a munged directory listing - awk it for clean results
I'm sure you can figure out more....
BTW: anyone have source to 'vulture' or 'monitor' ?
--
Harry Skelton - harrys at tons61, guardian at ugh
More information about the Comp.unix.questions
mailing list