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: //scripts.20110531.215904.25158/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");
}