Intelligent Platform for Automating Vulnerability Detection in Web Applications
Abstract
:1. Introduction
2. Related Work
3. Design and Development
- https://github.com/DiogoMoreira4/siaas-zap.git (accessed on 22 December 2024)
- https://github.com/DiogoMoreira4/siaas-server.git (accessed on 22 December 2024)
- https://github.com/DiogoMoreira4/siaas-cli.git (accessed on 22 December 2024)
3.1. Technologies Used
- Python: Selected for its simplicity and vast library support, especially for integrating with ZAP via its API. Python 3.8.10 was used for development.
- ZAP: The core scanning tool used to detect vulnerabilities in Web applications. ZAP 2.15.0 was integrated into the system using its REST API.
- Linux: The system was deployed on Ubuntu 20.04 LTS to ensure stability, security, and cost-effectiveness, as Ubuntu is a free and open-source operating system, unlike Windows, which requires paid licenses. While optimized for Ubuntu, the system can also run on other Debian-based distributions, offering flexibility in deployment.
- MongoDB: A NoSQL database used to store the results of vulnerability scans. MongoDB was chosen for its compatibility with JSON documents, which align well with the data generated by ZAP scans.
3.2. System Architecture
- SIAAS-server: The central server module manages communication between the system components and the user. It is responsible for processing user requests, managing configuration files, and storing the results of vulnerability scans.
- SIAAS-CLI: A command-line interface that allows users to interact with the system without needing to access a graphical user interface. It simplifies the process of setting up scans and retrieving results.
- SIAAS-ZAP: This module handles the integration with ZAP, automating the scanning of Web applications for vulnerabilities. It ensures that multiple targets can be analyzed concurrently by creating separate instances of ZAP for each target.
3.3. Functionality and Automation
3.3.1. Automation Framework
- Environment: Specifies the application on which the jobs (scans) operate;
- Authentication: Crucial for analyzing applications requiring login, allowing for the use of all authentication mechanisms supported by ZAP;
- Jobs: Represent the different ZAP functionalities, such as spider, spiderAjax, and activeScan.
3.3.2. ZAP Python API
- Executing the automation plan: “GET /JSON/automation/action/runPlan/” is used to trigger the predefined automation plan, enabling the system to start a comprehensive vulnerability analysis automatically.
- Monitoring analysis progress: To track the progress of the ongoing scans, the “GET /JSON/automation/view/planProgress/” and “GET /JSON/ascan/ view/scanProgress/” endpoints are employed. These endpoints provide real-time updates on the execution of the automation plan and the active scanning phase, respectively.
- Building the results: Once the scan is completed, the “GET /JSON/core/ view/urls/” and “GET /JSON/core/view alerts/” endpoints are used to retrieve discovered URLs and detected vulnerabilities. These data form the basis of the comprehensive and user-friendly reports generated by the system.
3.3.3. Workflow and Key Functionalities
- Target File Reading: When the zap_manager service is started, it first reads the targets.ini file. This file contains the necessary details to scan the Web applications or sites the user wishes to analyze as shown in Figure 2. The user must edit the targets.ini file before starting the service. The function creates a list of target objects, each with a boolean attribute has_auth. If the user provides credentials for authentication, the has_auth value is set to true; otherwise, it remains false.For example, in the targets.ini file, if the “SecurityTweets” target does not require authentication, the has_auth attribute is set to false. Conversely, for the “Acuart” target, which includes login credentials, has_auth is true, and the corresponding automation plan includes authentication.
- Automation Plan Modification: Once the targets are read, the system modifies the necessary fields in the corresponding automation plan. For targets without authentication (e.g., “SecurityTweets”), the system uses a basic automation plan, while targets with authentication use a plan adapted to the provided login credentials. These plans are YAML files, as illustrated in Figure 3, that control ZAP’s behavior, such as the maximum time allowed for each Spider and ActiveScan job. These configurations are stored server-side and can be modified by the user via command-line instructions. These automation plans are divided into two parts: the env part, corresponding to the environment and context in which we want to analyze the application, and the jobs part, which identifies which functionalities and analyses we want to carry out during the execution of the automation plan. In the following, we explain in more detail the three main jobs used, spider, ajax spider, and active scan.
- Authentication: Authentication is a key feature of the system, as it allows for a more thorough and accurate vulnerability analysis. ZAP supports various authentication methods:
- —
- Manual Authentication: The user logs in manually via a browser while using ZAP as a proxy (not used in this project);
- —
- Form-based Authentication: Handles login forms where credentials are submitted (username and password);
- —
- JSON-based Authentication: Similar to form-based but submits credentials as a JSON object;
- —
- HTTP/NTLM Authentication: Used for environments requiring authentication through HTTP headers (common in corporate settings);
- —
- Script-based Authentication: For more complex scenarios, allowing users to define custom scripts to manage the login process.
Additionally, browser-based authentication was implemented through the automation framework. The browser-based authentication in ZAP leverages Selenium, a browser automation tool, to handle login processes that require interaction with a graphical user interface. Through this method, ZAP launches a browser instance (either visible or headless) to simulate user actions such as filling in login credentials, clicking buttons, and interacting with dynamic elements like JavaScript-based forms or CAPTCHA solutions. Once the authentication is successful, ZAP captures session cookies or tokens from the browser, enabling automated authenticated scans of protected resources. This approach is particularly effective for complex login flows, such as Single Sign-On (SSO) or applications with heavy JavaScript frontends, although it has limitations, such as the inability to manage logins triggered exclusively by the “Enter” key or scenarios involving non-graphical APIs. By using this type of authentication, the system handles authentication intelligently, making it possible to automate this process. - Spider: The Spider process involves discovering URLs by sending HTTP requests through a pool of threads managed by the SpiderController. Responses are analyzed by parsers to extract new URLs and resources, which are added to the thread pool for further crawling. The process continues until all URLs are visited or manually stopped, ensuring thorough coverage of the site.
- Ajax Spider: The Ajax Spider operates similarly to the traditional spider but uses a WebDriver (such as Selenium) to automate a browser, allowing ZAP to interact with dynamic elements and run JavaScript within the target application. This enables ZAP to discover and analyze URLs that require AJAX requests and other dynamic interactions.
- Active Scan: The active scan component performs active attacks on the Web application to detect vulnerabilities. It sends various HTTP/HTTPS requests, including malicious payloads, to test for weaknesses such as SQL injection and Cross-Site Scripting (XSS). The scan policy defines the strength of the attacks and the alert thresholds for vulnerabilities. For example, during an attack on the “JuiceShop” application, the system sends a POST request with an injection payload in the email parameter. If the server responds with an SQL error, ZAP generates a high-confidence alert indicating a successful SQL injection attack.
- Results: Once the analysis is complete, the SIAAS-ZAP module generates two types of reports: a detailed ZAP report and a JSON file with four main components (target, URLs, alerts, and plan). The target component identifies the application being analyzed, while the URL component lists all discovered URLs from the Spider and Ajax Spider processes. The alerts component contains all the vulnerability alerts triggered during both passive and active scans. The plan component summarizes the automation process, showing whether the scan was executed as expected and providing details about the duration and execution of each job. These results are accessible through the API and command-line interface, allowing users to view scan progress and outcomes.
4. Tests and Discussion of Results
- Applications with Known Vulnerabilities: These targets were selected to evaluate vulnerability scanning tools, each with prior authorization for testing. Most applications were Web-hosted, with DVWA running locally in a separate VM. The applications tested included:
- —
- Acuart (http://testphp.vulnweb.com) (accessed on 22 December 2024);
- —
- Acuforum (http://testasp.vulnweb.com) (accessed on 22 December 2024);
- —
- Altoro Mutual (http://demo.testfire.net/index.jsp) (accessed on 22 December 2024);
- —
- bWAPP (https://demo.weblock.ru) (accessed on 22 December 2024);
- —
- DVWA (http://10.0.2.4/DVWA) (accessed on 22 December 2024);
- —
- JuiceShop (https://juice-shop.herokuapp.com) (accessed on 22 December 2024);
- —
- Rest API (http://rest.vulnweb.com) (accessed on 22 December 2024);
- —
- SecurityTweets (http://testhtml5.vulnweb.com) (accessed on 22 December 2024).
- CMS Applications: The system was further tested on real content management systems running locally in containers, ensuring compliance with ethical standards by avoiding live user interaction. This setup enabled the system to perform vulnerability detection and validation under realistic conditions.
- —
- WordPress (http://localhost:8070) (accessed on 22 December 2024);
- —
- Drupal (http://localhost:8071) (accessed on 22 December 2024);
- —
- Joomla (http://localhost:8072) (accessed on 22 December 2024).
- Real Site: The system was also tested on a real site in a quality environment, which included authentication. The analyzed site was ISCTE’s Fenix, at the following URL: https://fenix-qua.iscte-iul.pt) (accessed on 22 December 2024).
4.1. Deliberately Vulnerable Applications
4.2. Content Management Systems (CMSs)
4.3. Fenix ISCTE Site
4.4. Comparison of Analysis Duration
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Althunayyan, M.; Saxena, N.; Li, S.; Gope, P. Evaluation of Black-Box Web Application Security Scanners in Detecting Injection Vulnerabilities. Electronics 2022, 11, 2049. [Google Scholar] [CrossRef]
- Djeki, E.; Degila, J.; Bondiombouy, C.; Alhassan, M.H. Security Issues in Digital Learning Spaces. In Proceedings of the 2021 IEEE International Conference on Computing, ICOCO 2021, Kuala Lumpur, Malaysia, 17–19 November 2021; pp. 71–77. [Google Scholar] [CrossRef]
- Shahid, J.; Hameed, M.K.; Javed, I.T.; Qureshi, K.N.; Ali, M.; Crespi, N. A Comparative Study of Web Application Security Parameters: Current Trends and Future Directions. Appl. Sci. 2022, 12, 4077. [Google Scholar] [CrossRef]
- Petrosyan, A. Distribution of Cyber Incidents in Organizations Worldwide as of September 2023, by Type. Statista. 2024. Available online: https://www.statista.com/statistics/1483769/global-cyber-incidents-by-type/ (accessed on 22 December 2024).
- Muralidharan, M.; Babu, K.B.; Sujatha, G. W3BnNr: An Automated tool for information gathering, vulnerability scanning, attacking and reporting for injection attacks on web application. In Proceedings of the ACCTHPA 2023—Conference on Advanced Computing and Communication Technologies for High Performance Applications, Ernakulam, India, 20–21 January 2023. [Google Scholar] [CrossRef]
- Lavens, E.; Philippaerts, P.; Joosen, W. A Quantitative Assessment of the Detection Performance of Web Vulnerability Scanners. In Proceedings of the ACM International Conference Proceeding Series, Association for Computing Machinery, Vienna, Austria, 23–26 August 2022. [Google Scholar] [CrossRef]
- OWASP. OWASP Top 10. OWASP Foundation. 2021. Available online: https://owasp.org/www-project-top-ten/ (accessed on 22 December 2024).
- Sonmez, F.O.; Kilic, B.G. Holistic Web Application Security Visualization for Multi-Project and Multi-Phase Dynamic Application Security Test Results. IEEE Access 2021, 9, 25858–25884. [Google Scholar] [CrossRef]
- Seara, J.P.; Serrao, C. Automation of System Security Vulnerabilities Detection Using Open-Source Software. Electronics 2024, 13, 873. [Google Scholar] [CrossRef]
- Seara, J.P.; Serrao, C. Intelligent System for Automation of Security Audits (SIAAS). EAI Endorsed Trans. Scalable Inf. Syst. 2023, 11, 1. [Google Scholar] [CrossRef]
- Truong, D.; Tran, D.; Nguyen, L.; Mac, H.; Tran, H.A.; Bui, T. Detecting web attacks using stacked denoising autoencoder and ensemble learning methods. In Proceedings of the ACM International Conference Proceeding Series, Association for Computing Machinery, Hanoi Ha Long Bay, Vietnam, 4–6 December 2019; pp. 267–272. [Google Scholar] [CrossRef]
- Petrosyan, A. Global Industry Sectors Most Targeted by Basic Web Application Attacks from November 2022 to October 2023 Statista 2024. Available online: https://www.statista.com/statistics/221293/cyber-crime-target-industries/ (accessed on 22 December 2024).
- Nirmal, K.; Janet, B.; Kumar, R. It’s more than stealing cookies—Exploitability of XSS. In Proceedings of the 2018 International Conference on Intelligent Computing and Control Systems (ICICCS), Madurai, India, 14–15 June 2018. [Google Scholar]
- Li, X.; Xue, Y. A Survey on Web Application Security. Nashville, TN USA 2011, 25, 1–14. Available online: https://www.isis.vanderbilt.edu/sites/isis.vanderbilt.edu/files/bibcite_files/main_0_0.pdf (accessed on 22 December 2024).
- Nocera, S.; Romano, S.; Francese, R.; Scanniello, G. Training for Security: Results from Using a Static Analysis Tool in the Development Pipeline of Web Apps. In Proceedings of the International Conference on Software Engineering, Lisbon, Portugal, 14–20 April 2024; pp. 253–263. [Google Scholar] [CrossRef]
- Goe, D. Detection of Web Appication Vulnerability Based on RUP Model. In Proceedings of the 2015 National Conference on Recent Advances in Electronics & Computer Engineering (RAECE), Roorkee, India, 13–15 February 2015. [Google Scholar]
- MITRE. CWE Top 25 Most Dangerous Software Weaknesses. Mitre. 2023. Available online: https://cwe.mitre.org/top25/ (accessed on 22 December 2024).
- Verma, A.; Khatana, A.; Chaudhary, S. A Comparative Study of Black Box Testing and White Box Testing. Artic. Int. J. Comput. Sci. Eng. 2017, 5, 301–304. [Google Scholar] [CrossRef]
- Hassan, M.M.; Mustain, U.; Khatun, S.; Karim, M.S.A.; Nishat, N.; Rahman, M. Quantitative Assessment of Remote Code Execution Vulnerability in Web Apps. In Proceedings of the Lecture Notes in Electrical Engineering; Springer: Berlin/Heidelberg, Germany, 2020; Volume 632, pp. 633–642. [Google Scholar] [CrossRef]
- Singh, N.; Meherhomji, V.; Chandavarkar, B.R. Automated versus Manual Approach of Web Application Penetration Testing. In Proceedings of the 2020 11th International Conference on Computing, Communication and Networking Technologies (ICCCNT), Kharagpur, India, 1–3 July 2020. [Google Scholar]
- Acheampong, R.; Balan, T.C.; Popovici, D.M.; Rekeraho, A. Security Scenarios Automation and Deployment in Virtual Environment using Ansible. In Proceedings of the 14th International Conference on Communications, COMM 2022, Bucharest, Romania, 16–18 June 2022. [Google Scholar] [CrossRef]
- Beba, S.; Karlsen, M.M.; Li, J.; Zhang, B. Critical Understanding of Security Vulnerability Detection Plugin Evaluation Reports. In Proceedings of the Asia-Pacific Software Engineering Conference, APSEC, Taipei, Taiwan, 6–9 December 2021; pp. 275–284. [Google Scholar] [CrossRef]
- Al-Kahla, W.; Shatnawi, A.S.; Taqieddin, E. A Taxonomy of Web Security Vulnerabilities. In Proceedings of the 2021 12th International Conference on Information and Communication Systems, ICICS 2021, Valencia, Spain, 24–26 May 2021; pp. 424–429. [Google Scholar] [CrossRef]
- Idrissi, S.E.; Berbiche, N.; Guerouate, F.; Sbihi, M. Performance Evaluation of Web Application Security Scanners for Prevention and Protection against Vulnerabilities. Int. J. Appl. Eng. Res. 2017, 12, 4. [Google Scholar]
- Koswara, K.J.; Asnar, Y.D.W. Improving Vulnerability Scanner Performance in Detecting AJAX Application Vulnerabilities. In Proceedings of the 2019 International Conference on Data and Software Engineering (ICoDSE): Gedung Konferensi Universitas Tanjungpura, Pontianak, Indonesia, 13–14 November 2019. [Google Scholar]
- Qasaimeh, M.; Shamlawi, A.; Khairallah, T. Black Box Evaluation of Web Application Scanners: Standards Mapping Approach. J. Theor. Appl. Inf. Technol. 2018, 31, 4584–4596. [Google Scholar]
- Jain, T.; Jain, N. Framework for Web Application Vulnerability Discovery and Mitigation by Customizing Rules through ModSecurity. In Proceedings of the 2019 6th International Conference on Signal Processing and Integrated Networks (SPIN), Noida, India, 7–8 March 2019. [Google Scholar]
- Abdulghaffar, K.; Elmrabit, N.; Yousefi, M. Enhancing Web Application Security through Automated Penetration Testing with Multiple Vulnerability Scanners. Computers 2023, 12, 235. [Google Scholar] [CrossRef]
- Albahar, M.; Alansari, D.; Jurcut, A. An Empirical Comparison of Pen-Testing Tools for Detecting Web App Vulnerabilities. Electronics 2022, 11, 2991. [Google Scholar] [CrossRef]
- Mburano, B.; Si, W. Evaluation of Web Vulnerability Scanners Based on OWASP Benchmark. In Proceedings of the ICSEng 2018: 26th International Conference on Systems Engineering, Sydney, Australia, 18–20 December 2018; University of Technology: Sydney, Australia, 2018. [Google Scholar]
- Team, Z.D. ZAP. 2023. Available online: https://www.zaproxy.org/ (accessed on 22 December 2024).
- Portugal. Lei n.º 109-2009. Diário da Républica. Série I de 2009-09-15. 2009. Available online: https://diariodarepublica.pt/dr/detalhe/lei/109-2009-489693 (accessed on 22 December 2024).
Acuart | Acuforum | Altoro | bWAPP | DVWA | JuiceShop | RestAPI | ST | |
---|---|---|---|---|---|---|---|---|
OWASP-2021-A01 | ||||||||
CORS Misconfiguration | X | X | X | |||||
Cross-Domain Misconfiguration | X | X | X | |||||
Bypassing 403 | X | X | ||||||
Absence of Anti-CSRF Tokens | X | X | X | X | X | X | ||
Path Traversal | X | X | ||||||
Directory Browsing | X | |||||||
Session ID in URL Rewrite | X | |||||||
OWASP-2021-A03 | ||||||||
Cross-Site Scripting | X | X | X | X | ||||
Advanced SQL Injection | X | X | X | X | ||||
SQL Injection | X | X | X | X | ||||
External Redirect | X | |||||||
Integer Overflow Error | X | |||||||
Cookie Slack Detector | X | |||||||
NoSQL Injection | X | X | ||||||
Remote File Inclusion | X | |||||||
XSLT Injection | X | |||||||
Open Redirect | X | |||||||
OWASP-2021-A04 | ||||||||
Exponential Entity Expansion | X | |||||||
Parameter Tampering | X | |||||||
OWASP-2021-A05 | ||||||||
CSP Header Not Set | X | X | X | X | X | X | X | X |
Anti-CSRF Token Check | X | X | X | X | X | X | ||
Backup File Disclosure | X | |||||||
HTTP Only Site | X | X | X | X | X | |||
Missing Anti-clickjacking Header | X | X | X | X | X | X | X | X |
Source Code Disclosure | X | X | X | X | X | |||
Sub-Resource Integrity Missing | X | X | X | X | ||||
Insecure HTTP Method | X | |||||||
Relative Path Confusion | X | X | ||||||
Web Cache Deception | X | X | X | |||||
Proxy Disclosure | X | |||||||
Application Error Disclosure | X | |||||||
OWASP-2021-A09 | ||||||||
Vulnerable JS Library | X | X | ||||||
OWASP-2021-A10 | ||||||||
Server-Side Request Forgery | X |
Wordpress | Drupal | Joomla | |
---|---|---|---|
OWASP-2021-A01 | |||
CORS Misconfiguration | X | ||
Bypassing 403 | X | X | |
OWASP-2021-A03 | |||
SQL Injection | X | X | X |
Buffer Overflow | X | ||
Integer Overflow Error | X | ||
SQL Injection - SQLite | X | ||
Server-Side Template Injection | X | ||
Advanced SQL Injection | X | ||
OWASP-2021-A05 | |||
Content Security Policy (CSP) Header Not Set | X | X | X |
Source Code Disclosure - SQL | X | ||
Missing Anti-clickjacking Header | X | ||
Backup File Disclosure | X |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Moreira, D.; Seara, J.P.; Pavia, J.P.; Serrão, C. Intelligent Platform for Automating Vulnerability Detection in Web Applications. Electronics 2025, 14, 79. https://doi.org/10.3390/electronics14010079
Moreira D, Seara JP, Pavia JP, Serrão C. Intelligent Platform for Automating Vulnerability Detection in Web Applications. Electronics. 2025; 14(1):79. https://doi.org/10.3390/electronics14010079
Chicago/Turabian StyleMoreira, Diogo, João Pedro Seara, João Pedro Pavia, and Carlos Serrão. 2025. "Intelligent Platform for Automating Vulnerability Detection in Web Applications" Electronics 14, no. 1: 79. https://doi.org/10.3390/electronics14010079
APA StyleMoreira, D., Seara, J. P., Pavia, J. P., & Serrão, C. (2025). Intelligent Platform for Automating Vulnerability Detection in Web Applications. Electronics, 14(1), 79. https://doi.org/10.3390/electronics14010079