X7ROOT File Manager
Current Path:
/usr/libexec/webmin/nis
usr
/
libexec
/
webmin
/
nis
/
📁
..
📄
CHANGELOG
(308 B)
📄
aix-lib.pl
(9.79 KB)
📄
backup_config.pl
(817 B)
📄
build.cgi
(162 B)
📄
coherent-linux-lib.pl
(10.4 KB)
📄
config-aix
(181 B)
📄
config-coherent-linux
(116 B)
📄
config-debian-linux
(120 B)
📄
config-generic-linux
(116 B)
📄
config-mandrake-linux
(116 B)
📄
config-msc-linux
(116 B)
📄
config-open-linux
(117 B)
📄
config-openmamba-linux
(116 B)
📄
config-redhat-linux
(116 B)
📄
config-slackware-linux
(116 B)
📄
config-solaris
(167 B)
📄
config-solaris-8-ALL
(199 B)
📄
config-suse-linux
(116 B)
📄
config-trustix-linux
(116 B)
📄
config-united-linux
(116 B)
📄
config.info
(282 B)
📄
config.info.ca
(320 B)
📄
config.info.cs
(321 B)
📄
config.info.de
(321 B)
📄
config.info.es
(277 B)
📄
config.info.fr
(350 B)
📄
config.info.hu
(0 B)
📄
config.info.nl
(290 B)
📄
config.info.no
(297 B)
📄
config.info.pl
(309 B)
📄
config.info.ru
(491 B)
📄
config.info.sv
(132 B)
📄
config.info.uk
(500 B)
📄
debian-linux-lib.pl
(10.19 KB)
📄
edit_aliases.cgi
(1.2 KB)
📄
edit_client.cgi
(1.41 KB)
📄
edit_ethers.cgi
(1.14 KB)
📄
edit_group.cgi
(1.81 KB)
📄
edit_group_shadow.cgi
(1.83 KB)
📄
edit_hosts.cgi
(1.31 KB)
📄
edit_netgroup.cgi
(2.01 KB)
📄
edit_netmasks.cgi
(1.16 KB)
📄
edit_networks.cgi
(1.35 KB)
📄
edit_passwd.cgi
(4.8 KB)
📄
edit_passwd_shadow.cgi
(4.8 KB)
📄
edit_passwd_shadow_full.cgi
(4.8 KB)
📄
edit_protocols.cgi
(1.35 KB)
📄
edit_rpc.cgi
(1.3 KB)
📄
edit_security.cgi
(1.92 KB)
📄
edit_server.cgi
(607 B)
📄
edit_services.cgi
(1.52 KB)
📄
edit_services2.cgi
(1.53 KB)
📄
edit_switch.cgi
(1.74 KB)
📄
edit_tables.cgi
(6.24 KB)
📄
feedback_files.pl
(157 B)
📁
images
📄
index.cgi
(776 B)
📁
lang
📄
linux-lib.pl
(5.27 KB)
📄
list_switches.cgi
(772 B)
📄
mandrake-linux-lib.pl
(10.38 KB)
📄
md5-lib.pl
(7.44 KB)
📄
module.info
(346 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(167 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(195 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(287 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(250 B)
📄
module.info.ca
(163 B)
📄
module.info.ca.auto
(12 B)
📄
module.info.cs
(28 B)
📄
module.info.cs.auto
(145 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(154 B)
📄
module.info.de
(136 B)
📄
module.info.de.auto
(12 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(235 B)
📄
module.info.es
(31 B)
📄
module.info.es.auto
(138 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(164 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(248 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(158 B)
📄
module.info.fr
(30 B)
📄
module.info.fr.auto
(141 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(170 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(171 B)
📄
module.info.hu
(34 B)
📄
module.info.hu.auto
(147 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(152 B)
📄
module.info.ja
(49 B)
📄
module.info.ja.auto
(226 B)
📄
module.info.ko
(39 B)
📄
module.info.ko.auto
(154 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(169 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(169 B)
📄
module.info.ms
(149 B)
📄
module.info.ms.auto
(12 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(144 B)
📄
module.info.nl
(30 B)
📄
module.info.nl.auto
(130 B)
📄
module.info.no
(29 B)
📄
module.info.no.auto
(117 B)
📄
module.info.pl
(107 B)
📄
module.info.pl.auto
(12 B)
📄
module.info.pt
(0 B)
📄
module.info.pt.auto
(164 B)
📄
module.info.pt_BR
(0 B)
📄
module.info.pt_BR.auto
(173 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(156 B)
📄
module.info.ru
(41 B)
📄
module.info.ru.auto
(246 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(165 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(165 B)
📄
module.info.sv
(31 B)
📄
module.info.sv.auto
(123 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(347 B)
📄
module.info.tr
(0 B)
📄
module.info.tr.auto
(169 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(247 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(244 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(217 B)
📄
module.info.zh
(34 B)
📄
module.info.zh.auto
(120 B)
📄
module.info.zh_TW
(37 B)
📄
module.info.zh_TW.auto
(126 B)
📄
msc-linux-lib.pl
(10.38 KB)
📄
nis-lib.pl
(6.02 KB)
📄
nisupdate.conf
(1.94 KB)
📄
old_edit_passwd_shadow.cgi
(4.62 KB)
📄
old_edit_switch.cgi
(1.76 KB)
📄
old_save_switch.cgi
(533 B)
📄
open-linux-lib.pl
(7.89 KB)
📄
openmamba-linux-lib.pl
(10.38 KB)
📄
redhat-linux-lib.pl
(10.38 KB)
📄
save_aliases.cgi
(749 B)
📄
save_client.cgi
(661 B)
📄
save_ethers.cgi
(793 B)
📄
save_file.cgi
(588 B)
📄
save_group.cgi
(945 B)
📄
save_group_shadow.cgi
(1.04 KB)
📄
save_hosts.cgi
(758 B)
📄
save_netgroup.cgi
(1.04 KB)
📄
save_netmasks.cgi
(753 B)
📄
save_networks.cgi
(791 B)
📄
save_passwd_shadow.cgi
(2.36 KB)
📄
save_protocols.cgi
(806 B)
📄
save_rpc.cgi
(746 B)
📄
save_security.cgi
(996 B)
📄
save_server.cgi
(184 B)
📄
save_services.cgi
(775 B)
📄
save_services2.cgi
(776 B)
📄
save_switch.cgi
(932 B)
📄
slackware-linux-lib.pl
(9.91 KB)
📄
solaris-lib.pl
(10.45 KB)
📄
suse-linux-8.2-lib.pl
(11.05 KB)
📄
suse-linux-9.0-lib.pl
(11.05 KB)
📄
suse-linux-lib.pl
(11.88 KB)
📄
switch-lib.pl
(3.08 KB)
📄
trustix-linux-lib.pl
(10.38 KB)
📄
united-linux-lib.pl
(11.05 KB)
Editing: md5-lib.pl
# Functions for MD5 and SHA1 password encryption use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; our %config; # check_md5() # Returns a perl module name if the needed perl module(s) for MD5 encryption # are not installed, or undef if they are sub check_md5 { # On some systems, the crypt function just works! return undef if (&unix_crypt_supports_md5()); # Try Perl modules eval "use MD5"; if (!$@) { eval "use Digest::MD5"; if ($@) { return "Digest::MD5"; } } return undef; } # encrypt_md5(string, [salt]) # Returns a string encrypted in MD5 format sub encrypt_md5 { my ($passwd, $salt) = @_; my $magic = '$1$'; if ($salt && $salt =~ /^\$1\$([^\$]+)/) { # Extract actual salt from already encrypted password $salt = $1; } if ($salt && $salt !~ /^[a-z0-9\/\.]{8}$/i) { # Non-MD5 salt $salt = undef; } $salt ||= substr(time(), -8); # Use built-in crypt support for MD5, if we can if (&unix_crypt_supports_md5()) { return crypt($passwd, $magic.$salt.'$xxxxxxxxxxxxxxxxxxxxxx'); } # Add the password, magic and salt my $cls = "MD5"; eval "use MD5"; if ($@) { $cls = "Digest::MD5"; eval "use Digest::MD5"; if ($@) { &error("Missing MD5 or Digest::MD5 perl modules"); } } my $ctx = eval "new $cls"; $ctx->add($passwd); $ctx->add($magic); $ctx->add($salt); # Add some more stuff from the hash of the password and salt my $ctx1 = eval "new $cls"; $ctx1->add($passwd); $ctx1->add($salt); $ctx1->add($passwd); my $final = $ctx1->digest(); for(my $pl=length($passwd); $pl>0; $pl-=16) { $ctx->add($pl > 16 ? $final : substr($final, 0, $pl)); } # This piece of code seems rather pointless, but it's in the C code that # does MD5 in PAM so it has to go in! my $j = 0; for(my $i=length($passwd); $i; $i >>= 1) { if ($i & 1) { $ctx->add("\0"); } else { $ctx->add(substr($passwd, $j, 1)); } } $final = $ctx->digest(); # This loop exists only to waste time for(my $i=0; $i<1000; $i++) { my $ctx1 = eval "new $cls"; $ctx1->add($i & 1 ? $passwd : $final); $ctx1->add($salt) if ($i % 3); $ctx1->add($passwd) if ($i % 7); $ctx1->add($i & 1 ? $final : $passwd); $final = $ctx1->digest(); } # Convert the 16-byte final string into a readable form my $rv = $magic.$salt.'$'; my @final = map { ord($_) } split(//, $final); my $l = ($final[ 0]<<16) + ($final[ 6]<<8) + $final[12]; $rv .= &to64($l, 4); $l = ($final[ 1]<<16) + ($final[ 7]<<8) + $final[13]; $rv .= &to64($l, 4); $l = ($final[ 2]<<16) + ($final[ 8]<<8) + $final[14]; $rv .= &to64($l, 4); $l = ($final[ 3]<<16) + ($final[ 9]<<8) + $final[15]; $rv .= &to64($l, 4); $l = ($final[ 4]<<16) + ($final[10]<<8) + $final[ 5]; $rv .= &to64($l, 4); $l = $final[11]; $rv .= &to64($l, 2); return $rv; } # unix_crypt_supports_md5() # Returns 1 if the built-in crypt() function can already do MD5 sub unix_crypt_supports_md5 { my $hash = '$1$A9wB3O18$zaZgqrEmb9VNltWTL454R/'; my $newhash = eval { crypt('test', $hash) }; return $newhash eq $hash; } our @itoa64 = split(//, "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); sub to64 { my ($v, $n) = @_; my $r = ""; while(--$n >= 0) { $r .= $itoa64[$v & 0x3f]; $v >>= 6; } return $r; } sub check_sha1 { eval "use Digest::SHA1"; return $@ ? "Digest::SHA1" : undef; } # encrypt_sha1(password) # Encrypts a password in SHA1 format sub encrypt_sha1 { my ($pass) = @_; my $sh = eval "use Digest::SHA1 qw(sha1_base64);return sha1_base64(\$pass);"; return "{SHA}$sh="; } # encrypt_sha1_hash(password, salt) # Hashes a combined salt+password with SHA1, and returns it in hex. Used on OSX sub encrypt_sha1_hash { my ($pass, $salt) = @_; # XXX not done yet?? } # check_blowfish() # Returns an missing Perl module if blowfish is not available, undef if OK sub check_blowfish { eval "use Crypt::Eksblowfish::Bcrypt"; return $@ ? "Crypt::Eksblowfish::Bcrypt" : undef; } # encrypt_blowfish(password, [salt]) # Returns a string encrypted in blowfish format, suitable for /etc/shadow sub encrypt_blowfish { my ($passwd, $salt) = @_; my ($plain, $base64) = ("", ""); eval "use Crypt::Eksblowfish::Bcrypt"; if ($salt && $salt !~ /^\$2a\$/) { # Invalid salt for Blowfish $salt = undef; } if (!$salt) { # Generate a 22-character base-64 format salt &seed_random(); while(length($base64) < 22) { $plain .= chr(int(rand()*96)+32); $base64 = Crypt::Eksblowfish::Bcrypt::en_base64($plain); } $base64 = substr($base64, 0, 22); $salt = '$2a$'.'08'.'$'.$base64; } return Crypt::Eksblowfish::Bcrypt::bcrypt($passwd, $salt); } # unix_crypt_supports_sha512() # Returns 1 if the built-in crypt() function can already do SHA512 sub unix_crypt_supports_sha512 { my $hash = '$6$Tk5o/GEE$zjvXhYf/dr5M7/jan3pgunkNrAsKmQO9r5O8sr/Cr1hFOLkWmsH4iE9hhqdmHwXd5Pzm4ubBWTEjtMeC.h5qv1'; my $newhash = eval { crypt('test', $hash) }; return $newhash eq $hash; } # check_sha512() # Returns undef if SHA512 hashing is supported, or an error message if not sub check_sha512 { return &unix_crypt_supports_sha512() ? undef : 'Crypt::SHA'; } # encrypt_sha512(password, [salt]) # Hashes a password, possibly with the given salt, with SHA512 sub encrypt_sha512 { my ($passwd, $salt) = @_; $salt ||= '$6$'.substr(time(), -8).'$'; return crypt($passwd, $salt); } # unix_crypt_supports_yescrypt() # Returns 1 if the built-in crypt() function can already do yescrypt sub unix_crypt_supports_yescrypt { my $hash = '$y$j9T$waHytoaqP/CEnKFroGn0S/$fxd5mVc2mBPUc3vv.cpqDckpwrWTyIm2iD4JfnVBi26'; my $newhash = eval { crypt('test', $hash) }; return $newhash eq $hash; } # check_yescrypt() # Returns undef if yescrypt hashing is supported, or an error message if not sub check_yescrypt { return &unix_crypt_supports_yescrypt() ? undef : 'Crypt::NaCl::Sodium'; } # encrypt_yescrypt(password, [salt]) # Hashes a password, possibly with the given salt, with yescrypt sub encrypt_yescrypt { my ($passwd, $salt) = @_; $salt ||= &substitute_pattern('$y$j9T$[A-Z]{4}.[a-zA-Z0-9]{16}.$[a-zA-Z0-9]{14}.[a-zA-Z0-9]{7}/[a-zA-Z0-9]{15}/[a-zA-Z0-9]{4}'); return crypt($passwd, $salt); } # validate_password(password, hash) # Compares a password with a hash to see if they match, returns 1 if so, # 0 otherwise. Tries all supported hashing schemes. sub validate_password { my ($passwd, $hash) = @_; # Classic Unix crypt my $chash = eval { local $main::error_must_die = 1; &unix_crypt($passwd, $hash); }; return 1 if ($chash eq $hash); # MD5 if (!&check_md5()) { my $mhash = &encrypt_md5($passwd, $hash); return 1 if ($mhash eq $hash); } # Blowfish if (!&check_blowfish()) { my $mhash = &encrypt_blowfish($passwd, $hash); return 1 if ($mhash eq $hash); } # SHA512 if (!&check_sha512()) { my $shash = &encrypt_sha512($passwd, $hash); return 1 if ($shash && $shash eq $hash); } # yescrypt if (!&check_yescrypt()) { my $shash = &encrypt_yescrypt($passwd, $hash); return 1 if ($shash && $shash eq $hash); } # Some other hashing, maybe supported by crypt my $ohash = eval { crypt($passwd, $hash) }; return 1 if ($ohash && $ohash eq $hash); return 0; } =head2 is_dictionary_word(word) Returns 1 if some file can be found in a dictionary words file =cut sub is_dictionary_word { my ($word) = @_; $word = lc($word); my @files; if ($config{'dict_file'}) { @files = split(/\s+/, $config{'dict_file'}); } else { @files = ( "/usr/share/dict/words", "/usr/share/dict/linux.words", "/usr/dict/words" ); } foreach my $f (@files) { my $found = 0; my $fh = "WORDS"; &open_readfile($fh, $f); while(<$fh>) { s/#.*//; s/\s//; if (lc($_) eq $word) { $found = 1; last; } } close($fh); return 1 if ($found); } return 0; } 1;
Upload File
Create Folder