Skip to content

Instantly share code, notes, and snippets.

@oscarvs
Created June 6, 2016 06:40
Show Gist options
  • Save oscarvs/fc215ae3d3c17d89164e27f85515700e to your computer and use it in GitHub Desktop.
Save oscarvs/fc215ae3d3c17d89164e27f85515700e to your computer and use it in GitHub Desktop.
Command Line Tools for DDOS related
IPs are being connected to the server and how many connections are for each IP:
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
How many connections are being received by each server IP:
netstat -plan |grep :80 | awk '{print $4}' | cut -d: -f1 | sort | uniq -c | sort -n
To see the total amount of active apache connections:
netstat -apn | grep :80 | wc -l
Tail log Apache errors:
tail -f /etc/httpd/logs/error_log
Stop/Restart
service httpd stop
fuser -k 80/tcp #Show what PID is listening on port 80 on Linux
service httpd start
Apache Status via console
/usr/sbin/httpd fullstatus
Apache Status via lynx
lynx http://localhost/whm-server-status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment