✅
International Publishing Platform
Serving Researchers Since 2012

BruteStop: Autonomous self-protecting firewall

DOI : 10.17577/IJERTV15IS120036
Download Full-Text PDF Cite this Publication

Text Only Version

BruteStop: Autonomous self-protecting firewall

Sanjana KP, Spoorti ,Vaisiri NL , Vathsala M.Wagh

(4JN23CS132,4JN23CS148,4JN23CS172,4JN23CS176)

Departement of Computer Science and Engineering

Jawaharlal Nahru New Collage of Engineering,Shivamogga,Karnataka,India

Under the guidance of Mrs. Vanitha D, B.E, M Tech

Abstract – To prevent unauthorized entry a sign that someone is trying to guess passwords or test stolen credentials. This paper describes BruteStop, a Python-based prototype that uses a Random Forest model to identify login behaviour that resembles a brute-force attack. The system records authentication events, derives five features for each source address, and uses the model to estimate whether the activity is normal or suspicious. Its prediction can be connected to event logging, dashboard alerts, incident records, and optional blocking. The current model is trained with synthetic examples, however, and the project materials do not provide a labelled real-world test set or measured detection results. For that reason, this paper focuses on the system design and a practical plan for evaluating it rather than claiming a level of accuracy remains demonstrated.

The system also provides attack classification to distinguish between brute force, password spraying, and credential stuffing attacks. Additionally, it includes XSS and SQL injection vulnerability scanning for login pages and maintains incident information for security analysis and reporting. Overall, BruteStop AI combines machine learning, automated response, and web security analysis to provide a practical and proactive login protection system.

Index TermsBrute-force attack, machine learning, Random Forest, login anomaly detection, cybersecurity, intrusion detection, automated response,XSS,SQL injection.

  1. INTRODUCTION

    Normaly a Web login page recives failed login attempts , such as mistyping username or password. But there can also be a targeted attack, like many login attempts across several username,password , Java Script or SQL commands. These patterns can vary significantly across one another, which makes detection more difficult than simply counting failed logins.

    A machine-learning model can consider several signals together instead of relying on a single characteristic of the traffic. Random Forest is used in BruteStop because it combines ensemble of tree-based learners and can represent complex inter- feature dependencies eliminating manual a very complicated deployment.Even so Even so, the model’s output depends on the examples used to train it

    Basic threshold Rule-based mechanisms offer distinct advantages are easy to explain and inexpensive to run. However, a fixed threshold may not identify every suspicious pattern before the threshold is reached, and aggressive rules can also inconvenience users who make genuine mistakes. Machine- learning classifiers can add a behavioural signal, but they are only as dependable as their

    training data and must not be presented as a guarantee against previously unseen attacks.

    BruteStop- was developed as a practical prototype for connecting authentication logging, hybrid detection, automated blocking, and an analyst-facing dashboard. Its applicationlayer detector combines a fixed threshold with a Random Forest model. A separate, optional Scapy monitor observes TCP SYN activity, and the dashboard includes incident explanations and basic vulnerability checks for authorised test targets. This paper documents the current implementation, distinguishes implemented functions from optional components, and identifies the evidence still needed for a formal performance evaluation.

  2. PROBLEM STATEMENT

    Web applications are vulnerable to repeated login attacks such as brute force, password spraying, and credential stuffing. Traditional systems often lack intelligent real-time detection and automated response, allowing attackers to continue their attempts. Login pages may also contain vulnerabilities such as XSS and SQL Injection that can be exploited by attackers. Hence, addressing these gaps for a system that can monitor login traffic, detect and classify attacks, identify web vulnerabilities, and automatically block malicious IP addresses

  3. MOTIVATION

    Authentication systems are the first line of defence for web applications, which makes them a constant target for automated attacks such as brute-force, dictionary, and credential-stuffing attempts. Many applications still rely on fixed-threshold rules that lock an account or IP address after a set number of failed logins. As the literature survey shows, such rules are easy to bypass: attackers can slow down their attempts, spread requests across multiple IP addresses, or try many usernames to stay below the limit, while legitimate users who mistype their passwords may be wrongly restricted.

    Data-driven classifiers are capable of inferring behavioural patterns such as request frequency, time intervals between attempts, and the number of usernames tried from one IP address, but a model working alone depends heavily on its training data. Detection tools that operate separately also leave administrators without a single place to view and respond to security events. The main motivating factors for this project are:

    • Fixed-threshold rules can be evaded through slow or distributed attacks and may wrongly block genuine users.

    • Machine learning models depend on training data and Data-driven classifiers are capable of inferring with rule-based detection rather than used alone.

    • Separate security tools make it difficult for administrators to monitor and respond to events from one place.

  4. METHODOLOGY

    BruteStop collects login details such as timestamps, source IP addresses, usernames, and login success or failure. It extracts five important features: total login attempts within a time window, unique usernames used, average time between attempts, minimum time between attempts, and requests per minute. Such indicators facilitate the detection of login patterns and distinguish normal users from automated attacks. The System uses a rule based integrated with a Random Forest machine learning model. Parameter learning is conducted over synthetic data, with 80% used for training and 20% for testing, and is o rigorously assess predictive reliability, model performance is measured via precision, recall, and classification accuracy. F1-score, and a confusion matrix.

    When an attack is detected, the BruteStop stores the attackers IP address and login attempts by that IP user. The system protects loopback addresses, prevents duplicate blocking entries, and allows administrators to unblock IP addresses through the dashboard. The dashboard refreshes every three seconds and displays login attempts, successful and failed logins, blocked IP addresses, attack trends, frequent attack sources, and security alerts. Administrators can search and filter login records, view unread alerts, and export login data as CSV files.

  5. SYSTEMARCHITECTURE

    The System begins when a user logins through any login poral.

    Every login attempt is recorded and stored SQLite Database and used for analysing and detecting using a Random Forest classifier engineered to detect anomalous authentication patterns login patterns. If malicious activity system automatically blocks the source IP address and generates a security alert. Otherwise, the

    system continues monitoring login activity. The Scapy-based network monitoring module also identifies abnormal TCP connection patterns to detect poential connection-flooding attacks.

    Coupled with login attack detection, BruteStop includes SQL Injection and Cross-Site Scripting (XSS) scanners to identify potential web application vulnerabilities. All login records, security alerts, blocked IP addresses, and vulnerability scan results are stored in the SQLite database. The Flask dashboard presents this information through charts, logs, alerts, and IP address management features. This integrated approach enables administrators to monitor security events, investigate suspicious activities, and manage threats efficiently.

  6. IMPLEMENTATION

  1. User Login Request and Flask Login Portal: The system accepts login requests through a web interface developed using Flask. Users enter their usernames and passwords, which are processed by the login portal to verify authentication details. The portal records login activity for analysis.

  2. Login Attempt Logging: Every login attempt is recorded and stored in the SQLite database with details such as timestamp, source IP address, username, and login status. These records help identify suspicious login behaviour.

  3. Detection Engine: The detection engine analyses the collected login records and extracts features including the total count of attempts within a time window, unique usernames, average interval between attempts, minimum interval, and requests per minute. These features are used to identify potentially malicious activity.

  4. Random Forest Model: A Random Forest classifier analyses the

    derived input attributes to distinguish normal login behaviour from suspicious patterns. Algorithmic optimization is executed over synthetic dataset containing examples of legitimate login activity and automated attacks. Its predictions are used alongside rule-based detection to identify potential brute-force attacks.

  5. Suspicious Activity Detection: The system checks whether login activity meets predefined security rules or is classified as suspicious by the Random Forest model. For example, five failed login attempts within 90 seconds can trigger the rule-based detection mechanism. If suspicious activity is detected, the system initiates the blocking process; otherwise, monitoring continues.

  6. Automated IP Blocking: When an attack is detected, the source IP address is added to the blocked IP table. Linux iptables can be used to drop traffic from blocked addresses. Administrators can also remove blocking rules through the dashboard.

  7. Scapy Network Monitor: The optional Scapy module monitors TCP connections to the login portal. It identifies unusually frequent connection attempts, such as 15 connections within 10 seconds from a single IP address, and can trigger IP blocking. This module requires appropriate network permissions and is primarily intended for Linux environments.

  8. Security Alert Generation: Whenever suspicious activity is detected or an IP address is blocked, the system generates a security alert. The alert includes relevant details, including the originating IP address, detection reason, and timestamp, allowing administrators to investigate potential attacks.

  9. SQL Injection Scanner: The scanner checks web application inputs for potential SQL injection vulnerabilities by testing whether specially crafted inputs can affect database queries. The results are recorded for review so that insecure input handling and database query construction can be corrected.

  10. Cross-Site Scripting (XSS) Scanner: The XSS scanner tests input fields and relevant application endpoints for possible injection of malicious scripts. It examines application responses for signs that user-supplied input is reflected unsafely, helping identify areas where input validation and output encoding need improvement.

  11. SQLite Database: SQLite provides persistent storage for login records, blocked IP addresses, security alerts, and vulnerability scan results. The database connects the detection modules with the dashboard and maintains information required for monitoring and investigation.

  12. Flask Dashboard: The dashboard provides administrators with a central interface to monitor the security status of the application. It displays login statistics, attack trends, blocked IP addresses, alerts, and vulnerability scan results. Administrators can filter login records, review alerts, export data as CSV files, and manage IP blocking through the interface.

VII CONCLUSION AND FUTURE ENHANCEMENTS

The BruteStop web application designed to detect and prevent brute-force login attacks through monitoring and IP blocking. Th System records login activities, analyses suspicious patterns using rule-based detection and a Random Forest model, and automatically blocks potentially malicious IP addresses. The integration of Scapy-based network monitoring, SQL injection scanning, and Cross-Site Scripting (XSS) scanning extends its security capabilities beyond login protection.

The Dashbord provides a centralized interface for viewing and monitoring login records, security alerts, blocked IP addresses, and vulnerability scan results. By combining attack detection, automated response, and security, BruteStop helps administrators identify potential threats and manage web application security more effectively.

The system can be augmented through training the detection model with more expansive and heterogeneous data repositories to improve detection accuracy and reduce false positives and false negatives. Adaptive risk scoring can be introduced to assess suspicious activities based on login frequency, failed attempts, and unusual request patterns.

Incident reporting can be improved through detailed security reports and real-time notifications, while automated remediation recommendations can guide administrators in strengthening password policies, applying rate limits, and correcting application vulnerabilities. Integration with centralized security monitoring tools and support for larger deployments could further improve scalability and reliability. These enhancements would help BruteStop provide more comprehensive protection against evolving web application security threats.

VIII REFERENCES

  1. S. Ahmadi, “Adaptive Cybersecurity: Dynamically Retrainable Firewalls for Real-Time Network Protection,” Preprints, 2025.

  2. A. John, I. F. B. Isnin, S. H. H. Madni, and F. B. Muchtar, “Enhanced Intrusion Detection Model Based on Principal Component Analysis and Variable Ensemble Machine Learning Algorithm,” in Intelligent Systems with Applications, vol. 24, p. 200442, 2024.

  3. F. Alshuaibi, F. Alshamsi, A. Saeed, and S. Kaddoura, “Machine Learning- Based Classification Approach for Network Intrusion Detection System,” in 2024 15th Annual Undergraduate Research Conference on Applied Computing (URC), Abu Dhabi, UAE, 2024, pp. 1-6. (Online). Available: doi.org.

  4. P. Pandit, et al., “Ensemble Machine Learning for Intrusion Detection: Decision Tree, Random Forest, Extra Tree and XGBoost on CICIDS2017,” Journal of Computational and Cognitive Engineering, vol. 2, no. 2, pp. 8897, 2023.

  5. A. E. Onyebueke, A. A. David, and S. Munu, “Network Intrusion Detection System Using XGBoost and Random Forest Algorithms,” Asian Journal of Pure and Applied Mathematics, vol. 5, no. 1, pp. 321-335, 2023.

  6. Hidayat et al., Machine Learning-Based IDS: An Experimental Comparison, Journal of Computing and Cyber Engineering (JCCE), 2023.

  7. M. Rodríguez, Á. Alesanco, L. Mehavilla, and J. García, “Evaluation of Machine Learning Techniques for Traffic Flow-Based Intrusion Detection,” Sensors, vol. 22, no. 23, p. 9326, Nov. 2022.

  8. N. Kim, et al., “Python-Based Network Intrusion Detection System Using Scapy and IPTables for Automated Threat Response,” IEEE Access, vol. 10, pp. 112, 2022.

  9. O. Ibitoye, &uot;Self-Healing AI-Driven Network Security: An Autonomous Detection, Containment and Recovery Framework,” IEEE Transactions on Network and Service Management, vol. 18, no. 3, pp. 28912905, 2021.

  10. S. Rohith Raj, G. Shobha, R. Rohith, and M. Moharir, “SCAPY- A powerful interactive packet manipulation program,” in 2018 IEEE, Bangalore, India, 2018, pp. 1-5. (Online). Available: rohithrajs.cs16@rvce.edu.in