Skip to main content

One-liners

====================================================================================

Traffic Analysis

(File paths will need updating for these commands)

------------------------------------------------------------------------------------------------------------------------------------------------

wp-login requests

grep -i 'wp-login' /var/www/vhosts/*/logs/access_ssl_log | cut -d ':' -f1 | sort | uniq -c

------------------------------------------------------------------------------------------------------------------------------------------------

xmlrpc requests

grep -i 'xmlrpc' /var/www/vhosts/*/logs/access_ssl_log | cut -d ':' -f1 | sort | uniq -c

------------------------------------------------------------------------------------------------------------------------------------------------

bot traffic user agents

 awk -F'"' '{print $6}' /var/www/vhosts/domain/logs/access_ssl_log | sort | uniq -c | sort -nr | head -20 | grep -iE 'bot|crawler'

------------------------------------------------------------------------------------------------------------------------------------------------