[ Avaa Bypassed ]




Upload:

Command:

www-data@3.21.104.216: ~ $
#!/usr/bin/perl
# Create, update or delete a log source

require './syslog-ng-lib.pl';
&ReadParse();
&error_setup($text{'source_err'});

# Get the old source
$conf = &get_config();
if (!$in{'new'}) {
	@sources = &find("source", $conf);
	($source) = grep { $_->{'value'} eq $in{'old'} } @sources;
	$source || &error($text{'source_egone'});
	$old = $source;
	}
else {
	$source = { 'name' => 'source',
		  'type' => 1,
		  'members' => [ ] };
	}

&lock_all_files($conf);
if ($in{'delete'}) {
	# Just delete it!
	&check_dependencies('source', $in{'old'}) &&
	    &error(&text('sdelete_eused', $in{'old'}));
	&save_directive($conf, undef, $source, undef, 0);
	}
else {
	# Validate inputs, and update object
	$in{'name'} =~ /^[a-z0-9_]+$/i || &error($text{'source_ename'});
	if ($in{'new'} || $in{'old'} ne $in{'name'}) {
		($clash) = grep { $_->{'value'} eq $in{'name'} } @sources;
		$clash && &error($text{'source_eclash'});
		}
	$source->{'values'} = [ $in{'name'} ];

	# Clear out all existing values
	$source->{'members'} = [ ];

	if ($in{'internal'}) {
		# Save internal option
		$internal = { 'name' => 'internal',
			      'type' => 0,
			      'values' => [ ] };
		&save_directive($conf, $source, undef, $internal, 1);
		}

	foreach $t ("unix-stream", "unix-dgram") {
		# Save Unix socket file option
		next if (!$in{$t});
		$in{$t.'_name'} =~ /^\/\S/ ||
			&error($text{'source_eunix_name'});
		$unix = { 'name' => $t,
			  'type' => 0,
			  'values' => [ $in{$t.'_name'} ] };
		&save_directive($conf, $source, undef, $unix, 1);

		# Save owner
		if (!$in{$t.'_owner_def'}) {
			defined(getpwnam($in{$t.'_owner'})) ||
				&error($text{'source_eowner'});
			&save_directive($conf, $unix, "owner",
					$in{$t.'_owner'}, 1);
			}
		if (!$in{$t.'_group_def'}) {
			defined(getgrnam($in{$t.'_group'})) ||
				&error($text{'source_egroup'});
			&save_directive($conf, $unix, "group",
					$in{$t.'_group'}, 1);
			}

		# Save permissions
		if (!$in{$t.'_perm_def'}) {
			$in{$t.'_perm'} =~ /^[0-7]+$/ ||
				&error($text{'source_eperm'});
			&save_directive($conf, $unix, "perm",
					$in{$t.'_perm'}, 1);
			}

		if ($t eq "unix-stream") {
			# Save keep-alive option
			if ($in{$t.'_keep'}) {
				&save_directive($conf, $unix, "keep-alive",
						$in{$t.'_keep'}, 1);
				}

			# Save max connections option
			if (!$in{$t.'_max_def'}) {
				$in{$t.'_max'} =~ /^\d+$/ ||
					&error($text{'source_emax'});
				&save_directive($conf, $unix, "max-connections",
						$in{$t.'_max'}, 1);
				}
			}
		}

	foreach $t ('tcp', 'udp') {
		# Save network socket file option
		next if (!$in{$t});
		$net = { 'name' => $t,
		         'type' => 0,
			 'values' => [ ] };
		&save_directive($conf, $source, undef, $net, 1);

		# Save local IP and port
		if (!$in{$t.'_ip_def'}) {
			&check_ipaddress($in{$t.'_ip'}) ||
				&error($text{'source_eip'});
			&save_directive($conf, $net, "ip",
					$in{$t.'_ip'}, 1);
			}
		if (!$in{$t.'_port_def'}) {
			$in{$t.'_port'} =~ /^\d+$/ ||
				&error($text{'source_eport'});
			&save_directive($conf, $net, "port",
					$in{$t.'_port'}, 1);
			}

		# Save TCP-specific options and max connections
		if ($t eq "tcp") {
			if ($in{$t.'_keep'}) {
				&save_directive($conf, $net, "keep-alive",
						$in{$t.'_keep'}, 1);
				}
			if ($in{$t.'_tkeep'}) {
				&save_directive($conf, $net, "tcp-keep-alive",
						$in{$t.'_tkeep'}, 1);
				}
			}
		if (!$in{$t.'_max_def'}) {
			$in{$t.'_max'} =~ /^\d+$/ ||
				&error($text{'source_emax'});
			&save_directive($conf, $net, "max-connections",
					$in{$t.'_max'}, 1);
			}
		}

	# Save kernel file option
	if ($in{'file'}) {
		$in{'file_name'} =~ /^\/\S/ ||
			&error($text{'source_efile_name'});
		$file = { 'name' => 'file',
		          'type' => 0,
			  'values' => [ $in{'file_name'} ] };
		&save_directive($conf, $source, undef, $file, 1);

		# Save log prefix
		if (!$in{'file_prefix_def'}) {
			$in{'file_prefix'} =~ /\S/ ||
			    &error($text{'source_eprefix'});
			&save_directive($conf, $file, "log_prefix",
					$in{'file_prefix'}, 1);
			}
		}

	# Save named pipe option
	if ($in{'pipe'}) {
		$in{'pipe_name'} =~ /^\/\S/ ||
			&error($text{'source_epipe_name'});
		$pipe = { 'name' => 'pipe',
		          'type' => 0,
			  'values' => [ $in{'pipe_name'} ] };
		&save_directive($conf, $source, undef, $pipe, 1);

		# Save log prefix and pad size
		if (!$in{'pipe_prefix_def'}) {
			$in{'pipe_prefix'} =~ /\S/ ||
			    &error($text{'source_eprefix'});
			&save_directive($conf, $pipe, "log_prefix",
					$in{'pipe_prefix'}, 1);
			}
		if (!$in{'pipe_pad_def'}) {
			$in{'pipe_pad'} =~ /^\d+$/ ||
			    &error($text{'source_epad'});
			&save_directive($conf, $pipe, "pad_size",
					$in{'pipe_pad'}, 1);
			}
		}
		
	# Save Solaris streams option
	if ($in{'sun-streams'}) {
		$in{'sun_streams_name'} =~ /^\/\S/ ||
			&error($text{'source_esun_streams_name'});
		$sun_streams = { 'name' => 'sun-streams',
				 'type' => 0,
				 'values' => [ $in{'sun_streams_name'} ] };
		&save_directive($conf, $source, undef, $sun_streams, 1);

		# Save door file
		$in{'sun_streams_door'} =~ /\S/ ||
		    &error($text{'source_edoor'});
		&save_directive($conf, $sun_streams, "door",
				$in{'sun_streams_door'}, 1);
		}

	# Save syslog protocol option
	if ($in{'network'}) {
		$net = { 'name' => 'network',
		         'type' => 0,
			 'values' => [ ] };
		&save_directive($conf, $source, undef, $net, 1);

		# Save local IP and port
		if (!$in{'network_ip_def'}) {
			&check_ipaddress($in{'network_ip'}) ||
				&error($text{'source_eip'});
			&save_directive($conf, $net, "ip",
					$in{'network_ip'}, 1);
			}
		if (!$in{'network_port_def'}) {
			$in{'network_port'} =~ /^\d+$/ ||
				&error($text{'source_eport'});
			&save_directive($conf, $net, "port",
					$in{'network_port'}, 1);
			}
		if ($in{'network_transport'}) {
			&save_directive($conf, $net, "transport",
					$in{'network_transport'}, 1);
			}
		}

	# Actually update the object
	&save_directive($conf, undef, $old, $source, 0);

	# Update dependent log targets
	if (!$in{'new'}) {
		&rename_dependencies('source', $in{'old'}, $in{'name'});
		}
	}

&unlock_all_files();
&webmin_log($in{'delete'} ? 'delete' : $in{'new'} ? 'create' : 'modify',
	    'source', $in{'old'} || $in{'name'});
&redirect("list_sources.cgi");


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 389 B 0644
apply.cgi File 202 B 0755
backup_config.pl File 617 B 0755
config File 190 B 0644
config-AlmaLinux-7.0-ALL File 188 B 0644
config-Amazon-Linux-2-ALL File 188 B 0644
config-CentOS-Linux-7.0-ALL File 190 B 0644
config-CentOS-Stream-Linux-8.0-ALL File 188 B 0644
config-CloudLinux-8.0-ALL File 188 B 0644
config-Oracle-Linux-8.0-ALL File 188 B 0644
config-Redhat-Enterprise-Linux-7.0-ALL File 188 B 0644
config-Rocky-Linux-7.0-ALL File 188 B 0644
config-Scientific-Linux-7.0-ALL File 188 B 0644
config-debian-linux File 196 B 0644
config-freebsd File 225 B 0644
config-gentoo-linux File 211 B 0644
config-openSUSE-Linux-15.0-ALL File 128 B 0644
config-openmamba-linux File 186 B 0644
config-redhat-linux-12.0-23.0 File 196 B 0644
config-redhat-linux-24.0-ALL File 176 B 0644
config-solaris File 197 B 0644
config-suse-linux File 128 B 0644
config-syno-linux File 122 B 0644
config.info File 575 B 0644
config.info.ca File 673 B 0644
config.info.de File 687 B 0644
config.info.hu File 0 B 0644
config.info.nl File 651 B 0644
config.info.no File 613 B 0644
delete_destinations.cgi File 710 B 0755
delete_filters.cgi File 667 B 0755
delete_logs.cgi File 549 B 0755
delete_sources.cgi File 667 B 0755
edit_destination.cgi File 6.76 KB 0755
edit_filter.cgi File 4.24 KB 0755
edit_log.cgi File 2.22 KB 0755
edit_source.cgi File 9.59 KB 0755
index.cgi File 1.9 KB 0755
install_check.pl File 419 B 0755
list_destinations.cgi File 1.88 KB 0755
list_filters.cgi File 1.1 KB 0755
list_logs.cgi File 1.23 KB 0755
list_options.cgi File 5.63 KB 0755
list_sources.cgi File 1.04 KB 0755
log_parser.pl File 685 B 0755
module.info File 148 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 104 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 152 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 194 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 249 B 0644
module.info.ca File 130 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 131 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 104 B 0644
module.info.de File 112 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 225 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 123 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 134 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 204 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 120 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 127 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 151 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 136 B 0644
module.info.hu File 38 B 0644
module.info.hu.auto File 97 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 127 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 138 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 126 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 141 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 125 B 0644
module.info.ms File 111 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 123 B 0644
module.info.nl File 23 B 0644
module.info.nl.auto File 89 B 0644
module.info.no File 25 B 0644
module.info.no.auto File 78 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 112 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 119 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 125 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 136 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 188 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 133 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 127 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 107 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 207 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 136 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 194 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 179 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 160 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 103 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 109 B 0644
prefs.info File 44 B 0644
save_destination.cgi File 4.99 KB 0755
save_filter.cgi File 3.64 KB 0755
save_log.cgi File 1.94 KB 0755
save_options.cgi File 2.08 KB 0755
save_source.cgi File 6.11 KB 0755
start.cgi File 198 B 0755
stop.cgi File 194 B 0755
syslog-ng-lib.pl File 20.61 KB 0755
view_log.cgi File 2.92 KB 0755