[ Avaa Bypassed ]




Upload:

Command:

www-data@3.145.57.4: ~ $
#!/usr/bin/perl
# save_stunnel.cgi
# Save, create or delete an SSL tunnel

require './stunnel-lib.pl';
&ReadParse();
&error_setup($text{'save_err'});

if ($in{'idx'} ne '') {
	@stunnels = &list_stunnels();
	$st = $stunnels[$in{'idx'}];
	%old = %$st;
	}

if ($in{'delete'}) {
	# Just delete from inetd.conf and xinetd.conf
	&lock_file($st->{'file'});
	if (&get_stunnel_version(\$dummy) >= 4) {
		if ($st->{'args'} =~ /^(\S+)\s+(\S+)/) {
			$cfile = $2;
			if ($cfile =~ /^\Q$module_config_directory\E\//) {
				&lock_file($cfile);
				unlink($cfile);
				}
			}
		}
	&delete_stunnel($st);
	}
else {
	# Validate inputs
	$in{'name'} =~ /^[A-z][A-z0-9\_\-]+$/ || &error($text{'save_ename'});
	$in{'port'} =~ /^\d+$/ || &error($text{'save_eport'});
	if ($in{'pmode'} == 2) {
		-r $in{'pem'} || &error(&text('save_epem', $in{'pem'}));
		}
	if (!$in{'tcpw_def'}) {
		$in{'tcpw'} =~ /^\S+$/ || &error($text{'save_etcpw'});
		}
	if (!$in{'iface_def'}) {
		&to_ipaddress($in{'iface'}) || &to_ip6address($in{'iface'}) ||
			&error($text{'save_eiface'});
		}
	if ($in{'mode'} == 0 || $in{'mode'} == 1) {
		# Running a command
		$cmd = $in{'mode'} == 0 ? $in{'cmd0'} : $in{'cmd1'};
		$args = $in{'mode'} == 0 ? $in{'args0'} : $in{'args1'};
		&has_command($cmd) || &error($text{'save_ecmd'});
		}
	else {
		# Connecting to remote host and port
		&to_ipaddress($in{'rhost'}) || &to_ip6address($in{'rhost'}) ||
			&error($text{'save_erhost'});
		$in{'rport'} =~ /^\d+$/ || &error($text{'save_erport'});
		}

	# Create inetd/xinetd config
	if (&get_stunnel_version(\$dummy) >= 4) {
		# New-style args format
		if ($in{'new'}) {
			$cfile = "$module_config_directory/$in{'name'}.conf";
			unlink($cfile);
			$conf = { };
			$st = { 'args' => "$stunnel_shortname $cfile",
				'command' => $config{'stunnel_path'},
				'type' => $in{'type'} };
			}
		else {
			if ($st->{'args'} =~ /^(\S+)\s+(\S+)/) {
				$cfile = $2;
				@conf = &get_stunnel_config($cfile);
				($conf) = grep { !$_->{'name'} } @conf;
				}
			}
		$st->{'name'} = $in{'name'};
		$st->{'port'} = $in{'port'};
		$st->{'active'} = $in{'active'};
		if ($in{'pmode'} == 1) {
			$conf->{'values'}->{'cert'} = $webmin_pem;
			}
		elsif ($in{'pmode'} == 2) {
			$conf->{'values'}->{'cert'} = $in{'pem'};
			}
		else {
			delete($conf->{'values'}->{'cert'});
			}
		$conf->{'values'}->{'client'} = $in{'cmode'} ? 'yes' : 'no';
		if (!$in{'tcpw_def'}) {
			$conf->{'values'}->{'service'} = $in{'tcpw'};
			}
		else {
			delete($conf->{'values'}->{'service'});
			}
		if (!$in{'iface_def'}) {
			$conf->{'values'}->{'local'} = $in{'iface'};
			}
		else {
			delete($conf->{'values'}->{'local'});
			}
		if ($in{'mode'} == 0 || $in{'mode'} == 1) {
			# Running a command
			$conf->{'values'}->{'exec'} = $cmd;
			$conf->{'values'}->{'execargs'} = $args if ($args);
			$conf->{'values'}->{'pty'} = $in{'mode'} ? 'yes' : 'no';
			delete($conf->{'values'}->{'connect'});
			}
		else {
			# Connecting to remote host and port
			if ($in{'rhost'} eq 'localhost') {
				$conf->{'values'}->{'connect'} = $in{'rport'};
				}
			else {
				$conf->{'values'}->{'connect'} =
					"$in{'rhost'}:$in{'rport'}";
				}
			delete($conf->{'values'}->{'exec'});
			delete($conf->{'values'}->{'execargs'});
			delete($conf->{'values'}->{'pty'});
			}

		# Save this stunnel config file
		if ($in{'new'}) {
			&create_stunnel_service($conf, $cfile);
			}
		else {
			&modify_stunnel_service($conf, $cfile);
			}
		}
	else {
		# Old-style args format
		if ($in{'new'}) {
			$st = { 'args' => $stunnel_shortname,
				'command' => $config{'stunnel_path'},
				'type' => $in{'type'} };
			}
		else {
			$st->{'args'} = $in{'args'};
			}
		$st->{'name'} = $in{'name'};
		$st->{'port'} = $in{'port'};
		$st->{'active'} = $in{'active'};
		if ($in{'pmode'} == 1) {
			$st->{'args'} .= " -p $webmin_pem";
			}
		elsif ($in{'pmode'} == 2) {
			$st->{'args'} .= " -p $in{'pem'}";
			}
		if ($in{'cmode'}) {
			$st->{'args'} .= " -c";
			}
		if (!$in{'tcpw_def'}) {
			$st->{'args'} .= " -N $in{'tcpw'}";
			}
		if (!$in{'iface_def'}) {
			$st->{'args'} .= " -I $in{'iface'}";
			}
		if ($in{'mode'} == 0 || $in{'mode'} == 1) {
			# Running a command
			if ($in{'mode'} == 0) {
				$st->{'args'} .= " -l $cmd";
				}
			else {
				$st->{'args'} .= " -L $cmd";
				}
			if ($args) {
				$st->{'args'} .= " -- $args";
				}
			}
		else {
			# Connecting to remote host and port
			if ($in{'rhost'} eq 'localhost') {
				$st->{'args'} .= " -r $in{'rport'}";
				}
			else {
				$st->{'args'} .=" -r $in{'rhost'}:$in{'rport'}";
				}
			}
		}

	if ($in{'new'}) {
		&lock_create_file();
		&create_stunnel($st);
		}
	else {
		&lock_file($old{'file'});
		&modify_stunnel(\%old, $st);
		}
	}
&unlock_all_files();
&webmin_log($in{'delete'} ? "delete" : $in{'new'} ? "create" : "modify",
	    "stunnel", $st->{'name'}, $st);
&redirect("");


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 99 B 0644
apply.cgi File 187 B 0755
backup_config.pl File 1.09 KB 0755
config File 37 B 0644
config-coherent-linux File 31 B 0644
config-debian-linux File 31 B 0644
config-gentoo-linux File 31 B 0644
config-mandrake-linux File 31 B 0644
config-openSUSE-Linux-15.0-ALL File 31 B 0644
config-openmamba-linux File 31 B 0644
config-redhat-linux File 31 B 0644
config-redhat-linux-14-ALL File 30 B 0644
config-redhat-linux-18.0-ALL File 30 B 0644
config-suse-linux-8.2-ALL File 31 B 0644
config-syno-linux File 37 B 0644
config-trustix-linux File 31 B 0644
config-united-linux File 31 B 0644
config.info File 121 B 0644
config.info.ca File 139 B 0644
config.info.cs File 76 B 0644
config.info.de File 132 B 0644
config.info.es File 152 B 0644
config.info.fr File 140 B 0644
config.info.ms File 127 B 0644
config.info.nl File 125 B 0644
config.info.no File 119 B 0644
config.info.ru File 191 B 0644
config.info.uk File 216 B 0644
delete_tunnels.cgi File 651 B 0755
edit_stunnel.cgi File 5.68 KB 0755
feedback_files.pl File 205 B 0755
index.cgi File 3.95 KB 0755
install_check.pl File 378 B 0755
log_parser.pl File 536 B 0755
module.info File 188 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 169 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 179 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 247 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 210 B 0644
module.info.ca File 139 B 0644
module.info.ca.auto File 18 B 0644
module.info.cs File 19 B 0644
module.info.cs.auto File 137 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 163 B 0644
module.info.de File 100 B 0644
module.info.de.auto File 15 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 299 B 0644
module.info.es File 21 B 0644
module.info.es.auto File 130 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 163 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 227 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 165 B 0644
module.info.fr File 20 B 0644
module.info.fr.auto File 154 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 182 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 138 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 224 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 154 B 0644
module.info.ja File 161 B 0644
module.info.ja.auto File 21 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 189 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 189 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 168 B 0644
module.info.ms File 150 B 0644
module.info.ms.auto File 16 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 140 B 0644
module.info.nl File 20 B 0644
module.info.nl.auto File 130 B 0644
module.info.no File 22 B 0644
module.info.no.auto File 135 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 156 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 151 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 160 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 158 B 0644
module.info.ru File 27 B 0644
module.info.ru.auto File 201 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 171 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 147 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 161 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 219 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 183 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 238 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 256 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 181 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 134 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 143 B 0644
save_stunnel.cgi File 4.72 KB 0755
stunnel-lib.pl File 10.31 KB 0755