[ Avaa Bypassed ]




Upload:

Command:

www-data@18.221.207.166: ~ $
#!/usr/bin/perl
# save_passwd.cgi
# Change a user's password

require './passwd-lib.pl';
&error_setup($text{'passwd_err'});
&ReadParse();

if ($config{'passwd_cmd'}) {
	# Call the passwd program to do the change
	@user = getpwnam($in{'user'});
	@user || &error($text{'passwd_euser'});
	&can_edit_passwd(\@user) || &error($text{'passwd_ecannot'});
	if ($access{'repeat'}) {
		$in{'new'} eq $in{'repeat'} || &error($text{'passwd_erepeat'});
		}
	&foreign_require("proc", "proc-lib.pl");
	if ($access{'old'} == 1 ||
	    $access{'old'} == 2 && $in{'user'} ne $remote_user) {
		@cmd = ( $config{'passwd_cmd'}, $user[2], $user[3] );
		}
	else {
		@cmd = ( "$config{'passwd_cmd'} '$in{'user'}'" );
		}
	&additional_log('exec', undef, $cmd[0]);
	local ($fh, $fpid) = &foreign_call("proc", "pty_process_exec", @cmd);
	while(1) {
		local $rv = &wait_for($fh, '(new|re-enter).*:',
					   '(old|current|login).*:',
					   'pick a password');
		$out .= $wait_for_input;
		sleep(1);
		if ($rv == 0) {
			syswrite($fh, $in{'new'}."\n", length($in{'new'})+1);
			}
		elsif ($rv == 1) {
			syswrite($fh, $in{'old'}."\n", length($in{'old'})+1);
			}
		elsif ($rv == 2) {
			syswrite($fh, "1\n", 2);
			}
		else {
			last;
			}
		last if (++$count > 10);
		}
	close($fh);
	waitpid($fpid, 0);
	&error(&text('passwd_ecmd', "<tt>$config{'passwd_cmd'}</tt>", "<pre>$out</pre>")) if ($? || $count > 10);
	&webmin_log("passwd", undef, $in{'user'});
	}
else {
	# Update the config files directly via the useradmin module
	&foreign_require("useradmin", "user-lib.pl");

	# Find the user, either in local password file or LDAP
	$user = &find_user($in{'user'});

	if ($user) {
		# Validate inputs
		if ($access{'old'} == 1 ||
		    $access{'old'} == 2 && $user->{'user'} ne $remote_user) {
			&useradmin::validate_password(
			    $in{'old'}, $user->{'pass'}) ||
				&error($text{'passwd_eold'});
			}
		if ($access{'repeat'}) {
			$in{'new'} eq $in{'repeat'} || &error($text{'passwd_erepeat'});
			}
		$err = &useradmin::check_password_restrictions(
			$in{'new'}, $in{'user'}, $user);
		&error($err) if ($err);

		&can_edit_passwd([ $user->{'user'}, $user->{'pass'},
				   $user->{'uid'}, $user->{'gid'} ]) ||
			&error($text{'passwd_ecannot'});

		# Actually do the change
		&change_password($user, $in{'new'}, 
			$access{'others'} == 1 ||
			$access{'others'} == 2 && $in{'others'});
		}
	else {
		&error($text{'passwd_euser'});
		}
	delete($user->{'plainpass'});
	delete($user->{'pass'});
	&webmin_log("passwd", undef, $user->{'user'}, $user);
	}

# Show a confirmation message
&ui_print_header(undef, $text{'passwd_title'}, "");
if (($user->{'user'} eq $remote_user || $user->{'user'} eq $base_remote_user) &&
    !$main::session_id) {
	print &text('passwd_ok', "<tt>$user->{'user'}</tt>"),"\n";
	}
else {
	print &text('passwd_ok2', "<tt>$user->{'user'}</tt>"),"\n";
	}
&ui_print_footer($in{'one'} ? ( "/", $text{'index'} )
			    : ( "", $text{'index_return'} ));


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 648 B 0644
acl_security.pl File 2.37 KB 0755
change-passwd.pl File 1.44 KB 0755
change_passwd.cgi File 1.6 KB 0755
config File 39 B 0644
config-openmamba-linux File 57 B 0644
config.info File 229 B 0644
config.info.af File 256 B 0644
config.info.ar File 371 B 0644
config.info.ca File 285 B 0644
config.info.cs File 288 B 0644
config.info.de File 271 B 0644
config.info.el File 456 B 0644
config.info.es File 307 B 0644
config.info.fa File 433 B 0644
config.info.fi File 261 B 0644
config.info.fr File 312 B 0644
config.info.hr File 0 B 0644
config.info.hu File 310 B 0644
config.info.it File 250 B 0644
config.info.ja File 307 B 0644
config.info.ko File 239 B 0644
config.info.ms File 259 B 0644
config.info.nl File 264 B 0644
config.info.no File 241 B 0644
config.info.pl File 231 B 0644
config.info.ru File 498 B 0644
config.info.tr File 299 B 0644
config.info.uk File 482 B 0644
config.info.zh_TW File 175 B 0644
defaultacl File 71 B 0644
edit_passwd.cgi File 1.8 KB 0755
index.cgi File 2.74 KB 0755
log_parser.pl File 423 B 0755
module.info File 218 B 0644
module.info.af File 26 B 0644
module.info.af.auto File 85 B 0644
module.info.ar File 130 B 0644
module.info.ar.auto File 19 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 148 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 164 B 0644
module.info.ca File 97 B 0644
module.info.ca.auto File 15 B 0644
module.info.cs File 21 B 0644
module.info.cs.auto File 78 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 104 B 0644
module.info.de File 96 B 0644
module.info.de.auto File 15 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 197 B 0644
module.info.es File 31 B 0644
module.info.es.auto File 86 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 105 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 157 B 0644
module.info.fi File 26 B 0644
module.info.fi.auto File 87 B 0644
module.info.fr File 32 B 0644
module.info.fr.auto File 95 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 117 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 104 B 0644
module.info.hu File 32 B 0644
module.info.hu.auto File 92 B 0644
module.info.it File 24 B 0644
module.info.it.auto File 79 B 0644
module.info.ja File 33 B 0644
module.info.ja.auto File 115 B 0644
module.info.ko File 22 B 0644
module.info.ko.auto File 105 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 112 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 96 B 0644
module.info.ms File 88 B 0644
module.info.ms.auto File 15 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 105 B 0644
module.info.nl File 30 B 0644
module.info.nl.auto File 84 B 0644
module.info.no File 31 B 0644
module.info.no.auto File 75 B 0644
module.info.pl File 22 B 0644
module.info.pl.auto File 76 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 98 B 0644
module.info.pt_BR File 25 B 0644
module.info.pt_BR.auto File 81 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 103 B 0644
module.info.ru File 21 B 0644
module.info.ru.auto File 114 B 0644
module.info.sk File 20 B 0644
module.info.sk.auto File 84 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 105 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 106 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 190 B 0644
module.info.tr File 31 B 0644
module.info.tr.auto File 92 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 151 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 160 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 145 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 88 B 0644
module.info.zh_TW File 24 B 0644
module.info.zh_TW.auto File 73 B 0644
passwd-lib.pl File 4.76 KB 0755
prefs.info File 39 B 0644
rbac-mapping File 73 B 0644
safeacl File 47 B 0644
save_passwd.cgi File 2.88 KB 0755