[ Avaa Bypassed ]




Upload:

Command:

www-data@3.148.237.97: ~ $
#!/usr/bin/perl
# Pass data from stdin to an FTP server

$no_acl_check++;
require './fsdump-lib.pl';

# Parse args, and get password
select(STDERR); $| = 1; select(STDOUT);
$host = $ARGV[0];
$user = $ARGV[2];
if ($ARGV[3] =~ /touch/) {
	$touched = 1;
	}
$| = 1;
if (defined($ENV{'DUMP_PASSWORD'})) {
	$pass = $ENV{'DUMP_PASSWORD'};
	}
else {
	open(TTY, "+</dev/tty");
	print TTY "Password: ";
	$pass = <TTY>;
	$pass =~ s/\r|\n//g;
	close(TTY);
	}

# Read rmt protocol messages
while(1) {
	$line = <STDIN>;
	$line =~ s/\r|\n//g;
	if ($line =~ /^O(.*)/) {
		# File to open specified .. connect to FTP server
		$file = $1;
		$perms = <STDIN>;
		$perms = int($perms);
		&open_socket($host, 21, "SOCK", \$err);
		&error_exit("FTP connection failed : $err") if ($err);
		&ftp_command("", 2, \$err) ||
			&error_exit("FTP prompt failed : $err");

		# Login to server
		@urv = &ftp_command("USER $user", [ 2, 3 ], \$err);
		@urv || &error_exit("FTP login failed : $err");
		if (int($urv[1]/100) == 3) {
			&ftp_command("PASS $pass", 2, \$err) ||
				&error_exit("FTP login failed : $err");
			}
		&ftp_command("TYPE I", 2, \$err) ||
			&error_exit("FTP file type failed : $err");

		# Work out what we are doing
		$mode = 0;
		if (($perms & 0100) || ($perms & 01000) ||
		    (($perms & 01) || ($perms & 02)) && $touched) {
			# Writing new file
			$mode = 1;
			}
		elsif ($perms & 02000) {
			# Appending to a file
			$mode = 2;
			}
		elsif (!$perms) {
			# Reading from file
			$mode = 0;
			}
		else {
			&error_exit("Unknown permissions $perms");
			}
		print "A0\n";
		}
	elsif ($line =~ /^W(\d+)/) {
		# Write to FTP server
		$len = $1;
		if ($opened != 1) {
			&open_ftp_file($mode);
			}
		#$opened || &error_exit("FTP connection not opened yet");
		read(STDIN, $buf, $len);
		$wrote = (print CON $buf);
		print "A".($wrote ? $len : 0)."\n";
		}
	elsif ($line =~ /^R(\d+)/) {
		# Read from to FTP server
		if ($opened != 2) {
			&open_ftp_file(0);
			}
		$len = $1;
		$read = read(CON, $buf, $len);
		if ($read >= 0) {
			print "A".$read."\n";
			print $buf;
			}
		else {
			print "E",int($!),"\n";
			print "Read failed : $!\n";
			}
		}
	elsif ($line =~ /^C/) {
		# Close FTP connection
		if ($opened) {
			# Finish transfer
			close(CON);
			&ftp_command("", 2, \$err) ||
				&error_exit("FTP close failed : $err");
			}
		&ftp_command("QUIT", 2, \$err) ||
			&error_exit("FTP quit failed : $err");
		close(SOCK);
		print "A0\n";
		$opened = 0;
		}
	elsif (!$line) {
		# All done!
		last;
		}
	else {
		print "E1\nUnknown command $line\n";
		}
	}

sub error_exit
{
local $err = &html_tags_to_text(join("", @_));
print STDERR $err,"\n";
print "E1\n$err\n";
exit(1);
}

sub html_tags_to_text
{
local ($rv) = @_;
$rv =~ s/<tt>|<\/tt>//g;
$rv =~ s/<b>|<\/b>//g;
$rv =~ s/<i>|<\/i>//g;
$rv =~ s/<u>|<\/u>//g;
$rv =~ s/<pre>|<\/pre>//g;
$rv =~ s/<br>/\n/g;
$rv =~ s/<p>/\n\n/g;
return $rv;
}

sub open_ftp_file
{
local ($mode) = @_;

# Open passive port
local $pasv = &ftp_command("PASV", 2, \$err);
$pasv || &error_exit("FTP port failed : $err");
$pasv =~ /\(([0-9,]+)\)/;
local @n = split(/,/ , $1);
&open_socket("$n[0].$n[1].$n[2].$n[3]", $n[4]*256 + $n[5],
	     CON, \$err) ||
	&error_exit("FTP port failed : $err");

if ($mode == 0) {
	# Read from file
	&ftp_command("RETR $file", 1, \$err) ||
		&error_exit("FTP read failed : $err");
	$opened = 2;
	}
elsif ($mode == 1) {
	# Create new file if requested by the client, or if
	# the touch command was specified by the caller
	&ftp_command("STOR $file", 1, \$err) ||
		&error_exit("FTP write failed : $err");
	$touched = 0;
	$opened = 1;
	}
elsif ($mode == 2) {
	# Otherwise append to the file
	&ftp_command("APPE $file", 1, \$err) ||
		&error_exit("FTP write failed : $err");
	$opened = 1;
	}
else {
	$opened = 0;
	}
}


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 3.42 KB 0644
acl_security.pl File 1.16 KB 0755
backup.cgi File 2.27 KB 0755
backup.pl File 3.17 KB 0755
cgi_args.pl File 361 B 0755
config File 91 B 0644
config.info File 534 B 0644
config.info.ar File 640 B 0644
config.info.ca File 658 B 0644
config.info.cs File 437 B 0644
config.info.de File 632 B 0644
config.info.es File 430 B 0644
config.info.hu File 0 B 0644
config.info.ko File 451 B 0644
config.info.nl File 608 B 0644
config.info.no File 588 B 0644
config.info.pl File 672 B 0644
config.info.pt_BR File 440 B 0644
config.info.ru File 144 B 0644
config.info.uk File 157 B 0644
defaultacl File 39 B 0644
delete_dumps.cgi File 720 B 0755
edit_dump.cgi File 5.54 KB 0755
feedback_files.pl File 229 B 0755
freebsd-lib.pl File 12.2 KB 0755
fsdump-lib.pl File 8.1 KB 0755
ftp.pl File 3.69 KB 0755
index.cgi File 4.63 KB 0755
install_check.pl File 379 B 0755
irix-lib.pl File 8.19 KB 0755
kill.cgi File 877 B 0755
linux-lib.pl File 23.24 KB 0755
log_parser.pl File 770 B 0755
macos-lib.pl File 12.2 KB 0755
module.info File 447 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 162 B 0644
module.info.ar File 232 B 0644
module.info.ar.auto File 19 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 307 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 298 B 0644
module.info.ca File 138 B 0644
module.info.ca.auto File 17 B 0644
module.info.cs File 31 B 0644
module.info.cs.auto File 116 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 152 B 0644
module.info.de File 146 B 0644
module.info.de.auto File 13 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 355 B 0644
module.info.es File 50 B 0644
module.info.es.auto File 149 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 170 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 235 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 188 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 191 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 188 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 168 B 0644
module.info.hu File 31 B 0644
module.info.hu.auto File 155 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 181 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 231 B 0644
module.info.ko File 32 B 0644
module.info.ko.auto File 125 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 178 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 157 B 0644
module.info.ms File 123 B 0644
module.info.ms.auto File 19 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 153 B 0644
module.info.nl File 27 B 0644
module.info.nl.auto File 130 B 0644
module.info.no File 35 B 0644
module.info.no.auto File 127 B 0644
module.info.pl File 102 B 0644
module.info.pl.auto File 18 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 159 B 0644
module.info.pt_BR File 41 B 0644
module.info.pt_BR.auto File 127 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 164 B 0644
module.info.ru File 50 B 0644
module.info.ru.auto File 218 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 160 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 176 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 158 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 265 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 162 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 305 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 223 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 183 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 119 B 0644
module.info.zh_TW File 30 B 0644
module.info.zh_TW.auto File 98 B 0644
multi.pl File 572 B 0755
newtape.cgi File 592 B 0755
newtape.pl File 1.58 KB 0755
notape.pl File 493 B 0755
prefs.info File 21 B 0644
restore.cgi File 935 B 0755
restore_form.cgi File 1.1 KB 0755
rmulti.pl File 784 B 0755
save_dump.cgi File 3.97 KB 0755
solaris-lib.pl File 6.36 KB 0755
uninstall.pl File 347 B 0755