Machine Learning-Based Detection of Malicious Web Requests Using Hybrid Synthetic and Real Web Server Logs

Authors

Keywords:

web attack detection, web-server logs, machine learning, Gradient Boosting, Random Forest, Logistic Regression, CSIC 2010, intrusion detection

Abstract

Web-server logs contain a detailed trace of how users, automated tools, and attackers interact with an application. This makes them a practical source for detecting web attacks, but it also creates a familiar research problem: models trained or validated only on synthetic or benchmark traffic may appear highly accurate while failing to identify attacks in more realistic operating conditions. This paper compares three supervised machine-learning models for malicious HTTP request detection: Logistic Regression, Random Forest, and Gradient Boosting. The experiment uses two data sources: a synthetic web-attack dataset derived from the CSIC 2010 HTTP corpus and an anonymized set of commercial web-server logs containing real attack patterns. Seven features were selected from HTTP requests and server responses: source IP, URL, User-Agent, URL length, status code, GET method indicator, and POST method indicator. The models were evaluated using confusion matrices, accuracy, precision, recall, F1-score, ROC-AUC, PCA-based decision-boundary visualization, and learning curves. On the synthetic dataset, all models achieved strong results, with Random Forest and Gradient Boosting producing near-perfect ROC-AUC values. On the real-world dataset, the difference between models became more visible. Random Forest achieved high specificity but missed most positive cases, producing only 7 true positives and 136 false negatives. Logistic Regression improved recall but still left 88 attacks undetected. Gradient Boosting provided the best operational balance, with 129 true positives, 14 false negatives, 4 false positives, 98.62% accuracy, 96.99% precision, 90.21% recall, 93.48% F1-score, and 1.00 ROC-AUC. The results suggest that ensemble boosting is a strong candidate for log-based web attack detection when detection performance must remain stable across synthetic and real traffic.

Downloads

Download data is not yet available.

Author Biographies

  • Pinchuk Yan Vitalyevich, Code & Design

    I am the founder and director of Code & Design in Kazakhstan and a graduate of the Cyber Security program at Astana IT University. My work focuses on web application security, log analysis, machine learning-based threat detection, and secure digital systems.

  • Bogdanov Alexei, Dozvoleno

    Alexey is a technology entrepreneur and independent researcher working at the intersection of information freedom, online privacy, and network measurement. He is the founder and director of Do*voleno Ltd (United Kingdom), a company that develops privacy infrastructure for users in regions where connectivity is restricted, and has spent over a decade building and operating consumer digital products.

    His research draws directly on operational practice. Maintaining a distributed network of servers across European jurisdictions, serving several thousand subscribers in Eurasia, provides continuous first-hand evidence of how filtering systems behave in production: SNI-based TLS interference, protocol fingerprinting by deep packet inspection, and the recent shift in several jurisdictions from blocklist to allowlist connectivity models. He sets these observations against public measurement data from OONI, Censored Planet, and the Access Now #KeepItOn coalition.

    His current interests include the classification of encrypted traffic by metadata, the effect of mandatory age-verification regimes on the adoption of privacy tools in Europe and North America, the economics of operating censorship-resistant infrastructure, and the legal frameworks that govern privacy technology across jurisdictions. 

Downloads

Published

2026-10-23