Fix: Remove regex anchor from attack_type grep pattern

The pattern was using grep -F with || which is correct for
fixed-string matching in pipe-delimited format. Removed the second grep
with the problematic $ anchor since we're already matching the full
pipe-delimited field.
This commit is contained in:
Developer
2026-04-23 22:12:20 -04:00
parent cf362c2adf
commit b0873bbf13
+1 -1
View File
@@ -1036,7 +1036,7 @@ detect_threats() {
# Breakdown by attack type
for attack_type in sqli xss path_traversal rce_upload info_disclosure login_bruteforce; do
grep -F "|$attack_type" "$TEMP_DIR/attack_vectors_raw.txt" 2>/dev/null | grep -F "|$attack_type$" | \
grep -F "|$attack_type|" "$TEMP_DIR/attack_vectors_raw.txt" 2>/dev/null | \
awk -F'|' '{print $1"|"$2"|"$3"|"$4}' | \
sort | uniq -c | sort -rn > "$TEMP_DIR/${attack_type}_attempts.txt" || true
done