# Ray Espinoza # ChPass.pl # This script calls in the encrypted password file and decrypts it and uses # its value as $Password to change the account password to $Password. ################################################################################################# #!D:\perl\bin -w use strict; use Win32::AdminMisc; #use Win32::AdminMisc qw(SetPassword); chomp(my $Server = ); my $User = "Administrator"; &getPassword = my $Password; my $Result = Win32::AdminMisc::SetPassword( $Server, $User, $Password) || die "Couldn't change password on $Server: $^E"; print $Result; sub getPassword { use strict; use Crypt::Blowfish_PP; my $key="abcdefghijklmnopqrstuvwxyz123456789"; my $bf = Crypt::Blowfish_PP->new($key); open (IN,"phrase.txt") || die "Can't read phrase.txt: $!"; while () { my $encrypted_password = $_; my $decrypted_password = $bf->decrypt($encrypted_password); print $decrypted_data; }