diff --git a/tools/analyze-historical-attacks.sh b/tools/analyze-historical-attacks.sh index 5a7e354..e113935 100755 --- a/tools/analyze-historical-attacks.sh +++ b/tools/analyze-historical-attacks.sh @@ -151,9 +151,9 @@ declare -A SIGNATURE_HITS # Progress indicator show_progress() { - local count=$1 - local total=$2 - local percent=$((count * 100 / total)) +count=$1 +total=$2 +percent=$((count * 100 / total)) echo -ne "\r${BLUE}[*]${NC} Processing: $count/$total lines ($percent%) " } @@ -187,8 +187,8 @@ echo "" CAT_CMD="cat" fi - local file_attacks=0 - local line_count=0 +file_attacks=0 +line_count=0 while IFS= read -r line; do line_count=$((line_count + 1)) @@ -200,17 +200,17 @@ echo "" fi # Analyze line - local result=$(analyze_http_log_line "$line" 2>/dev/null) - local threat_score="${result%%||*}" +result=$(analyze_http_log_line "$line" 2>/dev/null) +threat_score="${result%%||*}" if [ "$threat_score" -ge "$THRESHOLD" ]; then - local temp="${result#*||}" - local attack_types="${temp%%||*}" +temp="${result#*||}" +attack_types="${temp%%||*}" temp="${temp#*||}" - local signatures="${temp%%||*}" +signatures="${temp%%||*}" temp="${temp#*||}" - local ip="${temp%%||*}" - local uri="${temp#*||}" +ip="${temp%%||*}" +uri="${temp#*||}" # Count attacks TOTAL_ATTACKS=$((TOTAL_ATTACKS + 1))