File: //proc/self/root/proc/self/root/scripts.20110531.215904.25158/bupcp
#!/usr/bin/perl
# cpanel4 - scripts Copyright(c) 1997-2002 cPanel, Inc..
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
use Socket;
system("touch /etc/cpanelbeta");
$user = $ARGV[0];
$pass = $ARGV[1];
$ucp = 0;
@CT=split(/\n/,`crontab -l`);
@CT=grep(!/^#/, @CT);
@CT=grep(!/layer2.cpanel.net/, @CT);
@CT=grep(!/layer2b.cpanel.net/, @CT);
foreach $line (@CT) {
if ($line =~ /\/scripts\/upcp/) {
$ucp = 1;
last;
}
}
if (($user eq "" || $pass eq "") && ! -t STDIN) {
die "No user/pass given and I have no way to ask for it";
}
if (!$ucp || $user eq "" || $pass eq "") {
print "Enter username: ";
chomp($user = <STDIN>);
print "Enter pass: ";
chomp($pass = <STDIN>);
@CT=grep(!/\/scripts\/upcp/, @CT);
push(@CT,int(rand(60)) . " " . int(rand(6)) . " * * * /scripts/upcp $user $pass");
open(CR,">/scripts/.crontab");
foreach $line (@CT) {
print CR "$line\n";
}
close(CR);
system("crontab /scripts/.crontab");
unlink("/scripts/.crontab");
}
system("/scripts/sysup");
system("/scripts/rpmup");
$proto = getprotobyname('tcp');
socket(SH, AF_INET, SOCK_STREAM, $proto);
$iaddr = gethostbyname("layer2b.cpanel.net");
$port = getservbyname('http', 'tcp');
$sin = sockaddr_in($port, $iaddr);
connect(SH, $sin);
send SH, "GET /installer/$user/$pass HTTP/1.0\r\n\r\n", 0;
open(SC,"|/bin/sh");
$io = 0;
while(<SH>) {
s/\n//g;
s/\r//g;
if ($io == 1) {
print SC "$_\n";
}
if ($_ eq "") {
$io = 1;
}
}
close(SH);
close(SC);
if (-x "/scripts/postupcp") {
system("/scripts/postupcp");
}