They got me good (bad) . . . getting thousands of hits a day. They include or substitute their web page insted of yours when the proper referer and a few other credentials are met . . . not funny at all.
I read a bout cms and forums going down but I write my own code and got hit as well as another coder.
This was on a domain that was not on the search engines nor did it have a link to it SO either they just guessed the domain name or hacked the server and got a list.
I had to send visitors away by checking for words in the referer ie. crack, hack etc . . . still was getting thousands so I went to
http://webnet77.com/scripts/index.html and got "ip to country" and now send em away if they are not united states.
This has been a nightmare. . . used all my bandwidth in one day.
So I wrote the vermicide.
Depending on your server you may not be able to delete those files with ftp. or even find em all.
I hacked a "delete directory" script from php.net to remove them no matter how far they are buried. Also checks the contents of .htaccess file to only delete the bad part.
NOTE The list of files that I am looking for.
If you have a legit file with any of those names make sure it is 644 or chmode it to 644 Or keep a backup because they will get deleted.
(The @ supresses warnings for the 644 files).
to run this as a crontab do this in cpanel (Note php and a space at beginning) run crontab every few hours - your choice.
php /home/mysite/this-script.php
name this-scrip anything you would like.
Please run it in a test directory to make sure results are satifactory. It worked a charm for me.
EVEN if you are not infected run this thing at least once a day to keep your website clean. -An ounce of prevention-.
Sit back and no worries just point your browser to this script.
<?
function SET_Vermicide (){
$dir = ("./");// this keep it running in the current dir
//$dir = 'www'; //or http_docs if run from above www - optional
$dir = preg_replace("[\x5c\]","",$dir);// handles quotes
function delhck($dir){
$current_dir = @opendir($dir);
while($entryname = @readdir($current_dir)){
if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){
delhck("${dir}/${entryname}");
}elseif($entryname != "." and $entryname!=".."){
if (file_exists("${dir}/.htaccess")) {
$ffilename = "${dir}/.htaccess";
$fa = @fopen($ffilename, "rb");
$contentss = @fread($fa, filesize($ffilename));
fclose($fa);
if (eregi ("MultiViews","$contentss")){// determin if we need to change the contents by looking for "mutivews" in .htaccess
$contentss = preg_replace("/Options(.*)\r\n(.*)php/","", "$contentss");// we only delete the offending lines in .htaccess
unlink("${dir}/.htaccess");//delete .htaccess . . . we will put it back if there is legit code in .htaccess
//echo "this is access $contentss<br>";// test / debug line
if ($contentss == "
"){}// there is nothing to put back . . . leave .htaccess deleted
else{// else there is something to put back into .htaccess so we will recreate it
$fb = fopen ("${dir}/.htaccess", "ab");
fputs($fb,"$contentss");
fclose($fb);
}// now everything is back to normal
}
else{}// htaccess was clean
}
// now for all of those parasites
// these are the names of all variations of the .php scripts they use
//all will be owned by apache.
if (file_exists("${dir}/includes.php")) {
@unlink("${dir}/includes.php");
}
if (file_exists("${dir}/tests.php")) {
@unlink("${dir}/tests.php");
}
if (file_exists("${dir}/report.php")) {
@unlink("${dir}/report.php");
}
if (file_exists("${dir}/links.php")) {
@unlink("${dir}/links.php");
}
if (file_exists("${dir}/messages.php")) {
@unlink("${dir}/messages.php");
}
if (file_exists("${dir}/remote.php")) {
@unlink("${dir}/remote.php");
}
if (file_exists("${dir}/common.php")) {
@unlink("${dir}/common.php");
}
if (file_exists("${dir}/finfo.php")) {
@unlink("${dir}/finfo.php");
}
if (file_exists("${dir}/contacts.php")) {
@unlink("${dir}/contacts.php");
}
if (file_exists("${dir}/time.php")) {
@unlink("${dir}/time.php");
}
if (file_exists("${dir}/system.php")) {
@unlink("${dir}/system.php");
}
if (file_exists("${dir}/commands.php")) {
@unlink("${dir}/commands.php");
}
if (file_exists("${dir}/options.php")) {
@unlink("${dir}/options.php");
}
if (file_exists("${dir}/layout.php")) {
@unlink("${dir}/layout.php");
}
if (file_exists("${dir}/properties.php")) {
@unlink("${dir}/properties.php");
}
if (file_exists("${dir}/create.php")) {
@unlink("${dir}/create.php");
}
if (file_exists("${dir}/base.php")) {
@unlink("${dir}/base.php");
}
if (file_exists("${dir}/download.php")) {
@unlink("${dir}/download.php");
}
if (file_exists("${dir}/package.php")) {
@unlink("${dir}/package.php");
}
if (file_exists("${dir}/configs.php")) {
@unlink("${dir}/configs.php");
}
if (file_exists("${dir}/date.php")) {
@unlink("${dir}/date.php");
}
if (file_exists("${dir}/options.php")) {
@unlink("${dir}/options.php");
}
if (file_exists("${dir}/guest.php")) {
@unlink("${dir}/guest.php");
}
}
}
@closedir($current_dir);
}
delhck($dir);
}
SET_Vermicide ();// just point your browser to this page and everything is set to autopilot
//Shameless plug.
echo 'Vermicide Script Written By <a href="http://www.wlmark.com">WL Mark.com</a> Visit me and let me know your results.';
?>