Webshell Scanner Verification
Inspection Method:
yara -r /opt/rules/webshells.yar /var/www/html/Success Criteria: Zero rule matches detected in web directory.
Conducts exhaustive hunting for fileless and obfuscated web shells (PHP, JSP, ASPX, Python), identifies systemd service and timer persistence implants, terminates rogue worker processes, and applies immutable kernel filesystem attributes.
YARAauditdchattrsystemctlfind# Scan web root with YARA webshell repositoryyara -r /opt/rules/webshells.yar /var/www/html/ > /evidence/yara_hits.txt# Identify anomalous scripts modified in last 72hfind /var/www/ -type f \( -name "*.php" -o -name "*.jsp" -o -name "*.phtml" \) -mtime -3 -ls >> /evidence/recent_scripts.txtMatched webshell files, File alteration timestamps# Audit anomalous systemd unit filesls -lat /etc/systemd/system/ /lib/systemd/system/ | grep -v 'total'# Check user and system crontabsfor u in $(cut -f1 -d: /etc/passwd); do crontab -u $u -l 2>/dev/null | grep -v '^#' && echo "User: $u"; done# Remove identified persistent droppersystemctl stop malicious_backdoor.service 2>/dev/null || truesystemctl disable malicious_backdoor.service 2>/dev/null || truerm -f /etc/systemd/system/malicious_backdoor.servicesystemctl daemon-reloadMalicious .service unit files, Crontab dumpschattr -R +i /var/www/html/wp-includes/ /var/www/html/vendor/ 2>/dev/null || truelsattr -d /var/www/html/wp-includes/Filesystem attribute stateWebshell Scanner Verification
Inspection Method:
yara -r /opt/rules/webshells.yar /var/www/html/Success Criteria: Zero rule matches detected in web directory.
Process Tree Validation
Inspection Method:
ps aux | grep -E 'sh|bash|nc|socat|python' | grep www-dataSuccess Criteria: No spawned shells or network listeners attached to web worker processes.