This application provides routes for analyzing Lua code for vulnerabilities. The application includes a web interface with two primary functionalities:
- Analyzing a single block of Lua code.
- Analyzing multiple blocks of Lua code (code cells).
POST /analyze
Analyzes a single block of Lua code for vulnerabilities.
The request should include a form field named code
containing the Lua code to be analyzed.
curl -X POST http://localhost:5000/analyze -F "code=YOUR_LUA_CODE_HERE"
The response will be a JSON object containing a list of identified vulnerabilities.
[
{
"name": "VulnerabilityName",
"description": "Description of the vulnerability",
"severity": "Severity level",
"line": 10
}
]
POST /analyzecells
Analyzes multiple blocks of Lua code (code cells) for vulnerabilities.
The request should include a JSON object with an array of code cells under the key code_cells
.
{
"code_cells": [
"YOUR_LUA_CODE_CELL_1",
"YOUR_LUA_CODE_CELL_2"
]
}
curl -X POST http://localhost:5000/analyzecells -H "Content-Type: application/json" -d '{
"code_cells": [
"YOUR_LUA_CODE_CELL_1",
"YOUR_LUA_CODE_CELL_2"
]
}'
The response will be a JSON object containing the original code cells and their identified vulnerabilities.
[
{
"code_cell": "YOUR_LUA_CODE_CELL_1",
"vulnerabilities": [
{
"name": "VulnerabilityName",
"description": "Description of the vulnerability",
"severity": "Severity level",
"line": 10
}
]
},
{
"code_cell": "YOUR_LUA_CODE_CELL_2",
"vulnerabilities": []
}
]
GET /
Serves the home page where users can input Lua code and analyze it for vulnerabilities.
GET /cells
Serves the page where users can input multiple blocks of Lua code (code cells) and analyze them for vulnerabilities.
To run the application, ensure you have Flask installed and execute the following command in your terminal:
python app.py
The application will be accessible at http://0.0.0.0:5000
.
- Ensure you have the necessary analysis functions (
analyze_overflow_and_return
,analyze_underflow_and_return
, etc.) properly defined and imported in your application. - The application assumes that static assets like the logo image are located in the
static/images/
directory.
This project is licensed under the MIT License.
For any inquiries or support, please contact [[email protected]].