shell bypass 403

UnknownSec Shell

: /proc/self/root/scripts/ [ drwxr-xr-x ]

name : spamassassindisable
#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/spamassassindisable             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::AccessIds::ReducedPrivileges ();
use Cpanel::Config::CpConfGuard          ();
use Cpanel::FileUtils::TouchFile         ();
use Cpanel::LoginDefs                    ();
use Cpanel::PwCache::Build               ();
use Cpanel::Usage                        ();

local $| = 1;

my $quiet = 0;
my $force = 0;
my $undo  = 0;
my %opts  = ( 'q' => \$quiet, 'quiet' => \$quiet, 'f' => \$force, 'force' => \$force, 'undo' => \$undo );

Cpanel::Usage::wrap_options( \@ARGV, \&usage, \%opts );

unless ($quiet) {
    print "??????????????????????????????????????????????????????????????????\n";
    print "This will disable SpamAssassin filtering for all accounts\n";
    print "on the server. If you do not wish to do this, then hit Ctrl-C now.\n";
    print "??????????????????????????????????????????????????????????????????\n\n";
}
unless ($force) {
    print "Sleeping for 5 seconds ... (Ctrl-C to abort)\n";
    sleep 5;
}

Cpanel::PwCache::Build::init_passwdless_pwcache();
my $pwcache_ref = Cpanel::PwCache::Build::fetch_pwcache();
my $uid_min     = Cpanel::LoginDefs::get_uid_min();
my ( $useruid, $usergid, $homedir );
foreach my $pwref ( grep { $_->[2] >= $uid_min } @{$pwcache_ref} ) {
    ( $useruid, $usergid, $homedir ) = ( ( @{$pwref} )[ 2, 3, 7 ] );

    # Drop privileges to read/write the directory as the user
    my $reduced_privs_guard = Cpanel::AccessIds::ReducedPrivileges->new(
        $useruid, $usergid,
    );

    if ($undo) {

        my $old_touchfile = $homedir . '/.spamassassinboxdisabled';
        my $new_touchfile = $homedir . '/.spamassassinboxenable';

        replace_touchfile( $old_touchfile, $new_touchfile, $quiet );

        $old_touchfile = $homedir . '/.spamassassindisabled';
        $new_touchfile = $homedir . '/.spamassassinenable';

        replace_touchfile( $old_touchfile, $new_touchfile, $quiet );
    }
    else {

        my $old_touchfile = $homedir . '/.spamassassinboxenable';
        my $new_touchfile = $homedir . '/.spamassassinboxdisabled';

        replace_touchfile( $old_touchfile, $new_touchfile, $quiet );

        $old_touchfile = $homedir . '/.spamassassinenable';
        $new_touchfile = $homedir . '/.spamassassindisabled';

        replace_touchfile( $old_touchfile, $new_touchfile, $quiet );
    }
}

exit if $undo;

unless ($quiet) {
    print "Updating /var/cpanel/cpanel.config\n";
}

my $cpconf_guard = Cpanel::Config::CpConfGuard->new();
$cpconf_guard->{'data'}->{'skipspamassassin'} = 1;
$cpconf_guard->{'data'}->{'skipspambox'}      = 1;
$cpconf_guard->save();

sub replace_touchfile {
    my ( $old_touchfile, $new_touchfile, $quiet ) = @_;

    if ( -e $old_touchfile ) {
        unless ($quiet) {
            print "Creating $new_touchfile\n";
            print "Unlinking $old_touchfile\n";
        }
        if ( !-e $new_touchfile ) {
            Cpanel::FileUtils::TouchFile::touchfile($new_touchfile);
        }
        unlink($old_touchfile);
    }

    return;
}

sub usage {
    print <<EOM;
spamassassindisable - disable spamassassin for all accounts

    Options:
        --force     bypass 5 second sleep
        --quiet     do not provide any output on STDOUT
        --help      display this message and exit
        --undo      re-enable spamassassin for all the users for which this has been disabled by this script

The force and quiet are useful when running this
script as a part of an automated process (e.g. cron).

EOM
    exit;
}

© 2025 UnknownSec
Courses | Anyleson - Learning Platform
INR (₹)
India Rupee
$
United States Dollar

Courses

17 Courses
Course
Full Stack Web Development

Full Stack Web Development

in Web Development
83:20 Hours
10 Oct 2024
₹28,318.82
Course
Installment and Secure Host

Installment and Secure Host

in Business Strategy
5.00
1:30 Hours
16 Mar 2023
₹118
Course
New Update Features

New Update Features

in Language
4.00
1:30 Hours
21 Jun 2022
Free
Not conducted
Bestseller
New In-App Live System

New In-App Live System

in Communications
5.00
2:30 Hours
1 Mar 2026
₹11.80
Featured
New Learning Page

New Learning Page

in Lifestyle
5.00
3:30 Hours
1 Mar 2022
Free
Finished
How to Travel Around the World

How to Travel Around the World

in Lifestyle
5.00
2:30 Hours
2 Mar 2022
₹29.50

Type

More options