| Server IP : 208.122.213.31 / Your IP : 216.73.216.185 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/babescartel.com/cgi-bin/ |
Upload File : |
#!/usr/bin/perl
use DBI;
use DBD::mysql;
$host = "localhost";
$user = 'auth_mysql';
$pass = 'iCD9AMZg';
$dbas = 'mysql_auth';
$debug = 0;
my $dbh = DBI->connect("DBI:mysql:$dbas:$host", $user, $pass) or die "Unable to connect to database: $dbh->errstr\n";
print "Content-type: text/plain\n\n";
@octets = split('\.', $ENV{'REMOTE_ADDR'});
$classC = "$octets[0].$octets[1].$octets[2].";
if ( ($classC ne '74.206.178.' || $octets[3] <= 222) && $ENV{'REMOTE_ADDR'} ne '64.59.76.8' && $classC ne '74.206.178.' && $classC ne '208.122.223.' ) {
print $ENV{'REMOTE_ADDR'};
print "Wrong IP";
exit(-1);
}
if ($ENV{'REQUEST_METHOD'} ne "POST") {
print "TESTS OKAY.\n";
exit(1);
}
while (<STDIN>) {
$data .= $_;
}
if ( ($data =~ /^CHECK/) || ($data =~ /^DELETE/) ) {
($command, $ht_file, $user, $password) = split(',',$data);
} elsif ( $data =~ /^ADD/ ) {
($command, $ht_file, $user, $password, $group) = split(',',$data);
} else {
print "COMMAND NOT RECOGNIZED\n";
exit(-1);
}
$qry = "SELECT user_name FROM $ht_file WHERE user_name = '$user'";
my $find = $dbh->prepare("$qry");
$find->execute or die "Unable to execute query: $dbh->errstr";
($user_name) = $find->fetchrow_array;
if ($user_name) {
$found = 1;
} else {
$found = 0;
}
if ( $debug ) {
print "user_there_variable=$found\n";
}
if ( $command =~ /CHECK/ ) {
if ( $found ) {
print "FOUND\n";
} else {
print "NOT_FOUND\n";
}
exit(0);
} elsif ( $command =~ /ADD/ ) {
my $insert = $dbh->prepare("REPLACE INTO $ht_file SET user_name = '$user', user_passwd = PASSWORD('$password'), user_group = '$group'");
if($insert->execute) {
print "ADDED $user\n";
} else {
print "ERROR\n";
}
exit(0);
} elsif ( $command =~ /DELETE/ ) {
my $delete = $dbh->prepare("DELETE FROM $ht_file WHERE user_name = '$user'");
if ( $delete->execute ) {
print "DELETED $user\n";
} else {
print "ERROR\n";
}
exit(0);
} else {
print "COMMAND NOT RECOGNIZED\n";
exit(-1);
}
exit(0);