https://github.com/ankush-003/nosqli-detector
DistilBERT-based NoSQL Injection Payload Detection Model
https://github.com/ankush-003/nosqli-detector
distilbert gradio-interface huggingface-transformers nosql-injection
Last synced: 7 months ago
JSON representation
DistilBERT-based NoSQL Injection Payload Detection Model
- Host: GitHub
- URL: https://github.com/ankush-003/nosqli-detector
- Owner: ankush-003
- Created: 2023-07-12T18:32:57.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-26T15:06:51.000Z (about 2 years ago)
- Last Synced: 2024-04-15T04:07:02.895Z (over 1 year ago)
- Topics: distilbert, gradio-interface, huggingface-transformers, nosql-injection
- Language: Jupyter Notebook
- Homepage: https://ankush-003-ankush-003-nosqli-identifier.hf.space/
- Size: 271 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NoSQLi-Detector
DistilBERT-based NoSQL Injection Payload Detection Model
- This repo contains a fine-tuned DistilBERT model that can be used to detect NoSQL injection payloads. The model was trained on a dataset of known NoSQL injection payloads, and it can be used to classify new payloads as either malicious or benign.- The model is implemented in Python, and it can be used with any NoSQL database. The repo also includes a Jupyter notebook that demonstrates how to use the model.
## Model on 🤗
- [Visit 🤗](https://huggingface.co/ankush-003/nosqli_identifier)
## Gradio App on 🤗Spaces
- [🤗Spaces](https://huggingface.co/spaces/ankush-003/ankush-003-nosqli_identifier)
- [Gradio App](https://ankush-003-ankush-003-nosqli-identifier.hf.space/)## API Documentation
Use the gradio_client Python library or the @gradio/client Javascript package to query the demo via API.
### python
```bash
pip install gradio_client
```
Named Endpoints:
api_name: ```/predict```
```python
from gradio_client import Clientclient = Client("https://ankush-003-ankush-003-nosqli-identifier.hf.space/")
result = client.predict(
"Howdy!", # str in 'Enter Username' Textbox component
"Howdy!", # str in 'Enter Password' Textbox component
"Malitious", # str (Option from: ['Malitious', 'Benign']) in 'Expected' Dropdown component
"Howdy!", # str in 'Enter Payload' Textbox component
api_name="/predict"
)
print(result)
```### Js
```bash
npm i -D @gradio/client
```
Named Endpoints:
api_name: ```/predict```
```js
import { client } from "@gradio/client";const app = await client("https://ankush-003-ankush-003-nosqli-identifier.hf.space/");
const result = await app.predict("/predict", [
"Howdy!", // string in 'Enter Username' Textbox component
"Howdy!", // string in 'Enter Password' Textbox component
"Malitious", // string (Option from: ['Malitious', 'Benign']) in 'Expected' Dropdown component
"Howdy!", // string in 'Enter Payload' Textbox component
]);console.log(result.data);
```## References
- [Text Classification 🤗Docs](https://huggingface.co/docs/transformers/tasks/sequence_classification)