Files and Directories
|
|
|
|
#!/usr/bin/php -q
<? /*
EXTREMELY DANGEROUS:
you can delete any file with this ofcoz multiple files
on one action.
all fool thing you did is your own fault, i didnt take
any responsibility, if you damaging your/other servers
HISTORY:
this tool originaly make for helping mweb Indonesia
developer/designer/admin to find useless file on our
servers, i.e DEADJOE file or .html~
why the name is sikil?
officialy his name seekkill :) on indonesian speeling
being sikil :) hehheh its also mean foot on java language.
hopely this tool can usefull for you
TODO:
- optimizing code
THANKS:
ppls @ mweb, satunet crews, my wife desy
ONLY RUN ON LINUX :) IF YOU WANT PORT IT ON WINDOWS DOIT
visit my page http://phpklik.dhs.org
*/ if (!$HTTP_USER_AGENT) {
$tai="/tmp/tai"; $readstdin = fopen("/dev/stdin", "r");
echo"---------------------------------------------------n";
echo" this tool are EXTREMELY DAGER! be carefulln";
echo" all thing cause this tool is your own riskn";
echo"DONT BLAME ME IF YOU FUCKOUT YOUR OWN/SOMEONE ELSEn";
echo"---------------------------------------------------n";
echo" phpsikil ( seek and kill ) version 0.18hn";
echo" copyleft by idban secandri <idban@satunet.com>n";
echo" AGAIN,... BE CAREFUL IF YOU RUN AS ROOTnnn";
echo"btw b4 you continue i RECOMENDED you to run:n ";
echo""find / filename"n";
echo"to make sure what file we seek and killnn";
echo"continue anyway ? (y/n) : "; $quest = fgets($readstdin, 2);
if ($quest==y || $quest==Y)
{ $rstdin = fopen("/dev/stdin", "r");
echo "enter directory to process: "; $dir=fgets($rstdin,255);
echo "enter filename for seek and kill ( ie: *.html~ ): "; $filename = fgets($rstdin, 225);
$filename=str_replace("n", "", $filename); $dir=str_replace("n", "", $dir);
$ex=`find $dir -name $filename`;
$wrt = fopen("$tai", "w"); fputs($wrt, "$exrn"); fclose($wrt);
fclose($rstdin);
$rd=file($tai); $ct=count($rd); $cct=$ct-1;
for ($i=0; $i<$cct; $i++) {
$rstdini = fopen("/dev/stdin", "r");
$rd[$i]=str_replace("n","",$rd[$i]);
echo"delete $rd[$i] ? (y/n/q)";
$confirm[$i]=fgets($rstdini,2);
$confirm[$i]=str_replace("n","",$confirm[$i]);
if ($confirm[$i] ==y || $confirm[$i]==Y) {
exec("rm -f $rd[$i]");
echo"$rd[$i] was deleten";
}
if ($confirm[$i] ==q || $confirm[$i]==Q) {
die("process terminated by usern");
}
if ($confirm[$i] ==n || $confirm[$i]==N)
{
echo"$rd[$i] not deleten";
}
if (!$confirm[$i])
{
echo"$rd[$i] not deleten";
}
else {} fclose($rstdini);
}
}
else {
}
fclose($readstdin);
}
else {
die("please run on console!");
} ?>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|