* History of commands in shells
@ 2002-01-29 3:26 Matthieu
2002-01-29 9:57 ` Martyn
2002-01-29 10:09 ` Emmanuel Choquet
0 siblings, 2 replies; 5+ messages in thread
From: Matthieu @ 2002-01-29 3:26 UTC (permalink / raw)
Hello,
In my company we use Alpha stations running on Tru64.
Some files were delete without any authorisation, and I would like to know
how can I investigate when and who has send the commands?
Also I know the "at" command how can I be sure there is not an "at
xx-xx-2005 rm *" hidden in my machine ?
Thanks a lot, and sorry for such stupid questions!!!
Matthieu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: History of commands in shells
2002-01-29 3:26 History of commands in shells Matthieu
@ 2002-01-29 9:57 ` Martyn
2002-01-29 14:06 ` Martyn
2002-01-29 14:31 ` Quarter Horseman
2002-01-29 10:09 ` Emmanuel Choquet
1 sibling, 2 replies; 5+ messages in thread
From: Martyn @ 2002-01-29 9:57 UTC (permalink / raw)
Matthieu wrote:
>Hello,
>
>In my company we use Alpha stations running on Tru64.
>
>Some files were delete without any authorisation, and I would like to know
>how can I investigate when and who has send the commands?
>
>Also I know the "at" command how can I be sure there is not an "at
>xx-xx-2005 rm *" hidden in my machine ?
>
>Thanks a lot, and sorry for such stupid questions!!!
>
>Matthieu
>
>
>
The at commands (and crontabs - also worth looking at) are recorded in
files which you can find in:
/var/spool/cron/atjobs/USERNAME.JOBNUMBER
and
/var/spool/cron/crontabs/USERNAME
if you cat any of these files you'll see who's got jobs waiting to run
and what those jobs are going to do.
The command history is kept in the users home directory in a file called
.history so if you do something like:
find / -name .history -exec grep rm {} \;
it'll search for all the .history files and then grep for any "rm"
commands, this may or may not be usefull as there are likely to be many
legitimate rm commands and in order to work out if a particular "rm *"
command caused your problem you'd have to work out from previous
commands if the user had been working in a temporary/private directory
when they issued the command, also they might not have removed the file,
they could have moved it, e.g "mv * /tmp/tmp.file". Also if anyone was
trying to be malicious and then cover their tracks they would remove the
.history file after issuing the destructive commands in order to
eliminate the evidence.
Best of luck.
--
Remove KNICKERS before replying by Email ;-)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: History of commands in shells
2002-01-29 9:57 ` Martyn
@ 2002-01-29 14:06 ` Martyn
2002-01-29 14:31 ` Quarter Horseman
1 sibling, 0 replies; 5+ messages in thread
From: Martyn @ 2002-01-29 14:06 UTC (permalink / raw)
Martyn wrote:
> Matthieu wrote:
>
>> Hello,
>>
>> In my company we use Alpha stations running on Tru64.
>>
>> Some files were delete without any authorisation, and I would like to
>> know
>> how can I investigate when and who has send the commands?
>>
>> Also I know the "at" command how can I be sure there is not an "at
>> xx-xx-2005 rm *" hidden in my machine ?
>>
>> Thanks a lot, and sorry for such stupid questions!!!
>>
>> Matthieu
>>
>>
>>
> The at commands (and crontabs - also worth looking at) are recorded in
> files which you can find in:
>
> /var/spool/cron/atjobs/USERNAME.JOBNUMBER
> and
> /var/spool/cron/crontabs/USERNAME
>
> if you cat any of these files you'll see who's got jobs waiting to run
> and what those jobs are going to do.
>
>
> The command history is kept in the users home directory in a file
> called ..history so if you do something like:
>
> find / -name .history -exec grep rm {} \;
>
> it'll search for all the .history files and then grep for any "rm"
> commands, this may or may not be usefull as there are likely to be
> many legitimate rm commands and in order to work out if a particular
> "rm *" command caused your problem you'd have to work out from
> previous commands if the user had been working in a temporary/private
> directory when they issued the command, also they might not have
> removed the file, they could have moved it, e.g "mv * /tmp/tmp.file".
> Also if anyone was trying to be malicious and then cover their tracks
> they would remove the ..history file after issuing the destructive
> commands in order to eliminate the evidence.
>
>
>
> Best of luck.
>
In actual fact the name of the command history file depends on which
shell they're using, nevertheless it should be obvious which is which.
--
Remove KNICKERS before replying by Email ;-)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: History of commands in shells
2002-01-29 9:57 ` Martyn
2002-01-29 14:06 ` Martyn
@ 2002-01-29 14:31 ` Quarter Horseman
1 sibling, 0 replies; 5+ messages in thread
From: Quarter Horseman @ 2002-01-29 14:31 UTC (permalink / raw)
> find / -name .history [...]
Good idea, but I'd add .sh_history as well to cover ksh users.
QH
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: History of commands in shells
2002-01-29 3:26 History of commands in shells Matthieu
2002-01-29 9:57 ` Martyn
@ 2002-01-29 10:09 ` Emmanuel Choquet
1 sibling, 0 replies; 5+ messages in thread
From: Emmanuel Choquet @ 2002-01-29 10:09 UTC (permalink / raw)
"Matthieu" <gypso2@hotmail.com> wrote in message news:<a354vj$3eq$1@news.hk.linkage.net>...
> Hello,
>
> In my company we use Alpha stations running on Tru64.
What version (audit is simpler to setup in v5.X, see further) ?
> Some files were delete without any authorisation, and I would like to know
> how can I investigate when and who has send the commands?
You can audit file access, try 'man auditconfig' as a starter
>
> Also I know the "at" command how can I be sure there is not an "at
> xx-xx-2005 rm *" hidden in my machine ?
cd /var/spool/cron/atjobs
check all files there. For malicious users, tracking aliases usage can
be tricky though.
you better check in /var/spool/crontabs as well
>
Cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-01-29 14:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-29 3:26 History of commands in shells Matthieu
2002-01-29 9:57 ` Martyn
2002-01-29 14:06 ` Martyn
2002-01-29 14:31 ` Quarter Horseman
2002-01-29 10:09 ` Emmanuel Choquet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox