MOON
Server: Apache
System: Linux vps.thepromohut.com 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: caretrak (507)
PHP: 5.2.10
Disabled: NONE
Upload Files
File: //scripts.20110601.041516.15411/fixtrojans
#!/usr/bin/perl
# cpanel - fixtrojans                             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 Cpanel::Sys::OS ();
use Net::FTP;

$|=1;

@IGNORERPMS=("kernel","apache","php");

$arch = 'x86';  #we only support x86 right now

if ($ARGV[0] eq "") {
	die "Usage: fixtrojans <trojansfile>\n";
}


if(-e "/etc/mandrake-release") {
        $distro = 'mandrake';
        $version = Cpanel::Sys::OS::getversionfromfile('/etc/mandrake-release');
} elsif (-e "/etc/redhat-release") {
        $distro = 'redhat';
        $version = Cpanel::Sys::OS::getversionfromfile('/etc/redhat-release');
} else {
        print "Your linux distro is NOT SUPPORTED\n";
}


open(TF,$ARGV[0]);
while(<TF>) {
	if (/Possible Trojan - (\S+)/) {
		chomp($pkg = `rpm -qf $1`);
		@PK = split(/\n/, $pkg);
		$pkg = $PK[$#PK];
		$PKGS{$pkg} = 1;
	}
}
close(TF);


#$updatesite = Net::FTP->new("httpupdate.cpanel.net");
#$updatesite->login("anonymous","root@");
#$updatesite->cwd("/pub/redhat/redhat-$version/i386/RedHat/RPMS");

foreach $rpm (sort keys %PKGS) {
	print "Fetch $rpm\n";
#	$updatesite->get("$rpm.i386.rpm");
}