|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 715 (0x2cb) Types: TextFile Names: »scan_passwd«
└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen └─⟦b5330643c⟧ »./cops/perl-4.019/perl.tar.Z« └─⟦2b9a58213⟧ └─⟦this⟧ »perl-4.019/eg/scan/scan_passwd«
#!/usr/bin/perl # $Header: scan_passwd,v 4.0 91/03/20 01:13:18 lwall Locked $ # This scans passwd file for security holes. open(Pass,'/etc/passwd') || die "Can't open passwd file: $!\n"; # $dotriv = (`date` =~ /^Mon/); $dotriv = 1; while (<Pass>) { ($login,$pass,$uid,$gid,$gcos,$home,$shell) = split(/:/); if ($shell eq '') { print "Short: $_"; } next if /^[+]/; if ($pass eq '') { if (index(":sync:lpq:+:", ":$login:") < 0) { print "No pass: $login\t$gcos\n"; } } elsif ($dotriv && crypt($login,substr($pass,0,2)) eq $pass) { print "Trivial: $login\t$gcos\n"; } if ($uid == 0) { if ($login !~ /^.?root$/ && $pass ne '*') { print "Extra root: $_"; } } }