Skip to content

Latest commit

 

History

History
77 lines (59 loc) · 1.89 KB

README.md

File metadata and controls

77 lines (59 loc) · 1.89 KB

Security Log Analyzer

A Flask-based web application for analyzing security log files to detect potential cyber attacks. The application provides a modern user interface for uploading log files and visualizes the analysis results using interactive charts.

Features

  • Upload and analyze security log files
  • Detect multiple types of attacks:
    • SQL Injection attempts
    • Cross-Site Scripting (XSS)
    • DDoS attacks
    • Brute Force attempts
  • Interactive visualizations using Chart.js
  • Detailed attack analysis with timestamps and IP addresses
  • Download analysis results in JSON or CSV format
  • Drag-and-drop file upload interface

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/security-log-analyzer.git
cd security-log-analyzer
  1. Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Start the Flask application:
python app.py
  1. Open your web browser and navigate to:
http://localhost:5000
  1. Upload a log file using one of these methods:

    • Click the upload area and select a file
    • Drag and drop a file onto the upload area
  2. View the analysis results:

    • Attack distribution chart
    • IP frequency chart
    • Detailed attack table
    • Statistics summary
  3. Download results:

    • Click "Download JSON" for raw data
    • Click "Download CSV" for spreadsheet format

Supported Log Formats

The analyzer supports common log formats including:

  • Apache access logs
  • Nginx access logs
  • Custom log formats with timestamps and IP addresses

Security Considerations

  • Maximum file size: 16MB
  • Allowed file extensions: .log, .txt
  • Files are processed in memory without permanent storage
  • Input sanitization for XSS prevention
  • Secure file handling using Werkzeug