This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
echo > /usr/local/src/temp_eximlog | |
echo > /usr/local/src/maliciousresults | |
echo > /usr/local/src/maliciousfiles | |
a=`date --date="3 hours ago" +%Y-%m-%d\ %H` | |
b=`date +%Y-%m-%d\ %H` | |
awk -v s="$a" -v e="$b" '$0~s,$0~e' /var/log/exim_mainlog >> /usr/local/src/temp_eximlog | |
cat /usr/local/src/temp_eximlog | awk '{print $3}' | grep /home | sort | uniq -c | sort -nr > scanmaillogdir.txt | |
for i in `cat /usr/local/src/scanmaillogdir.txt | cut -d= -f2` ; do | |
find $i -type f -name '*.php' -exec egrep -q 'yMxbgVDJ96|wUu2jGoB|$xYEzDu6r3EZT|$ZR2%tuMpYFr|$knmui74|x47LOBA|EWnBCG-hUfK|vC82XHO|rOqYibX4WA|ALaEJ!Pw|vHHEE8M|v08X2QH|vO5CQ7A|qjyxw29' {} \; -print >> /usr/local/src/maliciousfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \; > wordpress.txt | |
find /home/*/public_html/ -type f \( -iwholename '*/libraries/joomla/version.php' -o -iwholename '*/libraries/cms/version.php' -o -iwholename '*/libraries/cms/version/version.php' \) -print -exec perl -e 'while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);' {} \; > joomla.txt | |
find /home/*/public_html/ -type f -iwholename "*/modules/system/system.info" -exec grep -H "version = \"" {} \; > drupal.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LIST=$1 | |
LOG=spf_add.log | |
date > $LOG | |
lecho() { | |
echo $@ 2>&1 | tee -a $LOG | |
} | |
backup_zones(){ | |
FILE=$(hostname)-$(date +%s)-zones.tgz | |
tar czf $FILE /var/named/*.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Directory to store log files in | |
DST=/root/autotermination_logs | |
# Create DST if it doesn't exist | |
if [ ! -d "$DST" ]; then | |
mkdir -p $DST | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use lib '/root/sysutils/modules'; | |
use XML::Simple; | |
use Data::Dumper; | |
use XMLAPIRequest; | |
chomp(my $hostname = `hostname`); | |
$xmlapi = XMLAPIRequest->new( | |
'HOSTNAME' => $hostname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Display bandwidth usage | |
# By [email protected] 2012/04/17 | |
if [ $# -lt 2 ]; | |
then echo "Error: wrong number of arguments"; | |
echo "Usage: $0 <username or site name> <traffic type> <month> <year> e.g. $0 stupi402 imap 4 2012" | |
echo "If no month and/or year are specified, script will display data for current month/year."; | |
echo "Also Please note that cPanel doesn't seem to save per-domain bandwidth for imap, ftp, pop and smtp." | |
exit 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/cpanel/3rdparty/perl/514/bin/perl | |
#use strict; | |
use warnings; | |
use YAML::Tiny; | |
use Data::Dumper; | |
my $username = $ARGV[0]; | |
my @dnsservers = ("8.8.8.8","8.8.4.4"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/cpanel/3rdparty/perl/514/bin/perl | |
use RRDs; | |
use Getopt::Long; | |
my $server; | |
my $direction; | |
GetOptions( | |
"server=s" => \$server, | |
"direction=s" => \$direction, | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/usr/sbin/exiqgrep -i -r root@`hostname`| xargs /usr/sbin/exim -Mrm > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ionice -c3 find /home/*/fantastico_backups/ -name 'backup*' -mtime +15 -exec rm {} \; | |
ionice -c3 find /home/*/fantastico_backups/ -name '.backup*' -mtime +15 -exec rm {} \; | |
ionice -c3 find /home/*/tmp/Cpanel_Form_file.upload.* -mtime +0 -exec rm {} \; | |
ionice -c3 find /home/*/mail/*/*/.Trash/cur/* -type f -mtime +6 -exec rm {} \; | |
ionice -c3 find /home/*/mail/*/*/.Trash/new/* -type f -mtime +6 -exec rm {} \; | |
ionice -c3 find /home/*/mail/.Trash/cur/* -type f -mtime +6 -exec rm {} \; | |
ionice -c3 find /home/*/mail/.Trash/new/* -type f -mtime +6 -exec rm {} \; |