shell bypass 403

UnknownSec Shell

: /scripts/ [ drwxr-xr-x ]

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

# cpanel - scripts/secureit                        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::Usage        ();
use Cpanel::Init::Simple ();
use Cpanel::OS           ();

# Parse command line.
my $dryrun  = 0;
my $try_rpm = 0;
Cpanel::Usage::wrap_options( \@ARGV, \&usage, { 'dryrun' => \$dryrun, 'fast' => \$try_rpm } );

exit 0 if -e '/var/cpanel/nosecureit' || -e '/var/cpanel/disabled/secureit';

#----------------------------------------------------------------------

my @serviceList = ( 'portmap', 'lpd', 'apmd', 'gpm', 'innd', 'pcmcia', 'smb', 'xfs', 'ypbind' );

{
    local $SIG{__WARN__} = sub { };    # we expect some of these to fail
    foreach my $serviceName (@serviceList) {
        Cpanel::Init::Simple::call_cpservice_with( $serviceName => qw/stop disable/ );

    }
}

#----------------------------------------------------------------------

my @OKSUID = (qw/crontab cpwrap jailshell passwd ksu su suexec suphp exim sendmail fpexe wrapper sudo sudoedit gpasswd sendmail.sendmail cagefs_enter.proxied/);
my @OKGUID = (qw/crontab procmail wall man sendmail sendmail.sendmail screen/);

# to use rpm to find [sg]uid files --fast needs to be passed and we've got to be an RPM based linux
if ( $try_rpm && Cpanel::OS::is_rpm_based() ) {
    cleanse_sguid_rpm();
}
else {
    cleanse_sguid_find();
}

sub cleanse_sguid_find {
    print "Finding set[gu]id files via find\n";

    my @SUID = `nice -19 /usr/bin/find /usr /sbin /bin -uid 0 -perm /4000`;
    my @GUID = `nice -19 /usr/bin/find /usr /sbin /bin -uid 0 -perm /2000`;
    chomp @SUID;
    chomp @GUID;

    foreach my $item (@SUID) {
        next if ( $item =~ m{^/usr/local/cpanel} );    # Skip cpanel files.
        next if ( $item =~ /modsec_audit/ );
        $item =~ s/\n//g;
        my $itemok = 0;
        foreach my $match (@OKSUID) {
            if ( $item =~ /${match}$/ ) {
                $itemok = 1;
            }
        }
        if ( $itemok == 0 ) {
            print "Removing suid from $item\n";
            system( 'chmod', 'u-s', $item ) if ( !$dryrun );
        }
    }

    foreach my $item (@GUID) {
        next if ( $item =~ m{^/usr/local/cpanel} );    # Skip cpanel files.
        next if ( $item =~ /modsec_audit/ );
        $item =~ s/\n//g;
        my $itemok = 0;
        foreach my $match (@OKGUID) {
            if ( $item =~ /${match}$/ ) {
                $itemok = 1;
            }
        }
        if ( $itemok == 0 ) {
            print "Removing guid from $item\n";
            system( 'chmod', 'g-s', $item ) if ( !$dryrun );
        }
    }
    return;
}

sub cleanse_sguid_rpm {
    print "Finding set[gu]id files via the RPM database\n";

    my @RPMFILES = `rpm -qa --queryformat '[%{FILEMODES} %{FILENAMES}\n]'`;
    chomp @RPMFILES;
    @RPMFILES = grep { !m{^\d+\s+/usr/local/cpanel} } @RPMFILES;    # Strip out cpanel installed rpms

  SUID: foreach my $item (@RPMFILES) {
        my ( $perm, $file ) = split( " ", $item, 2 ) or next;
        next if ( $perm !~ m/^\d+$/ );                              # Lines that don't mention files (%{FILENAMES})
        next if ( !( $perm & 04000 ) );
        next if !-e $file;

        foreach my $match (@OKSUID) {
            if ( $file =~ m{/${match}$} ) {
                print "Skipping suid removal for $file\n";
                next SUID;
            }
        }
        print "Removing suid from $file\n";

        system( 'chmod', 'u-s', $file ) if ( !$dryrun );
    }

  GUID: foreach my $item (@RPMFILES) {
        my ( $perm, $file ) = split( " ", $item, 2 ) or next;
        next if ( $perm !~ m/^\d+$/ );    # Lines that don't mention files (%{NAME})
        next if ( !( $perm & 02000 ) );
        next if !-e $file;

        foreach my $match (@OKGUID) {
            if ( $file =~ m{/${match}$} ) {
                print "Skipping guid removal for $file\n";
                next GUID;
            }
        }
        print "Removing guid from $file\n";
        system( 'chmod', 'g-s', $file ) if ( !$dryrun );
    }
    return;
}

sub usage {
    print qq{Usage: $0 [options]};
    print qq{

    Options:
      --help     Brief help message
      --dryrun   Do not make any changes but show what would happen.
      --fast     On RPM systems, do not walk the file system, instead,
                 get the file permissions list from the RPM DB. This is
                 only useful once. After that the DB will be out of sync
                 with the file system. This option is mostly useful
                 during install


};
    exit 1;
}

© 2025 UnknownSec
Display on the page Footer | Anyleson - Learning Platform
INR (₹)
India Rupee
$
United States Dollar

Display on the page Footer

Privacy Policy

Effective Date: 24 August , 2024

At Anyleson, we are committed to protecting your privacy and ensuring that your personal information is handled securely and responsibly. This Privacy Policy outlines how we collect, use, and safeguard your data when you use our platform.


Information We Collect


  1. Personal Information:

    • Name, email address, phone number, and billing details.

    • Account login credentials (username and password).



  2. Course Usage Data:

    • Progress and activity within courses.

    • Feedback and reviews submitted for courses.



  3. Technical Information:

    • IP address, browser type, device information, and cookies for improving website functionality.



  4. Communication Data:

    • Information from your interactions with our customer support.




How We Use Your Information


  1. To Provide Services:

    • Process course purchases, registrations, and access to content.



  2. To Improve User Experience:

    • Analyze user behavior to enhance course offerings and platform features.



  3. To Communicate:

    • Send updates, notifications, and promotional offers (only if you’ve opted in).



  4. For Legal Compliance:

    • Meet legal or regulatory requirements and prevent fraud.




How We Protect Your Information


  1. Data Encryption: All sensitive data is encrypted during transmission using SSL.

  2. Access Control: Only authorized personnel have access to personal information.

  3. Secure Storage: Data is stored on secure servers with regular security updates.


Sharing Your Information

We do not sell, rent, or trade your personal data. However, we may share your information with:


  1. Service Providers:

    • Payment processors and hosting services that assist in delivering our platform.



  2. Legal Authorities:

    • When required by law or to protect our legal rights.




Your Rights


  1. Access and Update: You can view and update your personal information in your account settings.

  2. Request Deletion: You have the right to request deletion of your data by contacting us.

  3. Opt-Out: You can opt out of receiving promotional emails by clicking the “unsubscribe” link in our emails.


Cookies Policy

We use cookies to enhance your experience by:


  • Remembering your preferences.

  • Analyzing website traffic.
    You can manage your cookie preferences through your browser settings.


Third-Party Links

Our platform may contain links to third-party websites. We are not responsible for their privacy practices and recommend reviewing their privacy policies.


Policy Updates

We may update this Privacy Policy from time to time. Changes will be posted on this page, and the "Effective Date" will be updated. Please review the policy periodically.


Contact Us

If you have any questions or concerns about our Privacy Policy or how your data is handled, please contact us at:

Email: support@anyleson.comThank you for trusting Anyleson with your learning journey!