my $var_username = param( "USERNAME" );
my $var_password = param( "PASSWORD" );
####
my $encrypted_password = Digest::MD5::md5_hex("$var_username" . "$var_password");
#print "encrypted_password : $encrypted_password \n"; # This shows the encrypted password.
##
##
username,c0075ad4e26ec3dee225ccb6387b0b77
##
##
if ( ( $var_username eq $username ) && ( $encrypted_password eq $password ) ) {
print "$var_username, $encrypted_password
"; # I will remove this in real world
print "Permission has been granted
";
print "\n";
$didmsg=1;
last;
}
##
##
#!/usr/bin/perl
use CGI qw(:standard);
use strict;
use warnings;
use Digest::MD5;
my $var_username = param( "USERNAME" );
my $var_password = param( "PASSWORD" );
my $encrypted_password = Digest::MD5::md5_hex("$var_username" . "$var_password");
my $url="http://host.redirectiondomain.com:9999/";
my $t=1; # time until redirect activates
print "Content-Type: text/html; charset=utf-8\n\n";
open ( FILE, "/tmp/password.txt" ) || die "The file could not be opened";
my $didmsg=0;
while ( my $line = )
{
chomp $line;
( my $username, my $password ) = split( ",", $line );
if ( ( $var_username eq $username ) && ( $encrypted_password eq $password ) ) {
print "$var_username, $encrypted_password
"; # I will remove this in real world
print "Permission has been granted
";
print "\n";
$didmsg=1;
last;
}
elsif ( ( $var_username eq $username ) && ( $encrypted_password ne $password ) ) {
print "$var_username, $encrypted_password
"; # I will remove this in real world
print "You entered an invalid password.
";
print "Access has been denied.
";
$didmsg=1;
last;
}
}
close( FILE );
unless($didmsg) {
print "$var_username, $encrypted_password
"; # I will remove this in real world
print "You entered an invalid username.
";
print "Access has been denied.
";
}