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:
@@ -1036,7 +1036,7 @@ detect_threats() {
|
|||||||
|
|
||||||
# Breakdown by attack type
|
# Breakdown by attack type
|
||||||
for attack_type in sqli xss path_traversal rce_upload info_disclosure login_bruteforce; do
|
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}' | \
|
awk -F'|' '{print $1"|"$2"|"$3"|"$4}' | \
|
||||||
sort | uniq -c | sort -rn > "$TEMP_DIR/${attack_type}_attempts.txt" || true
|
sort | uniq -c | sort -rn > "$TEMP_DIR/${attack_type}_attempts.txt" || true
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user