[ Avaa Bypassed ]




Upload:

Command:

www-data@3.17.145.236: ~ $
#!/usr/bin/perl
# save_serv.cgi
# Save or create an internet service. This can be called N ways
#  - create a new services file entry
#  - create a new inetd.conf entry (and maybe update or add to services file)
#  - update inetd.conf (and maybe services)
#  - remove an entry from inetd.conf (and maybe change services)

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

# Delete button clicked, redirect to correct CGI
if ($in{'delete'}) {
	&redirect("delete_serv.cgi?spos=$in{'spos'}&ipos=$in{'ipos'}");
	return;
	}

# Check inputs
$in{'name'} =~ /^[A-z][A-z0-9\_\-]+$/ ||
	&error(&text('error_invalidservice' ,$in{'name'}));
$in{'port'} =~ /^[0-9]*$/ || &error(&text('error_invalidport', $in{'port'}));
if ($in{'port'} <= 0 || $in{'port'} > 65535) {
	&error(&text('error_portnum', $in{'port'}));
	}
if ($in{'act'} && $in{'serv'} == 2) {
	$in{'program'} =~ /^\/\S+$/ ||
		&error(&text('error_invalidprg', $in{program}));
	if ($in{'act'} == 2) {
		if (!$in{'qm'}) {
			-r $in{'program'} ||
				&error(&text('error_notexist', $in{'program'}));
			-x $in{'program'} ||
				&error(&text('error_notexecutable', $in{'program'}));
			}
		}
	$in{'args'} =~ /^\S+/ ||&error(&text('error_invalidarg', $in{'args'}));
	}
elsif ($in{'act'} && $in{serv} == 3) {
	$in{tcpd} =~ /^\S+$/ ||
		&error(&text('error_invalidwrapper', $in{tcpd}));
	}
if ($in{'act'}) {
	$in{'user'} || &error($text{'error_nouser'});
	defined(getpwnam($in{'user'})) || &error($text{'error_user'});
	if ($config{'extended_inetd'} == 1) {
		$in{'group_def'} || defined(getgrnam($in{'group'})) ||
			&error($text{'error_group'});
		}
	}
if ($config{'extended_inetd'} && !$in{'permin_def'} && $in{'permin'}!~/^\d+$/) {
	&error(&text('error_invalidpermin', $in{'permin'}));
	}
if ($config{'extended_inetd'} == 2 &&
    !$in{'child_def'} && $in{'child'} !~ /^\d+$/) {
	&error(&text('error_invalidchildnum', $in{'child'}));
	}

# Build argument list
@sargs = ($in{'name'}, $in{'port'}, $in{'protocol'},
	  join(' ', split(/\s+/, $in{'aliases'})) );
@iargs = ($in{'act'} == 2, $in{'name'},
	  $in{'protocol'} =~ /^tcp/ ? "stream" : "dgram", $in{'protocol'});
$wait = $in{'wait'};
$user = $in{'user'};
if ($config{'extended_inetd'} == 1) {
	if (!$in{'permin_def'}) { $wait .= ".$in{'permin'}"; }
	if (!$in{'group_def'}) { $user .= ".$in{'group'}"; }
	}
elsif ($config{'extended_inetd'} == 2) {
	if (!$in{'child_def'}) { $wait .= "/$in{'child'}"; }
	if (!$in{'permin_def'} && $in{'child_def'}) {
		&error($text{'error_childnum'});
		}
	if (!$in{'permin_def'}) { $wait .= "/$in{'permin'}"; }
	if ($in{'group'}) { $user .= ":$in{'group'}"; }
	if ($in{'class'}) { $user .= "/$in{'class'}"; }
	}
push(@iargs, $wait);
push(@iargs, $user);
if (($in{'serv'} == 1) & (!$config{'no_internal'})) {
	push(@iargs, "internal", undef);
	}
elsif (($in{'serv'} == 1) & ($config{'no_internal'})) {
	&error(&text('error_invalidcmd', $in{args}));
	}
elsif ($in{serv} == 2) {
	push(@iargs, ($in{'qm'} ? "?" : "").$in{'program'});
	push(@iargs, $in{'args'});
	}
elsif ($in{serv} == 3) {
	push(@iargs, $config{'tcpd_path'});
	push(@iargs, $in{'tcpd'});
	$iargs[$#iargs] .= " $in{'args2'}" if ($in{'args2'});
	}

&lock_inetd_files();
@servs = &list_services();
@inets = &list_inets();
foreach $s (@servs) {
	if ($s->[1] eq $sargs[0] && $s->[3] eq $sargs[2]) { $same_name = $s; }
	if ($s->[2] == $sargs[1] && $s->[3] eq $sargs[2]) { $same_port = $s; }
	}

if ($in{'spos'} =~ /\d/) {
	# Changing a service..
	@old_serv = @{$servs[$in{'spos'}]};
	if ($in{'ipos'} =~ /\d/) {
		@old_inet = @{$inets[$in{'ipos'}]};
		}
	if ($old_serv[1] ne $sargs[0] || $old_serv[2] != $sargs[1] ||
	    $old_serv[3] ne $sargs[2]) {
		if ($same_name && $same_name->[2] != $old_serv[2]) {
			&error(&text('error_nameexist', $sargs[0], $sargs[2]));
			}
		if ($same_port && $same_port->[1] ne $old_serv[1]) {
			&error(&text('error_serviceexist', $sargs[1], $sargs[2]));
			}
		}
	&modify_service($old_serv[0], @sargs);
	if ($in{'act'} && @old_inet) {
		# modify inetd
		&modify_inet($old_inet[0], @iargs, $old_inet[10]);
		}
	elsif ($in{'act'} && !@old_inet) {
		# add to inetd
		&create_inet(@iargs);
		}
	elsif (!$in{'act'} && @old_inet) {
		# remove from inetd
		&delete_inet($old_inet[0], $old_inet[10]);
		@iargs = ();
		}
	&unlock_inetd_files();
	&webmin_log("modify", "serv", $sargs[0],
		    { 'name' => $sargs[0], 'port' => $sargs[1],
		      'proto' => $sargs[2], 'active' => $iargs[0],
		      'user' => $iargs[5], 'wait' => $iargs[4],
		      'prog' => $in{'act'} ? join(" ", @iargs[6..@iargs-1])
					   : undef } );
	}
else {
	# Creating a new service...
	# Check for a service with the same name or port and protocol
	if ($same_name) {
		&error(&text('error_nameexist', $sargs[0], $sargs[2]));
		}
	if ($same_port) {
		&error(&text('error_serviceexist', $sargs[1], $sargs[2]));
		}
	# Check for an existing internet service
	if ($in{'act'}) {
		foreach $i (@inets) {
			if ($i->[3] eq $iargs[1] && $i->[5] eq $iargs[3]) {
				&error(&text('error_inetservice', $i->[3], $i->[5]));
				}
			}
		}
	&create_service(@sargs);
	if ($in{'act'}) { &create_inet(@iargs); }
	&unlock_inetd_files();
	&webmin_log("create", "serv", $sargs[0],
		    { 'name' => $sargs[0], 'port' => $sargs[1],
		      'proto' => $sargs[2], 'active' => $iargs[0],
		      'user' => $iargs[5], 'wait' => $iargs[4],
		      'prog' => $in{'act'} ? join(" ", @iargs[6..@iargs-1])
					   : undef } );
	}
&redirect("");


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 173 B 0644
backup_config.pl File 754 B 0755
cgi_args.pl File 145 B 0755
config-aix File 302 B 0644
config-cobalt-linux File 331 B 0644
config-coherent-linux File 362 B 0644
config-corel-linux File 331 B 0644
config-debian-linux File 331 B 0644
config-freebsd File 252 B 0644
config-freebsd-2.1-2.2 File 252 B 0644
config-freebsd-8-ALL File 262 B 0644
config-generic-linux File 277 B 0644
config-hpux File 242 B 0644
config-irix File 252 B 0644
config-lfs-linux File 331 B 0644
config-macos File 469 B 0644
config-macos-1.5-ALL File 352 B 0644
config-mandrake-linux File 353 B 0644
config-msc-linux File 357 B 0644
config-netbsd File 252 B 0644
config-open-linux File 331 B 0644
config-open-linux-3.1e File 353 B 0644
config-openSUSE-Linux-15.0-ALL File 331 B 0644
config-openbsd File 235 B 0644
config-openmamba-linux File 362 B 0644
config-openserver File 323 B 0644
config-osf1 File 302 B 0644
config-pardus-linux File 332 B 0644
config-redhat-linux File 362 B 0644
config-slackware-linux File 282 B 0644
config-sol-linux File 277 B 0644
config-solaris File 353 B 0644
config-solaris-10-ALL File 335 B 0644
config-solaris-8-9 File 353 B 0644
config-suse-linux File 331 B 0644
config-suse-linux-6.3-8.0 File 331 B 0644
config-turbo-linux File 331 B 0644
config-united-linux File 358 B 0644
config-unixware File 323 B 0644
config-windows File 145 B 0644
config.info File 797 B 0644
config.info.ca File 879 B 0644
config.info.cs File 874 B 0644
config.info.de File 944 B 0644
config.info.es File 759 B 0644
config.info.fr File 867 B 0644
config.info.hu File 668 B 0644
config.info.nl File 818 B 0644
config.info.no File 852 B 0644
config.info.pl File 723 B 0644
config.info.ru File 767 B 0644
config.info.sv File 691 B 0644
config.info.tr File 620 B 0644
config.info.uk File 788 B 0644
config.info.zh File 545 B 0644
config.info.zh_TW File 513 B 0644
delete_rpc.cgi File 568 B 0755
delete_serv.cgi File 610 B 0755
edit_rpc.cgi File 4.19 KB 0755
edit_serv.cgi File 4.63 KB 0755
index.cgi File 4.03 KB 0755
inetd-generic-lib.pl File 4.43 KB 0755
inetd-lib.pl File 2.02 KB 0755
inetd-solaris-10-lib.pl File 8.45 KB 0755
install_check.pl File 336 B 0755
log_parser.pl File 892 B 0755
module.info File 239 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 111 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 146 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 159 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 158 B 0644
module.info.ca File 0 B 0644
module.info.ca.auto File 112 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 111 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 119 B 0644
module.info.de File 0 B 0644
module.info.de.auto File 126 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 190 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 116 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 118 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 136 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 113 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 122 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 136 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 111 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 143 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 114 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 140 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 154 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 115 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 122 B 0644
module.info.ms File 0 B 0644
module.info.ms.auto File 122 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 119 B 0644
module.info.nl File 0 B 0644
module.info.nl.auto File 116 B 0644
module.info.no File 0 B 0644
module.info.no.auto File 118 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 124 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 113 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 119 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 123 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 161 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 111 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 115 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 119 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 190 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 119 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 157 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 191 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 137 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 110 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 116 B 0644
prefs.info File 29 B 0644
restart_inetd.cgi File 296 B 0755
save_rpc.cgi File 3.82 KB 0755
save_serv.cgi File 5.31 KB 0755