[ Avaa Bypassed ]




Upload:

Command:

www-data@3.144.235.50: ~ $
#!/usr/bin/perl
# save_serv.cgi
# Save or delete a server

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
require './servers-lib.pl';
our (%in, %access, %text);
&ReadParse();
$access{'edit'} || &error($text{'edit_ecannot'});
&error_setup($text{'save_err'});

my $serv;
if ($in{'id'}) {
	$serv = &get_server($in{'id'});
	&can_use_server($serv) || &error($text{'edit_ecannot'});
	}
else {
	$access{'add'} || &error($text{'edit_ecannot'});
	$serv = { 'id' => time() };
	}

if ($in{'delete'}) {
	# delete the server
	&delete_server($in{'id'});
	&webmin_log("delete", "server", $serv->{'host'}, $serv); 
	}
else {
	# validate inputs
	$in{'host'} =~ /^\S+$/ || &error($text{'save_ehost'});
	if ($in{'port_def'}) {
		$in{'mode'} == 0 || &error($text{'save_eport2'});
		}
	else {
		$in{'port'} =~ /^\d+$/ || &error($text{'save_eport'});
		}
	if ($in{'mode'} == 1) {
		&to_ipaddress($in{'host'}) || &to_ip6address($in{'host'}) ||
			&error($text{'save_ehost2'});
		$in{'wuser'} =~ /\S/ || &error($text{'save_euser'});
		$in{'wpass'} =~ /\S/ || &error($text{'save_epass'});
		}
	if ($in{'fast'} == 2 && $in{'mode'} == 1) {
		# Does the server have fastrpc.cgi ?
		my $con = &make_http_connection($in{'host'}, $in{'port'},
					   $in{'ssl'}, "GET", "/fastrpc.cgi");
		$in{'fast'} = 0;
		if (ref($con)) {
			&write_http_connection($con,
				        "Host: $serv->{'host'}\r\n");
			&write_http_connection($con,
					"User-agent: Webmin\r\n");
			my $auth = &encode_base64("$in{'wuser'}:$in{'wpass'}");
			$auth =~ s/\n//g;
			&write_http_connection($con,
					"Authorization: basic $auth\r\n");
			&write_http_connection($con, "\r\n");
			my $line = &read_http_connection($con);
			if ($line =~ /^HTTP\/1\..\s+401\s+/) {
				&error($text{'save_elogin'});
				}
			elsif ($line =~ /^HTTP\/1\..\s+200\s+/) {
				# It does .. tell the fastrpc.cgi process to die
				do {
					$line = &read_http_connection($con);
					$line =~ s/\r|\n//g;
					} while($line);
				$line = &read_http_connection($con);
				if ($line =~ /^1\s+(\S+)\s+(\S+)/) {
					my ($port, $sid, $error) = ($1, $2);
					&open_socket($in{'host'}, $port,
						     $sid, \$error);
					if (!$error) {
						close($sid);
						$in{'fast'} = 1;
						}
					}
				}
			&close_http_connection($con);
			}
		}
	elsif ($in{'fast'} == 2) {
		# No login provided, so we cannot say for now ..
		}

	# save the server
	my @groups = split(/\0/, $in{'group'});
	if ($in{'newgroup'}) {
		$in{'newgroup'} =~ /^\S+$/ || &error($text{'save_egroup2'});
		push(@groups, $in{'newgroup'});
		}
	$serv->{'host'} = $in{'host'};
	$serv->{'port'} = $in{'port_def'} ? undef : $in{'port'};
	$serv->{'type'} = $in{'type'};
	$serv->{'ssl'} = $in{'ssl'};
	$serv->{'checkssl'} = $in{'checkssl'};
	$serv->{'desc'} = $in{'desc_def'} ? undef : $in{'desc'};
	$serv->{'group'} = join("\t", @groups);
	$serv->{'fast'} = $in{'fast'};
	delete($serv->{'user'});
	delete($serv->{'pass'});
	delete($serv->{'autouser'});
	delete($serv->{'sameuser'});
	if ($in{'mode'} == 1) {
		$serv->{'user'} = $in{'wuser'};
		$serv->{'pass'} = $in{'wpass'};
		}
	elsif ($in{'mode'} == 2) {
		$serv->{'autouser'} = 1;
		}
	elsif ($in{'mode'} == 3) {
		$serv->{'user'} = 'same';
		$serv->{'sameuser'} = 1;
		}
	&save_server($serv);
	delete($serv->{'pass'});
	&webmin_log($in{'new'} ? 'create' : 'modify', 'server',
		    $serv->{'host'}, $serv);
	}
&redirect("");


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 1.63 KB 0644
acl_security.pl File 2.46 KB 0755
auto.pl File 2.9 KB 0755
backup_config.pl File 678 B 0755
cgi_args.pl File 313 B 0755
config File 140 B 0644
config-debian-linux File 174 B 0644
config-redhat-linux File 180 B 0644
config-syno-linux File 140 B 0644
config.info File 977 B 0644
config.info.ar File 1.5 KB 0644
config.info.ca File 1.17 KB 0644
config.info.cs File 421 B 0644
config.info.de File 1.14 KB 0644
config.info.es File 481 B 0644
config.info.fr File 489 B 0644
config.info.hu File 147 B 0644
config.info.it File 1.03 KB 0644
config.info.ja File 1.21 KB 0644
config.info.ko File 983 B 0644
config.info.ms File 934 B 0644
config.info.nl File 979 B 0644
config.info.no File 925 B 0644
config.info.pl File 1.02 KB 0644
config.info.pt_BR File 460 B 0644
config.info.ru File 1.48 KB 0644
config.info.sk File 445 B 0644
config.info.sv File 99 B 0644
config.info.tr File 487 B 0644
config.info.zh File 81 B 0644
config.info.zh_TW File 60 B 0644
config_info.pl File 264 B 0755
defaultacl File 88 B 0644
delete_servs.cgi File 836 B 0755
edit_auto.cgi File 2.32 KB 0755
edit_serv.cgi File 4.8 KB 0755
find.cgi File 1.46 KB 0755
index-json.cgi File 266 B 0755
index.cgi File 5.76 KB 0755
link.cgi File 7 KB 0755
log_parser.pl File 843 B 0755
login.cgi File 441 B 0755
logout.cgi File 340 B 0755
module.info File 178 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 124 B 0644
module.info.ar File 133 B 0644
module.info.ar.auto File 23 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 189 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 190 B 0644
module.info.ca File 120 B 0644
module.info.ca.auto File 18 B 0644
module.info.cs File 31 B 0644
module.info.cs.auto File 92 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 119 B 0644
module.info.de File 117 B 0644
module.info.de.auto File 15 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 194 B 0644
module.info.es File 37 B 0644
module.info.es.auto File 109 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 141 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 193 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 145 B 0644
module.info.fr File 34 B 0644
module.info.fr.auto File 102 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 141 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 141 B 0644
module.info.hu File 25 B 0644
module.info.hu.auto File 109 B 0644
module.info.it File 33 B 0644
module.info.it.auto File 99 B 0644
module.info.ja File 141 B 0644
module.info.ko File 32 B 0644
module.info.ko.auto File 109 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 151 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 131 B 0644
module.info.ms File 110 B 0644
module.info.ms.auto File 16 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 127 B 0644
module.info.nl File 29 B 0644
module.info.nl.auto File 97 B 0644
module.info.no File 23 B 0644
module.info.no.auto File 89 B 0644
module.info.pl File 24 B 0644
module.info.pl.auto File 95 B 0644
module.info.pt File 36 B 0644
module.info.pt.auto File 107 B 0644
module.info.pt_BR File 40 B 0644
module.info.pt_BR.auto File 113 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 125 B 0644
module.info.ru File 30 B 0644
module.info.ru.auto File 152 B 0644
module.info.sk File 31 B 0644
module.info.sk.auto File 91 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 133 B 0644
module.info.sv File 27 B 0644
module.info.sv.auto File 93 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 285 B 0644
module.info.tr File 36 B 0644
module.info.tr.auto File 111 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 192 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 188 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 163 B 0644
module.info.zh File 30 B 0644
module.info.zh.auto File 85 B 0644
module.info.zh_TW File 34 B 0644
module.info.zh_TW.auto File 91 B 0644
prefs.info File 63 B 0644
save_auto.cgi File 2.34 KB 0755
save_serv.cgi File 3.31 KB 0755
servers-lib.pl File 15.04 KB 0755
uninstall.pl File 262 B 0755