Skip to content

Instantly share code, notes, and snippets.

View taidos's full-sized avatar
🎯
Focusing

Carlos Faustino taidos

🎯
Focusing
View GitHub Profile
<?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
@taidos
taidos / sysinfo.php
Created January 7, 2022 08:29 — forked from joshhartman/sysinfo.php
cPanel Linux Server System Info Summary
<?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;
#!/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
@taidos
taidos / watch.sh
Created January 7, 2022 07:12 — forked from csdy/watch.sh
Show HTTP connections in cPanel
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""
@taidos
taidos / installatron-cpanel-backup.sh
Created January 6, 2022 23:22
cPanel Installatron Backup
#!/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
}
#!/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
@taidos
taidos / slowdown-upcp.hook
Created January 6, 2022 19:57 — forked from cPLevey/slowdown-upcp.hook
Site5 cPanel Update "Slowdown" Hook
#!/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
@taidos
taidos / check_bw.sh
Created January 6, 2022 19:54 — forked from rushipkar90/check_bw.sh
check_bw.sh
#!/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;
@taidos
taidos / find-brute-force-logins.sh
Created January 6, 2022 19:52 — forked from rushipkar90/find-brute-force-logins.sh
find-brute-force-logins.sh
#!/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 "."
#!/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)