Applied Sciences (Aug 2024)

SqliGPT: Evaluating and Utilizing Large Language Models for Automated SQL Injection Black-Box Detection

  • Zhiwen Gui,
  • Enze Wang,
  • Binbin Deng,
  • Mingyuan Zhang,
  • Yitao Chen,
  • Shengfei Wei,
  • Wei Xie,
  • Baosheng Wang

DOI
https://doi.org/10.3390/app14166929
Journal volume & issue
Vol. 14, no. 16
p. 6929

Abstract

Read online

SQL injection (SQLI) black-box detection, which simulates external attack scenarios, is crucial for assessing vulnerabilities in real-world web applications. However, existing black-box detection methods rely on predefined rules to cover the most common SQLI cases, lacking diversity in vulnerability detection scheduling and payload, suffering from limited efficiency and accuracy. Large Language Models (LLMs) have shown significant advancements in several domains, so we developed SqliGPT, an LLM-powered SQLI black-box scanner that leverages the advanced contextual understanding and reasoning abilities of LLMs. Our approach introduces the Strategy Selection Module to improve detection efficiency and the Defense Bypass Module to address insufficient defense mechanisms. We evaluated SqliGPT against six state-of-the-art scanners using our SqliMicroBenchmark. Our evaluation results indicate that SqliGPT successfully detected all 45 targets, outperforming other scanners, particularly on targets with insufficient defenses. Additionally, SqliGPT demonstrated excellent efficiency in executing detection tasks, slightly underperforming Arachni and SQIRL on 27 targets but besting them on the other 18 targets. This study highlights the potential of LLMs in SQLI black-box detection and demonstrates the feasibility and effectiveness of LLMs in enhancing detection efficiency and accuracy.

Keywords