An ethical framework for self-hosted LLM service security risk Exploration and Exploitation
This framework provides a systematic approach to:
- Discover LLM services and endpoints across the internet
- Probe API endpoints for potential vulnerabilities
- Assess security risks
- Exploit identified vulnerabilities based on interpretable attack graphs
- Report findings with detailed analysis and visualizations
The framework is organized into 5 main phases:
📁 _01_discovery/ # Asset Discovery
📁 _02_probing/ # Endpoint Probing
📁 _03_assessment/ # Vulnerability Assessment
📁 _04_exploitation/ # Exploit
📁 _05_reporting/ # Results Analysis & Reporting
📁 _02_probing/API Endpoint/- API endpoint intelligence database📁 _03_assessment/AttackPatternIntelligence/- CAPEC Attack pattern knowledge database📁 _03_assessment/CVE_Related/- CVE vulnerability database
- Python 3.8+
- Windows/Linux/macOS
git clone <repository-url>
cd LENSpip install -r requirements.txtEdit the configuration files in the core/ directory:
core/config.py- Main configuration settings. Set the api key for the FOFA engine.
🔑 One-click execution of the complete framework:
# Windows
_00_run_pipeline.bat
# Linux/macOS
python _00_run_complete_pipeline.py🤖 This will execute all phases sequentially and generate comprehensive reports.
🔍 Experience the discovery phase to understand asset identification:
python _01_run_phase1_discovery.pyThis phase includes:
- FOFA search for LLM services
- Aliveness verification
- Asset deduplication
🎯 Run specific components for targeted analysis, for example:
# Probing modules
python _02_probing/_02public_api_endpoint_probe.pyThis framework is designed for:
- Security Research - Academic and professional security analysis
- Authorized Testing - Penetration testing with proper authorization
- Defensive Purposes - Improving organizational security posture
If you find this work useful, please cite our paper:
@inproceedings{liu2026lens,
author = {Liu, Zhihuang and Hu, Ling and Tang, Yonghao and Zhou, Tongqing and Liu, Fang and Cai, Zhiping},
title = {Exploring and Exploiting Security Vulnerabilities in Self-Hosted LLM Services},
booktitle = {Proceedings of The Web Conference 2026 (WWW'26)},
year = {2026},
}