hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: Log Cleaning?
GhostCow
hey i just wanted to ask yall:
1. how does one remove selectively commands recorded in ps aux?
2. what are the log clearers you use? (and dont say rm -rf /var/log/ because its very suspicious when suddenly all logs disappear) and how do you use them?*

ps*: for linux and *bsd systems

thanks!
coder
packetstorm has a collection of log cleaning utilities...
http://packetstormsecurity.nl/UNIX/penetration/log-wipers/

-------------------------------------------------
well, hiding from "ps aux" is a good question , wish i knew the answer wink.gif

but cleaning logs might be easy if you have access to Perl? i suppose you'd want to remove the lines that contain your UserName & whatever commands you want to hide...

a lil' something like this maybe- this is psuedo Perl wink.gif
read up on Perl Expressions, and replace Usernames/commands/logfiles with those that would be found on your part. distro...
CODE

open (LOG, "logfile");
@logs = <LOG>;
close (LOG);

open (NEWLOG, ">newlogfile");

foreach (@logs) {
$_ =~ s/your_user_name/another_user_name/;
print NEWLOG $_;
}

close (NEWLOG);


now this is just a start/idea- you could easily modify a script like this to eiether delete the entries, or switch the entries (like the sample above)... Perl Expressions are very handy, esp. for stuff like this wink.gif
GhostCow
thanks but i was asking what log cleaners YOU all use... i know that list in packetstorm...
coder
oh, i like grep/gres wink.gif
GhostCow
please post it with explenations on how to use it that would be nice biggrin.gif
coder
bro, if you're rootin' around a unix box, you should know what grep is, shouldn't you?

man man
man grep
man gres
atomix
;x grep atomix's nuts
GhostCow
i am a little newbish to unix enviroment and i know the grep command but i didnt know how to use it very well thanks...
coder
oh don't mind me, i'm just being an (filtered)...

here is a nice read on regexp (Regular Expressions, like those used in grep)
http://etext.lib.virginia.edu/helpsheets/regex.html

that should get you started smile.gif
GhostCow
yea but then there's the whole syslogd problem, bah!
i just need someone to recommend a darn good cleaner that can clear everything a certain account did including what is written in ps aux but thats not manditory


anyone?
TriHFH
QUOTE

ps -A | grep log


then...

QUOTE

pkill -9 syslogd
pkill -9 klogd


I just do that when i first login to a box... will take care of ur syslogd problem if you remember to do it every time tongue.gif. Oh and then i do a

QUOTE

touch ~/hushlogin

to remove that "Last logged in from IP.IP.IP.IP" text on some machines... and then a
QUOTE

history -c


to clear that... dunno if this helps, and there are probably other things i dont do which get logged, but im one of the biggest newbies you'll ever meet at *nix, so i dunno biggrin.gif
d00m
For any sort of "plain text" logs doing something like this can help:

cat logfile.txt |grep -v "entry u wanna remove" > /tmp/x;mv /tmp/x logfile.txt
GhostCow
what other types of logs are there?
d00m
The utmp and wtmp logs are not in plain text i.e. in binary format...so u need to use or code a log cleaner for these sort of logs. Check out the man pages for wtmp and utmp. btw....commands like "who" and "lastlog" use these files to find information like the current users logged in.
l0kal
But do not forget to erase the latest lines in the $HOME/.bash_history .
If you root a box and copy the shadow file, the admin can always hit the up-button to see what you have been doing...

PS do NOT do this BEFORE you clean the log files... huh.gif
fre4k
there is a nice prog outside for linux called "Die Putze" biggrin.gif works fine !

Here you can download it

http://mitglied.lycos.de/white1/
Tyrano
link redirects to some photo site fre4k rolleyes.gif
celox
Just use llc log cleaner from packetstorm and use the read options and than modify those logs and clear or delete .bash_history.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.