MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //proc/self/root/proc/self/root/scripts.20110531.215904.25158/ftpput
#!/usr/bin/perl
# cpanel - ftpput                                 Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

BEGIN { unshift @INC, '/usr/local/cpanel'; }

use strict;
use Socket;
use Cpanel::HttpRequest;
my $httpClient = Cpanel::HttpRequest->new( 'hideOutput' => 0 );

chdir "/scripts";

my $host = $ARGV[0];
my $user = $ARGV[1];
my $pass = <STDIN>;
$pass =~ s/\n//g;

alarm(200);
use Net::FTP;
open( STDERR, ">&STDOUT" );

my $ftp = Net::FTP->new( "$host", Debug => 1 );
$ftp->login( $user, $pass );
$ftp->put("pkgacct.static");
$ftp->site("chmod 755 pkgacct.static");
$ftp->mkdir( "public_html/cgi-bin/cpdownload", 1 );
$ftp->site("chmod 755 public_html/cgi-bin/cpdownload");
$ftp->cwd("public_html/cgi-bin/cpdownload");
$ftp->put("cpanelwrap.c");
$ftp->put("cpanelwrap.cgi");
$ftp->put("cpaneldownload.cgi");
$ftp->put("cpaneldownacct.cgi");
$ftp->site("chmod 755 cpanelwrap.cgi");
$ftp->site("chmod 755 cpaneldownacct.cgi");
$ftp->site("chmod 755 cpaneldownload.cgi");

my $uid;
my $odebug    = '';
my $hassuexec = 0;
my $script    = 'cpanelwrap.cgi';
my @OPTS      = ( [ $host, "/~${user}/cgi-bin/cpdownload/${script}?${user}" ], [ $host, "/cgi-bin/cpdownload/${script}?${user}" ] );
foreach my $hoste (@OPTS) {
    my ( $host, $url ) = @{$hoste};
    my $req = $httpClient->request(
        'host'     => $host,
        'url'      => $url,
        'protocol' => 0,
    );
    next if ( $req !~ /UID/ );
    foreach ( split( /\n/, $req ) ) {
        $odebug .= $_;
        if (/MYUID: (\d+)/) {
            $uid = $1;
        }
        if (/REALUID: (\d+)/) {
            if ( $1 == $uid ) {
                $hassuexec = 1;
            }
        }
    }
    last;
}

if ( $uid ne "" ) {
    print "Found uid to be: $uid\n";
}
else {
    print "Unable to get uid of remote account...\n";
}

$ftp->quit;