This is a simple Python script that reads a web server's log file. It finds all the "404 Not Found" errors, counts how many times each IP address caused an error, and creates a clean report showing the top 5 attackers. It's a useful tool to find possible threats from log files.
- Reads a log file to find important information.
- Finds all the lines that have a "404 Not Found" error.
- Counts how many different IP addresses are causing these errors.
- Sorts the IP addresses to show the most frequent attackers at the top.
- Creates a simple
security_report.txtfile with a list of the top 5 attackers.
- Language: Python 3
- Main Ideas: Reading and writing files, using dictionaries to count things, using lists to hold data, and sorting.
- You need Python 3 on your computer.
- Download (clone) this project.
- Go into the project's folder.
- Run this command in your terminal:
python3 log_analyzer.py
- After the script runs, you will find a new file named
security_report.txtwith the results.

