shell bypass 403

UnknownSec Shell

: /scripts/ [ drwxr-xr-x ]

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

# cpanel - scripts/cpbackup_transport_file         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

package scripts::cpbackup_transport_file;

use strict;
use warnings;

use parent qw( Cpanel::HelpfulScript );

use Cpanel::Debug          ();
use Cpanel::Logger         ();
use Cpanel::Backup::Config ();

=encoding utf-8

=head1 NAME

scripts::cpbackup_transport_file

=head1 SYNOPSIS

    cpbackup_transport_file [ --transport <transport_id> --upload </full/path/to/file.ext> | --debug ]
    cpbackup_transport_file [ --transport <transport_id> --download <path/on/remote/file.ext> --download-to </path/on/local/file.ext> | --debug ]
    cpbackup_transport_file [ --help ]

This script will allow you to upload or download any file via the requested backup transport outside of the normal queued process.
As such, it uploads things slightly differently. The file you request to upload will go to a subfolder of the 'path' you configured
for the transport you specify named 'manual_backup'. Example of how it should look uploaded:

myBackups/manual_backup/somefile.ext

Using this script can be useful in debugging transport failures, as there's two benefits here:

* Realtime streaming of all output without having to parse a log file (with option to obtain debugging output)

* No need to wait on backups first -- just provide a path to the file.

Currently, no effort is made in this script to update backup metadata or the transport history DBs.
This is because this script is provided as a convenience to testing, not as a regular part of the backup process.

*NOTE*: On transports that split files up due to necessity (like BackBlaze B2), the --download arg should represent the remote filename
as if it *was not* uploaded in parts. The backup transport code itself will know what to do with that to reconstruct the split file.

=head1 DESCRIPTION

See SYNOPSIS.

=cut

sub _OPTIONS {
    return qw( transport=s upload=s download=s download-to=s debug );
}

exit __PACKAGE__->new(@ARGV)->script() unless caller();

sub script {
    my ($self) = @_;

    my $transport_id    = $self->getopt('transport');
    my $upload_path     = $self->getopt('upload');
    my $download_remote = $self->getopt('download');
    if ( !$transport_id ) {
        print "\n" . $self->help();
        return 1;
    }
    if ( $download_remote && $upload_path ) {
        print "--download and --upload are mutually exclusive options\n\n" . $self->help();
        return 1;
    }
    $Cpanel::Debug::level = 9999 if ( $self->getopt('debug') );

    # Validate the transport_id
    require Cpanel::Backup::Transport;
    my $transports        = Cpanel::Backup::Transport->new();
    my $transport_configs = $transports->get_enabled_destinations();
    my $matching_cfg      = $transport_configs->{$transport_id};
    if ( !$matching_cfg ) {
        print "\nNo backup transports exist that are enabled and match the supplied transport. Exiting...\n";
        return 1;
    }

    if ($upload_path) {
        print "Attempting transport of '$upload_path' using transport ID '$transport_id''.\n";

        # Note, the 'Cpanel::Backup::Queue::transport_backup' package/namespace is also defined by this package, so thus it is imported.
        require Cpanel::Backup::Queue;    # PPI USE OK -- Cpanel::Backup::Queue::transport_backup is defined there
        require Cpanel::Backup::Config;
        require File::Basename;
        my $backup_conf = Cpanel::Backup::Config::load();
        my $args        = {
            local_path  => $upload_path,
            remote_path => 'manual_backup/' . File::Basename::basename($upload_path),
            local_files => $upload_path,
            keep_local  => 1,
            session_id  => 'MANUAL_RUN',
            type        => $backup_conf->{'BACKUPTYPE'},
            cmd         => 'do_the_dew',
            transport   => $transport_id,
        };

        # Log to stdout
        my $logger = Cpanel::Logger->new( { 'use_no_files' => 1 } );
        Cpanel::Backup::Queue::transport_backup->new()->process_task( $args, $logger );    # PPI NO PARSE -- See comment below
                                                                                           # The import of Cpanel::Backup::Queue above via require causes the
                                                                                           # namespace in question here to exist, as it is the kind of package
                                                                                           # which defines multiple packages in one file, as perl allows you to
                                                                                           # do. As this is the "common" design of TaskProcessor modules,
                                                                                           # this is not only expected but appropriate.

    }
    elsif ($download_remote) {
        my $download_local = $self->getopt('download-to');

        require Cpanel::Transport::Files;

        my $transporter = Cpanel::Transport::Files->new( $matching_cfg->{'type'}, $matching_cfg );
        print "Now attempting download of the requested file...\n";
        my $transporter_response = $transporter->get( $download_remote, $download_local );
        if ( !$transporter_response->{'success'} ) {
            print STDERR "[ERROR] $transporter_response->{'msg'}\n";
            return 2;
        }
    }
    else {
        print "\n" . $self->help();
        return 1;
    }
    return 0;
}

0;

© 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!