[ Avaa Bypassed ]




Upload:

Command:

www-data@13.58.229.23: ~ $
#!/usr/bin/perl
# swat.cgi
# Pass everything to samba's SWAT tool

require './samba-lib.pl';
&ReadParse();

# check acls

&error_setup("$text{'eacl_aviol'}ask_epass.cgi");
&error("$text{'eacl_np'} $text{'eacl_pcswat'}") unless $access{'swat'};

# Check is hosts allow is in force
&get_share("global");
if (&getval('allow hosts')) {
	&ui_print_header(undef, $text{'error'}, "");
	print &text('swat_msg3', $text{'sec_onlyallow'}), "<p>\n";
	&foreign_require("inetd", "inetd-lib.pl");
	local @inets = &foreign_call("inetd", "list_inets");
	foreach $i (@inets) {
		if ($i->[3] eq 'swat' && $i->[1]) {
			# swat is configured in inetd!
			local $p = getservbyname('swat', 'tcp');
			$url = "http://$ENV{'SERVER_NAME'}:$p/";
			print &text('swat_msg4', "<a href='$url'>$url</a>"), "<p>\n";
			}
		}
	&ui_print_footer("", $text{'index_sharelist'});
	exit;
	}

# Check if we have the password
&read_file("$module_config_directory/swat", \%swat) || &ask_password();

# Execute SWAT process
pipe(OUTr, OUTw);
pipe(INr, INw);
local $pid = fork();
if (!$pid) {
	untie(*STDIN);
	untie(*STDOUT);
	untie(*STDERR);
	open(STDIN, "<&INr");
	open(STDOUT, ">&OUTw");
	open(STDERR, ">&OUTw");
	close(OUTr); close(INw);
	undef %ENV;
	exec($config{'swat_path'});
	print "Exec failed : $!\n";
	exit 1;
	}
close(OUTw); close(INr);

# Feed HTTP request and read output
$auth = &encode_base64("$swat{'user'}:$swat{'pass'}");
$auth =~ s/\n//g;
select(INw); $| = 1; select(STDOUT);
$path = $ENV{'PATH_INFO'} || "/";
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
	print INw "GET $path?$in HTTP/1.0\n";
	print INw "Authorization: basic $auth\n";
	print INw "\n";
	}
else {
	print INw "POST $path HTTP/1.0\r\n";
	print INw "Authorization: basic $auth\r\n";
	print INw "Content-length: ",length($in),"\r\n";
	print INw "Content-type: application/x-www-form-urlencoded\r\n";
	print INw "\r\n",$in;
	}
close(INw);
$reply = <OUTr>;
if ($reply =~ /\s401\s/) {
	&ask_password();
	}
if ($ENV{'PATH_INFO'} =~ /\.(gif|jpg|jpeg|png)$/i) {
	# An image .. just output it
	while(<OUTr>) { print; }
	}
else {
	# An HTML page .. fix up links
	$url = "@{[&get_webprefix()]}/$module_name/swat.cgi";
	while(<OUTr>) {
		s/src="(\/[^"]*)"/src="$url$1"/gi;
		s/href="(\/[^"]*)"/href="$url$1"/gi;
		s/action="(\/[^"]*)"/action="$url$1"/gi;
		s/"(\/status?[^"]*)"/"$url$1"/gi;
		print $_ if (!/<\/body>/i && !/<\/html>/i);
		}
	print "<table width=100% cellpadding=0 cellspacing=0><tr><td>\n";
	&ui_print_footer("/$module_name/", $text{'index_sharelist'}, 1);
	print "</td> <td align=right><a href='/$module_name/logout.cgi'>",
	      "$text{'swat_logout'}</a></td> </tr></table></body></html>\n";
	}

sub ask_password
{
&ui_print_header(undef, $text{'swat_title'}, "");
if (%swat) {
	print $text{'swat_msg1'}, " <br>\n";
	}
else {
	print $text{'swat_msg2'}, " <br>\n";
	}
print "<center>\n";
print &ui_form_start("swat_save.cgi");
print &ui_table_start($text{'swat_list'}, undef, 2);

print &ui_table_row($text{'swat_username'},
	&ui_textbox("user", $swat{'user'}, 20));

print &ui_table_row($text{'swat_password'},
	&ui_password("pass", undef, 20));

print &ui_table_end();
print &ui_form_end([ [ undef, $text{'swat_login'} ] ]);
print "</center>\n";

&ui_print_footer("", $text{'index_sharelist'});
exit;
}


Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 2.06 KB 0644
acl_security.pl File 12.76 KB 0755
ask_epass.cgi File 1.46 KB 0755
backup_config.pl File 752 B 0755
cgi_args.pl File 1012 B 0755
conf_bind.cgi File 1.56 KB 0755
conf_misc.cgi File 2.05 KB 0755
conf_net.cgi File 2.6 KB 0755
conf_pass.cgi File 2.36 KB 0755
conf_print.cgi File 1.17 KB 0755
conf_smb.cgi File 3.75 KB 0755
config-AlmaLinux-7.0-ALL File 533 B 0644
config-Amazon-Linux-2-ALL File 488 B 0644
config-CentOS-Linux-7.0-ALL File 533 B 0644
config-CentOS-Stream-Linux-8.0-ALL File 533 B 0644
config-CloudLinux-8.0-ALL File 533 B 0644
config-Oracle-Linux-8.0-ALL File 533 B 0644
config-Redhat-Enterprise-Linux-7.0-ALL File 488 B 0644
config-Rocky-Linux-7.0-ALL File 533 B 0644
config-Scientific-Linux-7.0-ALL File 488 B 0644
config-aix File 539 B 0644
config-cobalt-linux File 418 B 0644
config-coherent-linux File 502 B 0644
config-corel-linux File 405 B 0644
config-debian-linux File 427 B 0644
config-debian-linux-2.1 File 405 B 0644
config-debian-linux-2.2-7.9 File 690 B 0644
config-debian-linux-8.0-ALL File 578 B 0644
config-freebsd File 721 B 0644
config-freebsd-8-ALL File 813 B 0644
config-generic-linux File 547 B 0644
config-gentoo-linux File 545 B 0644
config-hpux File 574 B 0644
config-irix File 593 B 0644
config-lfs-linux File 418 B 0644
config-macos File 621 B 0644
config-macos-1.5-ALL File 517 B 0644
config-mandrake-linux File 476 B 0644
config-mandrake-linux-8.1-ALL File 484 B 0644
config-msc-linux File 480 B 0644
config-netbsd File 642 B 0644
config-open-linux File 482 B 0644
config-openSUSE-Linux-15.0-ALL File 519 B 0644
config-openbsd File 647 B 0644
config-openmamba-linux File 496 B 0644
config-openserver File 593 B 0644
config-osf1 File 593 B 0644
config-pardus-linux File 403 B 0644
config-redhat-linux File 490 B 0644
config-redhat-linux-10.0-15.0 File 502 B 0644
config-redhat-linux-16.0-23.0 File 559 B 0644
config-redhat-linux-24.0-ALL File 563 B 0644
config-redhat-linux-7.0-9.0 File 502 B 0644
config-slackware-linux File 452 B 0644
config-slackware-linux-7.0-7.1 File 470 B 0644
config-slackware-linux-8.0-ALL File 533 B 0644
config-sol-linux File 528 B 0644
config-solaris File 593 B 0644
config-solaris-10-ALL File 461 B 0644
config-solaris-8-9 File 533 B 0644
config-suse-linux File 452 B 0644
config-suse-linux-13.0-ALL File 494 B 0644
config-suse-linux-7.3-8.0 File 470 B 0644
config-suse-linux-8.2-12.9 File 545 B 0644
config-syno-linux File 293 B 0644
config-trustix-linux File 492 B 0644
config-turbo-linux File 418 B 0644
config-united-linux File 492 B 0644
config-unixware File 593 B 0644
config.info File 918 B 0644
config.info.bg File 1.54 KB 0644
config.info.ca File 1.02 KB 0644
config.info.cs File 746 B 0644
config.info.da File 991 B 0644
config.info.de File 1.15 KB 0644
config.info.es File 880 B 0644
config.info.fa File 1.09 KB 0644
config.info.fr File 940 B 0644
config.info.ja File 834 B 0644
config.info.nl File 953 B 0644
config.info.no File 975 B 0644
config.info.pl File 1.08 KB 0644
config.info.pt_BR File 869 B 0644
config.info.ru File 891 B 0644
config.info.ru.UTF-8 File 887 B 0644
config.info.sv File 638 B 0644
config.info.tr File 442 B 0644
config.info.uk File 939 B 0644
config.info.zh File 510 B 0644
config.info.zh_TW File 748 B 0644
create_copy.cgi File 735 B 0755
defaultacl File 369 B 0644
delete_euser.cgi File 464 B 0755
delete_share.cgi File 632 B 0755
delete_shares.cgi File 607 B 0755
edit_epass.cgi File 880 B 0755
edit_euser.cgi File 2.59 KB 0755
edit_fmisc.cgi File 2.21 KB 0755
edit_fname.cgi File 1.74 KB 0755
edit_fperm.cgi File 1.85 KB 0755
edit_fshare.cgi File 3.2 KB 0755
edit_group.cgi File 1.82 KB 0755
edit_gsync.cgi File 1.08 KB 0755
edit_manual.cgi File 583 B 0755
edit_popts.cgi File 1.82 KB 0755
edit_pshare.cgi File 3.27 KB 0755
edit_sec.cgi File 3.06 KB 0755
edit_sync.cgi File 1.23 KB 0755
edit_winbind.cgi File 800 B 0755
index.cgi File 9.34 KB 0755
install_check.pl File 365 B 0755
kill_user.cgi File 719 B 0755
kill_users.cgi File 783 B 0755
list_groups.cgi File 1.11 KB 0755
log_parser.pl File 1.78 KB 0755
logout.cgi File 305 B 0755
make_epass.cgi File 4.24 KB 0755
module.info File 246 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 117 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 165 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 179 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 212 B 0644
module.info.ca File 104 B 0644
module.info.ca.auto File 24 B 0644
module.info.cs File 47 B 0644
module.info.cs.auto File 104 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 114 B 0644
module.info.de File 106 B 0644
module.info.de.auto File 22 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 264 B 0644
module.info.es File 60 B 0644
module.info.es.auto File 100 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 143 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 180 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 130 B 0644
module.info.fr File 47 B 0644
module.info.fr.auto File 96 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 145 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 144 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 158 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 124 B 0644
module.info.ja File 41 B 0644
module.info.ja.auto File 119 B 0644
module.info.ko File 39 B 0644
module.info.ko.auto File 107 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 157 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 149 B 0644
module.info.ms File 104 B 0644
module.info.ms.auto File 23 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 120 B 0644
module.info.nl File 34 B 0644
module.info.nl.auto File 88 B 0644
module.info.no File 32 B 0644
module.info.no.auto File 82 B 0644
module.info.pl File 125 B 0644
module.info.pl.auto File 24 B 0644
module.info.pt File 51 B 0644
module.info.pt.auto File 98 B 0644
module.info.pt_BR File 60 B 0644
module.info.pt_BR.auto File 104 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 141 B 0644
module.info.ru File 36 B 0644
module.info.ru.auto File 151 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 136 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 138 B 0644
module.info.sv File 29 B 0644
module.info.sv.auto File 88 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 235 B 0644
module.info.tr File 41 B 0644
module.info.tr.auto File 115 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 226 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 207 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 133 B 0644
module.info.zh File 35 B 0644
module.info.zh.auto File 78 B 0644
module.info.zh_TW File 36 B 0644
module.info.zh_TW.auto File 84 B 0644
opts.pl.dev File 6.37 KB 0644
prefs.info File 17 B 0644
rbac-mapping File 457 B 0644
readonly-share.pl File 477 B 0755
readwrite-share.pl File 481 B 0755
restart.cgi File 1.33 KB 0755
restart_wb.cgi File 816 B 0755
samba-lib.pl File 25.98 KB 0755
save_bind.cgi File 1.34 KB 0755
save_copy.cgi File 711 B 0755
save_euser.cgi File 1.62 KB 0755
save_fmisc.cgi File 1.37 KB 0755
save_fname.cgi File 1012 B 0755
save_fperm.cgi File 1.13 KB 0755
save_fshare.cgi File 2.63 KB 0755
save_group.cgi File 1.2 KB 0755
save_gsync.cgi File 522 B 0755
save_manual.cgi File 395 B 0755
save_misc.cgi File 2.05 KB 0755
save_net.cgi File 1.75 KB 0755
save_pass.cgi File 2.17 KB 0755
save_popts.cgi File 1.2 KB 0755
save_print.cgi File 916 B 0755
save_pshare.cgi File 2.22 KB 0755
save_sec.cgi File 2.14 KB 0755
save_smb.cgi File 2.21 KB 0755
save_sync.cgi File 691 B 0755
save_winbind.cgi File 902 B 0755
set-hostname-workgroup.pl File 737 B 0755
smbhash.pl File 17.88 KB 0755
start.cgi File 748 B 0755
start_wb.cgi File 621 B 0755
stop.cgi File 492 B 0755
stop_wb.cgi File 422 B 0755
swat.cgi File 3.17 KB 0755
swat_save.cgi File 515 B 0755
useradmin_update.pl File 4.69 KB 0755
view_users.cgi File 3.04 KB 0755