!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/usr/share/webmin/virtual-server/   drwxrwxr-x
Free 28.39 GB of 117.98 GB (24.06%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     save_s3.cgi (2.33 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# Create, update or delete an S3 acccount

require './virtual-server-lib.pl';
&ReadParse();
&error_setup($in{'delete'} ? $text{'s3_err2'} : $text{'s3_err'});
&can_cloud_providers() || &error($text{'s3s_ecannot'});

# Get the account
my @users;
my $s3;
if ($in{'new'}) {
    $s3 = { };
    }
else {
    ($s3) = grep { $_->{'id'} eq $in{'id'} } &list_s3_accounts();
    $s3 || &error($text{'s3_egone'});
    @users = grep { &backup_uses_s3_account($_, $s3) }
              &list_scheduled_backups();
    }

if ($in{'delete'}) {
    # Delete unless in use
    @users && &error(&text('s3_eusers', scalar(@users)));
    &delete_s3_account($s3);
    &webmin_log("delete", "s3", $s3->{'access'});
    }
else {
    # Validate inputs
    $s3->{'desc'} = $in{'desc'};
    $in{'access'} =~ /^\S+$/ || &error($text{'backup_eakey'});
    $s3->{'access'} = $in{'access'};
    $in{'secret'} =~ /^\S+$/ || &error($text{'backup_eskey'});
    $s3->{'secret'} = $in{'secret'};
    if ($in{'endpoint_def'}) {
        delete($s3->{'endpoint'});
        $s3->{'location'} = $in{'location'};
        }
    else {
        $in{'endpoint'} =~ s/^(http|https):\/\///;
        my ($host, $port) = split(/:/, $in{'endpoint'});
        &to_ipaddress($host) ||
            &error($text{'cloud_es3_endpoint'});
        !$port || $port =~ /^\d+$/ ||
            &error($text{'cloud_es3_endport'});
        $s3->{'endpoint'} = $in{'endpoint'};
        $s3->{'location'} = $in{'location2'};
        }
    $s3->{'id'} ||= &domain_id();
    if ($s3->{'location'}) {
        @locs = &s3_list_locations($s3);
        !@locs || &indexof($s3->{'location'}, @locs) >= 0 ||
            &error($text{'s3_elocation'});
        }

    # Validate that it works
    my $buckets = &s3_list_buckets($s3);
    if (!ref($buckets)) {
        &delete_s3_account($s3) if ($in{'new'});
        &error(&text('s3_echeck', $buckets));
        }

    # Save the account
    &save_s3_account($s3);

    # Update existing backups if the keys changed
    foreach my $sched (@users) {
        my @newdests;
        foreach my $dest (&get_scheduled_backup_dests($sched)) {
            my @p = &parse_backup_url($dest);
            if ($p[0] == 3) {
                $p[1] = $s3->{'access'};
                $p[2] = $s3->{'secret'} if ($p[2]);
                push(@newdests, &join_backup_url(@p));
                }
            else {
                push(@newdests, $dest);
                }
            }
        $sched->{'dest'} = $newdests[0];
        for(my $i=1; $i<@newdests; $i++) {
            $sched->{'dest'.$i} = $newdests[$i];
            }
        &save_scheduled_backup($sched);
        }

    &webmin_log($in{'new'} ? "create" : "update", "s3", $s3->{'access'});
    }

&redirect("list_s3s.cgi");

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0035 ]--