Linux ns8.secondary29.go.th 2.6.32-754.28.1.el6.x86_64 #1 SMP Wed Mar 11 18:38:45 UTC 2020 x86_64
Apache/2.2.15 (CentOS)
: 122.154.134.11 | : 122.154.134.9
Cant Read [ /etc/named.conf ]
5.6.40
apache
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
libexec /
webmin /
exports /
[ HOME SHELL ]
Name
Size
Permission
Action
help
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
lang
[ DIR ]
drwxr-xr-x
CHANGELOG
621
B
-rw-r--r--
backup_config.pl
643
B
-rwxr-xr-x
cgi_args.pl
215
B
-rwxr-xr-x
config-Amazon-Linux-2-ALL
84
B
-rw-r--r--
config-CentOS-Linux-7.0-ALL
84
B
-rw-r--r--
config-Redhat-Enterprise-Linux...
84
B
-rw-r--r--
config-Scientific-Linux-7.0-AL...
84
B
-rw-r--r--
config-aix
139
B
-rw-r--r--
config-cobalt-linux
248
B
-rw-r--r--
config-coherent-linux
200
B
-rw-r--r--
config-corel-linux
204
B
-rw-r--r--
config-debian-linux
204
B
-rw-r--r--
config-debian-linux-2.2
204
B
-rw-r--r--
config-debian-linux-3.0-ALL
206
B
-rw-r--r--
config-generic-linux
167
B
-rw-r--r--
config-gentoo-linux
190
B
-rw-r--r--
config-mandrake-linux
196
B
-rw-r--r--
config-msc-linux
190
B
-rw-r--r--
config-open-linux
200
B
-rw-r--r--
config-openmamba-linux
200
B
-rw-r--r--
config-pardus-linux
167
B
-rw-r--r--
config-redhat-linux
200
B
-rw-r--r--
config-redhat-linux-24.0-ALL
101
B
-rw-r--r--
config-slackware-linux
167
B
-rw-r--r--
config-slackware-linux-8.0-ALL
113
B
-rw-r--r--
config-sol-linux
167
B
-rw-r--r--
config-suse-linux
206
B
-rw-r--r--
config-suse-linux-7.1-ALL
204
B
-rw-r--r--
config-syno-linux
187
B
-rw-r--r--
config-trustix-linux
190
B
-rw-r--r--
config-turbo-linux
196
B
-rw-r--r--
config-united-linux
204
B
-rw-r--r--
config.info
170
B
-rw-r--r--
config.info.ca
204
B
-rw-r--r--
config.info.ca.UTF-8
206
B
-rw-r--r--
config.info.cz
142
B
-rw-r--r--
config.info.cz.UTF-8
150
B
-rw-r--r--
config.info.de
194
B
-rw-r--r--
config.info.de.UTF-8
194
B
-rw-r--r--
config.info.es
123
B
-rw-r--r--
config.info.es.UTF-8
123
B
-rw-r--r--
config.info.fr
165
B
-rw-r--r--
config.info.fr.UTF-8
165
B
-rw-r--r--
config.info.it
194
B
-rw-r--r--
config.info.it.UTF-8
194
B
-rw-r--r--
config.info.ms
125
B
-rw-r--r--
config.info.ms.UTF-8
125
B
-rw-r--r--
config.info.ms_MY
125
B
-rw-r--r--
config.info.ms_MY.UTF-8
125
B
-rw-r--r--
config.info.nl
195
B
-rw-r--r--
config.info.nl.UTF-8
195
B
-rw-r--r--
config.info.no
201
B
-rw-r--r--
config.info.no.UTF-8
201
B
-rw-r--r--
config.info.pl
162
B
-rw-r--r--
config.info.pl.UTF-8
162
B
-rw-r--r--
config.info.ru.UTF-8
243
B
-rw-r--r--
config.info.ru_RU
149
B
-rw-r--r--
config.info.ru_RU.UTF-8
243
B
-rw-r--r--
config.info.ru_SU
149
B
-rw-r--r--
config.info.sv
108
B
-rw-r--r--
config.info.sv.UTF-8
108
B
-rw-r--r--
config.info.tr
134
B
-rw-r--r--
config.info.uk_UA
152
B
-rw-r--r--
config.info.uk_UA.UTF-8
239
B
-rw-r--r--
config.info.zh_CN
77
B
-rw-r--r--
config.info.zh_CN.UTF-8
98
B
-rw-r--r--
config.info.zh_TW.Big5
79
B
-rw-r--r--
config.info.zh_TW.UTF-8
101
B
-rw-r--r--
delete_exports.cgi
956
B
-rwxr-xr-x
edit_export.cgi
6.17
KB
-rwxr-xr-x
exports-lib.pl
8.19
KB
-rwxr-xr-x
index.cgi
2.06
KB
-rwxr-xr-x
install_check.pl
354
B
-rwxr-xr-x
log_parser.pl
1.01
KB
-rwxr-xr-x
module.info
181
B
-rw-r--r--
module.info.ca
97
B
-rw-r--r--
module.info.ca.UTF-8
109
B
-rw-r--r--
module.info.cz
19
B
-rw-r--r--
module.info.cz.UTF-8
25
B
-rw-r--r--
module.info.de
102
B
-rw-r--r--
module.info.de.UTF-8
114
B
-rw-r--r--
module.info.es
29
B
-rw-r--r--
module.info.es.UTF-8
35
B
-rw-r--r--
module.info.fr
21
B
-rw-r--r--
module.info.fr.UTF-8
27
B
-rw-r--r--
module.info.it
25
B
-rw-r--r--
module.info.it.UTF-8
31
B
-rw-r--r--
module.info.ja_JP.UTF-8
40
B
-rw-r--r--
module.info.ja_JP.euc
32
B
-rw-r--r--
module.info.ko_KR.UTF-8
35
B
-rw-r--r--
module.info.ko_KR.euc
29
B
-rw-r--r--
module.info.ms_MY
102
B
-rw-r--r--
module.info.ms_MY.UTF-8
114
B
-rw-r--r--
module.info.nl
20
B
-rw-r--r--
module.info.nl.UTF-8
26
B
-rw-r--r--
module.info.no
22
B
-rw-r--r--
module.info.no.UTF-8
28
B
-rw-r--r--
module.info.pl
92
B
-rw-r--r--
module.info.pl.UTF-8
105
B
-rw-r--r--
module.info.pt
37
B
-rw-r--r--
module.info.pt.UTF-8
43
B
-rw-r--r--
module.info.ru.UTF-8
35
B
-rw-r--r--
module.info.ru_RU
24
B
-rw-r--r--
module.info.ru_RU.UTF-8
38
B
-rw-r--r--
module.info.ru_SU
24
B
-rw-r--r--
module.info.sv
24
B
-rw-r--r--
module.info.sv.UTF-8
30
B
-rw-r--r--
module.info.tr
22
B
-rw-r--r--
module.info.zh_CN
20
B
-rw-r--r--
module.info.zh_TW.Big5
25
B
-rw-r--r--
restart_mountd.cgi
296
B
-rwxr-xr-x
save_export.cgi
4.39
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : exports-lib.pl
# export-lib.pl # Common functions for the linux exports file use strict; use warnings; BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); our %access = &get_module_acl(); our ($module_root_directory, %text, %config, %gconfig); our @list_exports_cache; &foreign_require("mount", "mount-lib.pl"); # list_exports() # Returns a list of all exports sub list_exports { my (@rv, $pos, $h, $o, $line); return @list_exports_cache if (@list_exports_cache); open(EXP, $config{'exports_file'}); my $lnum = 0; while(my $line = <EXP>) { my $slnum = $lnum; $line =~ s/\s+$//g; while($line =~ /\\$/) { # continuation character! $line =~ s/\\$//; $line .= <EXP>; $line =~ s/\s+$//g; $lnum++; } if ($line =~ /^(#*)\s*(\/\S*)\s+(.*)$/) { my $active = !$1; my $dir = $2; my $rest = $3; if ($dir =~ /^$config{'exports_file'}/) { $lnum++; next; } $pos = 0; while($rest =~ /^([^\s+\(\)]*)\(([^\)]*)\)\s*(.*)$/ || $rest =~ /^([^\s+\(\)]+)\s*()(.*)$/) { my %exp; $exp{'active'} = $active; $exp{'dir'} = $dir; $exp{'host'} = $1; my $ostr = $2; $rest = $3; while($ostr =~ /^([a-z_]+)=([0-9,\-]+)\s*,\s*(.*)$/ || $ostr =~ /^([a-z_]+)=([0-9,\-]+)(.*)$/ || $ostr =~ /^([a-z_]+)=([^,\s]+),(.*)$/ || $ostr =~ /^([a-z_]+)=([^,\s]+)(.*)$/ || $ostr =~ /^([a-z_]+)()\s*,\s*(.*)$/ || $ostr =~ /^([a-z_]+)()(.*)$/) { if ($2 ne "") { $exp{'options'}->{$1} = $2; } else { $exp{'options'}->{$1} = ""; } $ostr = $3; } $exp{'line'} = $slnum; $exp{'eline'} = $lnum; $exp{'pos'} = $pos++; $exp{'index'} = scalar(@rv); push(@rv, \%exp); } } $lnum++; } close(EXP); @list_exports_cache = @rv; return @list_exports_cache; } # delete_export(&export) # Delete an existing export sub delete_export { my ($export) = @_; my @exps = &list_exports(); my @same = grep { $_ ne $export && $_->{'line'} eq $_[0]->{'line'} } @exps; my $lref = &read_file_lines($config{'exports_file'}); if (@same) { # other exports on the same line.. cannot totally delete splice(@$lref, $export->{'line'}, $export->{'eline'}-$export->{'line'}+1, &make_exports_line(@same)); map { $_->{'line'} = $_->{'eline'} = $export->{'line'} } @same; } else { # remove export line splice(@$lref, $export->{'line'}, $export->{'eline'}-$export->{'line'}+1); # unmount the directory if it is mounted with --bind my $dir = $_[0]->{'dir'}; my @mounted = &mount::list_mounted(); for(my $i=0; $i<@mounted; $i++) { my $p = $mounted[$i]; if (($p->[0] eq $dir) and ($p->[2] eq "bind")) { &mount::unmount_dir($p->[1], $p->[0], $p->[2]); } } # remove it from the fstab file my @mounts = &mount::list_mounts(); for(my $i=0; $i<@mounts; $i++) { my $p = $mounts[$i]; if (($p->[0] eq $dir) and ($p->[2] eq "bind")) { &mount::delete_mount($i); } } } @list_exports_cache = grep { $_ ne $export } @list_exports_cache; &flush_file_lines(); } # create_export_via_pfs(&export) sub create_export_via_pfs { my ($export) = @_; use File::Basename; use File::Path; my $export_pfs = 1; my $pfs = $export->{'pfs'}; $pfs =~ s/\/$//; # Check if the pfs is already exported my $lref = &read_file_lines($config{'exports_file'}, 1); foreach my $line (@$lref) { if ($line =~ /^$pfs[\s|\t]/) { if ($line !~ /fsid=0/) { &error(&text('save_pfs', $pfs)); } $export_pfs = 0; } } # Mount the directory in the pfs my $add_line = 1; my $to_be_mounted = 1; my $dir = $export->{'dir'}; my $expt_dir = $dir; $expt_dir =~ s/\/$//; $expt_dir = $pfs."/".basename($expt_dir); # Add it in the fstab file if it is not already in my @mounts = &mount::list_mounts(); for(my $i=0; $i<@mounts; $i++) { my $p = $mounts[$i]; if ($p->[0] eq $expt_dir && $p->[1] eq $dir && $p->[2] eq "bind") { $add_line = 0; } } if ($add_line) { &mount::create_mount($expt_dir, $dir, "bind", ""); } # Mount it if it is not already mounted my @mounted = &mount::list_mounted(); for(my $i=0; $i<@mounted; $i++) { my $p = $mounted[$i]; if ($p->[0] eq $expt_dir && $p->[1] eq $dir && $p->[2] eq "bind") { $to_be_mounted = 0; } } if ($to_be_mounted) { eval { mkpath($expt_dir) }; if ($@) { &error(&text('save_create_dir', $expt_dir)); } my $err = &mount::mount_dir($expt_dir, $dir, "bind", ""); &error($err) if ($err); } # Export the directory $expt_dir $export->{'dir'} = $expt_dir; &create_export($export); if ($export_pfs) { # Export the pfs with the "fsid=0" option $export->{'dir'} = $pfs; $export->{'options'}->{'fsid'} = "0"; &create_export($export); } } # create_export(&export) # Add one new export to the config file sub create_export { my ($export) = @_; my $fh = "EXP"; &open_tempfile($fh, ">>$config{'exports_file'}"); &print_tempfile($fh, &make_exports_line($export),"\n"); &close_tempfile($fh); } # modify_export(&export, &old) # Update one export in the config file sub modify_export { my ($export, $old) = @_; my @exps = &list_exports(); my @same = grep { $_->{'line'} eq $old->{'line'} } @exps; my $lref = &read_file_lines($config{'exports_file'}); if ($export->{'dir'} eq $old->{'dir'} && $export->{'active'} == $old->{'active'} || @same == 1) { # directory or active not changed, or on a line of it's own splice(@same, &indexof($old, @same), 1, $export); splice(@$lref, $old->{'line'}, $old->{'eline'} - $old->{'line'} + 1, &make_exports_line(@same)); } else { # move to a line of it's own splice(@same, &indexof($old, @same), 1); splice(@$lref, $old->{'line'}, $old->{'eline'} - $old->{'line'} + 1, &make_exports_line(@same)); push(@$lref, &make_exports_line($export)); } &flush_file_lines(); } # make_exports_line([&export]+) # Returns the text lines for one or more exports sub make_exports_line { my @htxt; foreach my $e (@_) { my %opts = $e->{'options'} ? %{$e->{'options'}} : ( ); if (%opts || !$e->{'host'}) { push(@htxt, $e->{'host'}."(". join(",", map { $opts{$_} eq "" ? $_ : "$_=$opts{$_}" } (keys %opts)).")"); } else { push(@htxt, $e->{'host'}); } } return ($_[0]->{'active'} ? "" : "#").$_[0]->{'dir'}."\t".join(" ", @htxt); } # nfs_max_version(host) # Return the max NFS version allowed on a server sub nfs_max_version { my ($host) = @_; my $max = 0; my $out = &backquote_command("rpcinfo -p ".quotemeta($host)." 2>&1"); if ($?) { # NFS server is down, take a guess based on kernel my $out = &backquote_command("uname -r"); if ($out =~ /^(\d+)\./ && $1 >= 3 || $out =~ /^(\d+)\.(\d+)\./ && $1 == 2 && $2 > 6) { return 4; } return 3; } foreach my $line (split(/\n/, $out)) { if ($line =~ / +(\d) +.*nfs/ && $1 > $max) { $max = $1; } } return $max; } # describe_host(host) # Given a host, regexp or netgroup return a human-readable version sub describe_host { my ($h) = @_; if ($h eq "=public") { return $text{'exports_webnfs'}; } elsif ($h =~ /^gss\//) { return &text('exports_gss', "<i>".&html_escape($h)."</i>"); } elsif ($h =~ /^\@(.*)/) { return &text('exports_ngroup', "<i>".&html_escape("$1")."</i>"); } elsif ($h =~ /^(\S+)\/(\S+)$/) { return &text('exports_net', "<i>".&html_escape("$1/$2")."</i>"); } elsif ($h eq "" || $h eq "*") { return $text{'exports_all'}; } elsif ($h =~ /\*/) { return &text('exports_hosts', "<i>".&html_escape($h)."</i>"); } else { return &text('exports_host', "<i>".&html_escape($h)."</i>"); } } # has_nfs_commands() # Returns 1 if all NFS server commands are installed sub has_nfs_commands { return !&has_command("rpc.nfsd") && !&has_command("nfsd") && !&has_command("rpc.knfsd") ? 0 : 1; } # restart_mountd() # Apply the /etc/exports configuration sub restart_mountd { # Try exportfs -r first if ($config{'apply_cmd'} && &find_byname("nfsd") && &find_byname("mountd")) { my $out = &backquote_logged("$config{'apply_cmd'} 2>&1 </dev/null"); if (!$? && $out !~ /invalid|error|failed/i) { # Looks like it worked! return undef; } } &system_logged("$config{'portmap_command'} >/dev/null 2>&1 </dev/null") if ($config{'portmap_command'}); my $temp = &transname(); my $rv = &system_logged("($config{'restart_command'}) </dev/null >$temp 2>&1"); my $out = &read_file_contents($temp); unlink($temp); if ($rv) { # something went wrong.. return an error return "<pre>".&html_escape($out)."</pre>"; } return undef; } 1;
Close