This file contains 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
<?php | |
$user = "root"; | |
$token = "YOURTOKENHERE"; | |
$query = "https://YOURIP:YOURPORT/json-api/listaccts?api.version=1"; | |
//json-api/listaccts -- generic info, disk usage, start date, domain, | |
//get_disk_usage -- disk usage obviously | |
//showbw -- bandwidth |
This file contains 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
<?php | |
function sys_uptime(){ | |
$uptime = ''; | |
if(is_readable('/proc/uptime')){ | |
$str = @file_get_contents('/proc/uptime'); | |
$num = floatval($str); | |
$secs = $num % 60; | |
$num = (int)($num / 60); | |
$mins = $num % 60; |
This file contains 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 | |
for domainhash in `cat /etc/userdomains | grep "\." | sed 's/ //'` | |
do | |
read domain user <<<$(echo $domainhash | sed 's/:/ /'); | |
find /home/${user}/mail/${domain}/*/.Trash/{cur,new,tmp}/ -type f | xargs -ifile rm -f file | |
find /home/${user}/mail/${domain}/*/.Junk/{cur,new,tmp}/ -type f | xargs -ifile rm -f file | |
done |
This file contains 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
watch -n 2 "/usr/bin/lynx -dump -width 500 http://127.0.0.1/whm-server-status | tail -n +26 | grep -v 'OPTIONS' | grep -v '::1' | grep -v 'whm-server-status' | grep -v 'cptemplate.hostek.com' | grep -v 'hostname --ip-address' | grep -v 'NULL'" | |
# Generic | |
watch -n 2 "/usr/bin/lynx -dump -width 500 http://127.0.0.1/whm-server-status | tail -n +26" | |
# WordPress/Joomla/vBulletin | |
watch -n 2 "/usr/bin/lynx -dump -width 500 http://127.0.0.1/whm-server-status | grep -e "wp-login.php" -e "administrator/index.php" -e "*vbulletin"" | |
# Wordpress XMLRPC | |
watch -n 2 "/usr/bin/lynx -dump -width 500 http://127.0.0.1/whm-server-status | grep -e "xmlrpc.php"" |
This file contains 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 | |
#EK | |
telegram() { | |
USERID="" | |
KEY="" | |
URL="https://api.telegram.org/bot${KEY}/sendMessage" | |
TEXT="${1}" | |
curl -s -d "chat_id=${USERID}&text=${TEXT}&disable_web_page_preview=true&parse_mode=markdown" $URL > /dev/null | |
} |
This file contains 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 | |
/sbin/modprobe nf_conntrack_ftp 2>&1 >/dev/null | |
IPTABLES='/sbin/iptables' | |
# policy | |
$IPTABLES -P INPUT DROP | |
$IPTABLES -P OUTPUT DROP | |
$IPTABLES -P FORWARD ACCEPT | |
$IPTABLES -F | |
$IPTABLES -X | |
$IPTABLES -Z |
This file contains 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 | |
# Pre-upcp hook which will deny upcp in case the server already has IO, | |
# chef-client, cdp etc. are running..! | |
# Story: https://wwwhosting.atlassian.net/browse/SH-222 | |
# Set limit load avg. for VPS/hardware | |
# Defaults to 6 for VPS and 10 for hardware ones | |
if [[ $(/sbin/lspci | wc -l) -eq 0 ]]; then | |
limit_load=6 |
This file contains 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 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 | |
BFDOMS=/root/.bf-doms | |
BFIPS=/root/.bf-ips | |
FINAL=/root/.bf-blacklist | |
DATE=$(date +%d/%b/%Y) | |
echo -n "Capturing for 30s.." | |
for S in {1..30}; do | |
service httpd fullstatus | grep POST | grep login | awk '{print $1}' >> $BFDOMS | |
sleep 1 | |
echo -n "." |
This file contains 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 | |
# Author: Igor Andrade = [] | |
# Author: Thiago Dantas = [] | |
# | |
###### | |
# Date: 22/01/2021 - TechOps LatAm | |
# Version 0.1 - abusefinder | |
# | |
# Deep analysis on the main ports that are used by cPanel | |
# Filter and analysis of requests that can be an attack (xmlrpc, form attack, and high number of requests GET/POST) |