Linux server.thearyasamaj.org 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
Apache
: 103.90.241.146 | : 216.73.216.158
Cant Read [ /etc/named.conf ]
5.6.40
ftpuser@mantra.thearyasamaj.org
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 /
usermin /
ssh /
[ HOME SHELL ]
Name
Size
Permission
Action
help
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
lang
[ DIR ]
drwxr-xr-x
ulang
[ DIR ]
drwxr-xr-x
CHANGELOG
793
B
-rw-r--r--
delete_knowns.cgi
355
B
-rwxr-xr-x
download_key.cgi
312
B
-rwxr-xr-x
edit_auth.cgi
2.63
KB
-rwxr-xr-x
edit_host.cgi
5.81
KB
-rwxr-xr-x
edit_key.cgi
1.24
KB
-rwxr-xr-x
edit_known.cgi
2.18
KB
-rwxr-xr-x
index.cgi
1.25
KB
-rwxr-xr-x
list_auths.cgi
880
B
-rwxr-xr-x
list_hosts.cgi
705
B
-rwxr-xr-x
list_keys.cgi
1.29
KB
-rwxr-xr-x
list_knowns.cgi
1.22
KB
-rwxr-xr-x
module.info
179
B
-rw-r--r--
module.info.af
0
B
-rw-r--r--
module.info.af.auto
143
B
-rw-r--r--
module.info.ar
0
B
-rw-r--r--
module.info.ar.auto
191
B
-rw-r--r--
module.info.be
0
B
-rw-r--r--
module.info.be.auto
229
B
-rw-r--r--
module.info.bg
0
B
-rw-r--r--
module.info.bg.auto
258
B
-rw-r--r--
module.info.ca
29
B
-rw-r--r--
module.info.ca.auto
122
B
-rw-r--r--
module.info.cs
24
B
-rw-r--r--
module.info.cs.auto
121
B
-rw-r--r--
module.info.da
0
B
-rw-r--r--
module.info.da.auto
144
B
-rw-r--r--
module.info.de
145
B
-rw-r--r--
module.info.el
0
B
-rw-r--r--
module.info.el.auto
318
B
-rw-r--r--
module.info.es
0
B
-rw-r--r--
module.info.es.auto
153
B
-rw-r--r--
module.info.eu
0
B
-rw-r--r--
module.info.eu.auto
152
B
-rw-r--r--
module.info.fa
0
B
-rw-r--r--
module.info.fa.auto
202
B
-rw-r--r--
module.info.fi
0
B
-rw-r--r--
module.info.fi.auto
160
B
-rw-r--r--
module.info.fr
0
B
-rw-r--r--
module.info.fr.auto
159
B
-rw-r--r--
module.info.he
0
B
-rw-r--r--
module.info.he.auto
182
B
-rw-r--r--
module.info.hr
0
B
-rw-r--r--
module.info.hr.auto
147
B
-rw-r--r--
module.info.hu
27
B
-rw-r--r--
module.info.hu.auto
149
B
-rw-r--r--
module.info.it
0
B
-rw-r--r--
module.info.it.auto
149
B
-rw-r--r--
module.info.ja
0
B
-rw-r--r--
module.info.ja.auto
142
B
-rw-r--r--
module.info.ko
0
B
-rw-r--r--
module.info.ko.auto
143
B
-rw-r--r--
module.info.lt
0
B
-rw-r--r--
module.info.lt.auto
162
B
-rw-r--r--
module.info.lv
0
B
-rw-r--r--
module.info.lv.auto
154
B
-rw-r--r--
module.info.ms
0
B
-rw-r--r--
module.info.ms.auto
145
B
-rw-r--r--
module.info.mt
0
B
-rw-r--r--
module.info.mt.auto
161
B
-rw-r--r--
module.info.nl
25
B
-rw-r--r--
module.info.nl.auto
117
B
-rw-r--r--
module.info.no
26
B
-rw-r--r--
module.info.no.auto
118
B
-rw-r--r--
module.info.pl
0
B
-rw-r--r--
module.info.pl.auto
138
B
-rw-r--r--
module.info.pt
0
B
-rw-r--r--
module.info.pt.auto
148
B
-rw-r--r--
module.info.pt_BR
0
B
-rw-r--r--
module.info.pt_BR.auto
154
B
-rw-r--r--
module.info.ro
0
B
-rw-r--r--
module.info.ro.auto
147
B
-rw-r--r--
module.info.ru
0
B
-rw-r--r--
module.info.ru.auto
252
B
-rw-r--r--
module.info.sk
0
B
-rw-r--r--
module.info.sk.auto
152
B
-rw-r--r--
module.info.sl
0
B
-rw-r--r--
module.info.sl.auto
148
B
-rw-r--r--
module.info.sv
0
B
-rw-r--r--
module.info.sv.auto
146
B
-rw-r--r--
module.info.th
0
B
-rw-r--r--
module.info.th.auto
307
B
-rw-r--r--
module.info.tr
0
B
-rw-r--r--
module.info.tr.auto
180
B
-rw-r--r--
module.info.uk
0
B
-rw-r--r--
module.info.uk.auto
239
B
-rw-r--r--
module.info.ur
0
B
-rw-r--r--
module.info.ur.auto
230
B
-rw-r--r--
module.info.vi
0
B
-rw-r--r--
module.info.vi.auto
173
B
-rw-r--r--
module.info.zh
0
B
-rw-r--r--
module.info.zh.auto
109
B
-rw-r--r--
module.info.zh_TW
0
B
-rw-r--r--
module.info.zh_TW.auto
115
B
-rw-r--r--
save_auth.cgi
1.82
KB
-rwxr-xr-x
save_host.cgi
4.69
KB
-rwxr-xr-x
save_key.cgi
909
B
-rwxr-xr-x
save_known.cgi
1.09
KB
-rwxr-xr-x
setup.cgi
695
B
-rwxr-xr-x
ssh-lib.pl
9.5
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ssh-lib.pl
# ssh-lib.pl # Common functions for manipulating the users .ssh directory files BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); &switch_to_remote_user(); $ssh_directory = "$remote_user_info[7]/.ssh"; $ssh_client_config = "$ssh_directory/config"; $authorized_keys = "$ssh_directory/authorized_keys"; $known_hosts = "$ssh_directory/known_hosts"; @ssh_key_types = ( 'rsa1', 'rsa', 'dsa' ); # find_value(name, &config) sub find_value { foreach $c (@{$_[1]}) { if (lc($c->{'name'}) eq lc($_[0])) { return wantarray ? @{$c->{'values'}} : $c->{'values'}->[0]; } } return wantarray ? ( ) : undef; } # find(value, &config) sub find { local @rv; foreach $c (@{$_[1]}) { if (lc($c->{'name'}) eq lc($_[0])) { push(@rv, $c); } } return wantarray ? @rv : $rv[0]; } # save_directive(name, &config, [value*]) sub save_directive { local @o = &find($_[0], $_[1]); local @n = grep { defined($_) } @_[2..@_-1]; local $lref = &read_file_lines($_[1]->[0]->{'file'}); local $id = ("\t" x $_[1]->[0]->{'indent'}); local $i; for($i=0; $i<@o || $i<@n; $i++) { if ($o[$i] && $n[$i]) { # Replacing a line $lref->[$o[$i]->{'line'}] = "$id$_[0] $n[$i]"; } elsif ($o[$i]) { # Removing a line splice(@$lref, $o[$i]->{'line'}, 1); foreach $c (@{$_[1]}) { if ($c->{'line'} > $o[$i]->{'line'}) { $c->{'line'}--; } } } elsif ($n[$i]) { # Adding a line local $ll = $_[1]->[@{$_[1]}-1]->{'line'}; splice(@$lref, $ll+1, 0, "$id$_[0] $n[$i]"); } } } # scmd(double) sub scmd { if ($cmd_count % 2 == 0) { print "<tr>\n"; } elsif ($_[0]) { print "<td colspan=2></td> </tr>\n"; print "<tr>\n"; $cmd_count = 0; } $cmd_count += ($_[0] ? 2 : 1); } # ecmd() sub ecmd { if ($cmd_count % 2 == 0) { print "</tr>\n"; } } # get_client_config() # Returns a list of structures, one for each host sub get_client_config { local @rv = ( { 'dummy' => 1, 'indent' => 0, 'file' => $ssh_client_config, 'line' => -1, 'eline' => -1 } ); local $host; local $lnum = 0; open(CLIENT, $ssh_client_config); while(<CLIENT>) { s/\r|\n//g; s/^\s*#.*$//g; s/^\s*//g; local ($name, @values) = split(/\s+/, $_); if (lc($name) eq 'host') { # Start of new host $host = { 'name' => $name, 'values' => \@values, 'file' => $ssh_client_config, 'line' => $lnum, 'eline' => $lnum, 'members' => [ { 'dummy' => 1, 'indent' => 1, 'file' => $ssh_client_config, 'line' => $lnum } ] }; push(@rv, $host); } elsif ($name) { # A directive inside a host local $dir = { 'name' => $name, 'values' => \@values, 'file' => $ssh_client_config, 'line' => $lnum }; push(@{$host->{'members'}}, $dir); $host->{'eline'} = $lnum; } $lnum++; } close(CLIENT); return \@rv; } # create_host(&host) sub create_host { local $lref = &read_file_lines($ssh_client_config); $_[0]->{'line'} = $_[0]->{'eline'} = scalar(@$lref); push(@$lref, "Host ".join(" ", @{$_[0]->{'values'}})); $_[0]->{'members'} = [ { 'dummy' => 1, 'indent' => 1, 'file' => $ssh_client_config, 'line' => $_[0]->{'line'} } ]; } # modify_host(&host) sub modify_host { local $lref = &read_file_lines($ssh_client_config); $lref->[$_[0]->{'line'}] = "Host ".join(" ", @{$_[0]->{'values'}}); } # delete_host(&host) sub delete_host { local $lref = &read_file_lines($ssh_client_config); splice(@$lref, $_[0]->{'line'}, $_[0]->{'eline'} - $_[0]->{'line'} + 1); } # list_auths() # Returns a list of authorized key structures sub list_auths { local @rv; local $lnum = 0; open(AUTHS, $authorized_keys); while(<AUTHS>) { s/\r|\n//g; s/#.*$//; if (/^((.*)\s+)?(\d+)\s+(\d+)\s+(\d+)\s+(\S+)$/) { # SSH1 style line local $auth = { 'name' => $6, 'key' => $5, 'exp' => $4, 'bits' => $3, 'opts' => $2, 'type' => 1, 'line' => $lnum, 'index' => scalar(@rv) }; $auth->{'opts'} =~ s/\s+$//; push(@rv, $auth); } elsif (/^((.*)\s+)?([a-z]\S+)\s+(\S+)\s+(\S+)/) { # SSH2 style line local $auth = { 'name' => $5, 'key' => $4, 'opts' => $2, 'keytype' => $3, 'type' => 2, 'line' => $lnum, 'index' => scalar(@rv) }; $auth->{'opts'} =~ s/\s+$//; push(@rv, $auth); } $lnum++; } close(AUTHS); return @rv; } # create_auth(&auth) sub create_auth { local $lref = &read_file_lines($authorized_keys); push(@$lref, &auth_line($_[0])); &flush_file_lines(); } # delete_auth(&auth) sub delete_auth { local $lref = &read_file_lines($authorized_keys); splice(@$lref, $_[0]->{'line'}, 1); &flush_file_lines(); } # modify_auth(&auth) sub modify_auth { local $lref = &read_file_lines($authorized_keys); $lref->[$_[0]->{'line'}] = &auth_line($_[0]); &flush_file_lines(); } # parse_options(string, &opts) sub parse_options { local $opts = $_[0]; while($opts =~ /^([^=\s,]+)=\"([^\"]*)\",?(.*)$/ || $opts =~ /^([^=\s,]+)=([^=\s,]+),?(.*)$/ || $opts =~ /^([^=\s,]+)(),?(.*)$/) { push(@{$_[1]->{$1}}, $2); $opts = $3; } } # join_options(&opts) sub join_options { local @rv; foreach $o (keys %{$_[0]}) { foreach $ov (@{$_[0]->{$o}}) { if (defined($ov)) { push(@rv, "$o=\"$ov\""); } else { push(@rv, $o); } } } return join(",", @rv); } sub auth_line { if ($_[0]->{'type'} == 2) { # SSH 2 format line return join(" ", $_[0]->{'opts'} ? ( $_[0]->{'opts'} ) : ( ), $_[0]->{'keytype'}, $_[0]->{'key'}, $_[0]->{'name'} ); } else { # SSH 1 format line return join(" ", $_[0]->{'opts'} ? ( $_[0]->{'opts'} ) : ( ), $_[0]->{'bits'}, $_[0]->{'exp'}, $_[0]->{'key'}, $_[0]->{'name'} ); } } # list_knowns() # Returns a list of known host structures sub list_knowns { local @rv; local $lnum = 0; open(KNOWNS, $known_hosts); while(<KNOWNS>) { s/\r|\n//g; s/#.*$//; #Handle hashed type 2 keys if (/^\|1\|(\S+=)\|(\S+=)\s(.+)\s(\S+=)\s*(.*)$/) { local $known = { 'comment' => $5, 'key' => $4, 'salt' => $1, 'hash' => $2, 'type' => $3, 'hosts' => [ split(/,/, '*HASHED*') ], 'line' => $lnum, 'index' => scalar(@rv) }; push(@rv, $known); } #Handle hashed type 1 keys elsif (/^\|1\|(\S+=)\|(\S+=)\s(\d+)\s(\d+)\s(\S+)\s*(.*)$/) { local $known = { 'comment' => $6, 'key' => $5, 'type' => 'ssh-rsa1', 'salt' => $1, 'hash' => $2, 'exp' => $4, 'bits' => $3, 'hosts' => [ split(/,/, '*HASHED*') ], 'line' => $lnum, 'index' => scalar(@rv) }; push(@rv, $known); } #Handle type 2 keys elsif (/^(\S+)\s+(.+)\s(\S+=)\s*(.*)$/) { local $known = { 'comment' => $4, 'key' => $3, 'type' => $2, 'hosts' => [ split(/,/, $1) ], 'line' => $lnum, 'index' => scalar(@rv) }; push(@rv, $known); } #Handle type 1 keys elsif (/^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s*(.*)$/) { local $known = { 'comment' => $5, 'key' => $4, 'type' => 'ssh-rsa1', 'exp' => $3, 'bits' => $2, 'hosts' => [ split(/,/, $1) ], 'line' => $lnum, 'index' => scalar(@rv) }; push(@rv, $known); } $lnum++; } close(KNOWNS); return @rv; } # create_known(&known) sub create_known { local $lref = &read_file_lines($known_hosts); push(@$lref, &known_line($_[0])); &flush_file_lines(); } # delete_known(&known) sub delete_known { local $lref = &read_file_lines($known_hosts); splice(@$lref, $_[0]->{'line'}, 1); &flush_file_lines(); } # modify_known(&known) sub modify_known { local $lref = &read_file_lines($known_hosts); $lref->[$_[0]->{'line'}] = &known_line($_[0]); &flush_file_lines(); } sub known_line { if ($_[0]->{'hash'}) { if ($_[0]->{'type'} eq 'ssh-rsa1') { return join(" ", '|1|' . $_[0]->{'salt'} . '|' . $_[0]->{'hash'}, $_[0]->{'bits'}, $_[0]->{'exp'}, $_[0]->{'key'}, $_[0]->{'comment'} ? ( $_[0]->{'comment'} ) : ( ) ); } else { return join(" ", '|1|' . $_[0]->{'salt'} . '|' . $_[0]->{'hash'}, $_[0]->{'type'}, $_[0]->{'key'}, $_[0]->{'comment'} ? ( $_[0]->{'comment'} ) : ( ) ); } } else { if ($_[0]->{'type'} eq 'ssh-rsa1') { return join(" ", join(",", @{$_[0]->{'hosts'}}), $_[0]->{'bits'}, $_[0]->{'exp'}, $_[0]->{'key'}, $_[0]->{'comment'} ? ( $_[0]->{'comment'} ) : ( ) ); } else { return join(" ", join(",", @{$_[0]->{'hosts'}}), $_[0]->{'type'}, $_[0]->{'key'}, $_[0]->{'comment'} ? ( $_[0]->{'comment'} ) : ( ) ); } } } # get_ssh_type() # Returns either 'openssh' or 'ssh' sub get_ssh_type { local $out = `ssh -V 2>&1 </dev/null`; return $out =~ /openssh/i ? 'openssh' : $out =~ /Sun_SSH/i ? 'openssh' : 'ssh'; } # get_ssh_version() # Returns the SSH version number sub get_ssh_version { local $out = `ssh -V 2>&1 </dev/null`; if ($out =~ /(sshd\s+version\s+([0-9\.]+))/i || $out =~ /(ssh\s+secure\s+shell\s+([0-9\.]+))/i) { # Classic commercial SSH return $2; } elsif ($out =~ /(OpenSSH.([0-9\.]+))/i) { # OpenSSH .. assume all versions are supported return $2; } elsif ($out =~ /(Sun_SSH_([0-9\.]+))/i) { # Solaris 9 SSH is actually OpenSSH 2.x return 2.0; } elsif (($out = $config{'sshd_version'}) && ($out =~ /(Sun_SSH_([0-9\.]+))/i)) { # Probably Solaris 10 SSHD that didn't display version. Use it. return 2.0; } else { return undef; } } sub yes_no_default_radio { local ($name, $value) = @_; return &ui_radio($name, lc($value) eq 'yes' ? 1 : lc($value) eq 'no' ? 0 : 2, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ], [ 2, $text{'default'} ] ]); } # list_ssh_keys() # Returns a list of the current user's private SSH keys sub list_ssh_keys { local @rv; foreach my $t ([ 'identity', 'rsa1' ], [ 'id_dsa', 'dsa' ], [ 'id_rsa', 'rsa']) { local $private_file = "$ssh_directory/$t->[0]"; if (-r $private_file) { push(@rv, { 'type' => $t->[1], 'private_file' => $private_file, 'public_file' => $private_file.".pub", }); } } return @rv; } 1;
Close