#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - scripts/httpspamdetect Copyright 2022 cPanel, L.L.C.
# All rights reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
use strict;
use warnings;
use Cpanel::AcctUtils::DomainOwner::Tiny ();
use Cpanel::SafeRun::Simple ();
use Cpanel::ApacheServerStatus ();
use Socket;
my %HTTPPIDS;
my %HTTPVHOSTS;
my %HTTPURL;
my %HTTPOWNER;
my %PCOUNT;
eval {
$SIG{'ALRM'} = sub {
die;
};
alarm(30);
my $proto = getprotobyname('tcp');
socket( WHMS, AF_INET, SOCK_STREAM, $proto );
my $iaddr = inet_aton("127.0.0.1");
my $port = getservbyname( 'http', 'tcp' );
my $sin = sockaddr_in( $port, $iaddr );
my $server_status_key = Cpanel::ApacheServerStatus::get_whm_server_status_key();
connect( WHMS, $sin );
send WHMS, "GET /$server_status_key HTTP/1.0\r\n\r\n", 0;
shutdown( WHMS, 1 );
while ( my $nline =