MrPaan

Wordpress

Aug 23rd, 2013
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.23 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5.     wpPluginDetect - Wordpress Plugin Detection.
  6.     Copyright (C) 2011  Ahlspiess <[email protected]>
  7.     Some Code Are Edit by MrPaan
  8.     http://sitel.com/wp.php?url=(SITE)
  9.     Original Code http://rempah-proj.googlecode.com/svn/trunk/PHP/wpdetect.php
  10.  
  11.    
  12.    
  13. */
  14.  
  15.  
  16. $url = $_GET['url'];
  17. $jMe = new jComDetect($url);
  18.  
  19. class jComDetect {
  20.     public $url;
  21.  
  22.     function __construct($url){
  23.         $this->url = $url;
  24.         $this->init();
  25.     }
  26.    
  27.     function init() {
  28.         $content = $this->cURL($this->url);
  29.         if(!preg_match("/200 OK/", $content)) {
  30.             $this->msg("[-] Error! 404 Not Found");
  31.             exit;
  32.         } else {
  33.             print $this->jCheckComp($content);
  34.         }
  35.     }
  36.    
  37.     function jCheckComp($content) {
  38.        $dupe = array();
  39.         $nstack = array();
  40.         preg_match_all("/wp-content\/themes\/(.*?)\/style\.css/", $content, $ret_1);
  41.         preg_match_all("/Theme URI: (.+)/", $this->cURL($this->argv[1]."/".$ret_1[0][0]), $ret_2);
  42.         preg_match_all("/\<meta name=\"generator\" content=\"WordPress (.*?)\" \/\>/", $content, $ret_3);
  43.         $this->msg("[+] Using Wordpress Version: ".trim($ret_3[1][0]));
  44.         $this->msg("[+] Using ".trim($ret_1[1][0])." Theme. Url --> ".trim($ret_2[1][0]));
  45.         preg_match_all("/wp-content\/plugins\/(.*?)\//", $content, $stack);
  46.         foreach($stack[1] as $unstack) {
  47.             if(!isset($dupe[$unstack]) and !is_null($unstack) and !empty($unstack)) {
  48.                 if(preg_match("/200 OK/", $this->cURL("http://svn.wp-plugins.org/".trim($unstack)."/"))) {
  49.                     $this->msg("[+] Founded {$unstack} Plugins");
  50.                     $this->msg(" --> Plugin URL --> http://svn.wp-plugins.org/".trim($unstack)."/");
  51.                 } else {
  52.                     $this->msg("[+] Founded {$unstack} Plugins.");
  53.                 }
  54.                 $nstack[] = $unstack;
  55.                 $dupe[$unstack] = true;
  56.             }
  57.         }
  58.         //echo "[Debug]".__fVULN__."\n";
  59.         $this->fVuln($nstack);
  60.     }
  61.    
  62.     function fVuln($c = array()) {
  63.         $content = "";
  64.         foreach($c as $com) {
  65.             $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=");
  66.         }
  67.         preg_match_all("/\<a  href=\"http\:\/\/www\.exploit\-db\.com\/exploits\/(.*?)\"\>(.*?)\n/", $content, $me);
  68.         for($i=0;$i<count($me[1]);$i++) {
  69.             $this->msg("[+] ".trim(str_replace("</a>", "", $me[2][$i]))."\n --> http://www.exploit-db.com/exploits/".trim($me[1][$i]));
  70.         }
  71.        
  72.     }
  73.    
  74.     function cURL($url) {
  75.         $ch = curl_init();
  76.         curl_setopt($ch, CURLOPT_HEADER, 1);
  77.         curl_setopt($ch, CURLOPT_TIMEOUT, 15);
  78.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  79.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  80.         curl_setopt($ch, CURLOPT_URL, $url);
  81.         curl_setopt($ch, CURLOPT_USERAGENT, "jVulnComponent Crawler v1-Ahlspiess, Ported by wcypierre");
  82.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  83.         $data = curl_exec($ch);
  84.         if($data) {
  85.             return $data;
  86.         } else {
  87.             return 0;
  88.         }
  89.     }
  90.    
  91.     function msg($x) {
  92.         printf("%s<br />", $x);
  93.     }
  94.  
  95. }
  96.  
  97. ?>
Advertisement
Add Comment
Please, Sign In to add comment