Skip to content

Instantly share code, notes, and snippets.

@AzharGhafoor
Created September 3, 2023 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AzharGhafoor/cc149986fd8588e4c6ed31e9866d29a3 to your computer and use it in GitHub Desktop.
Save AzharGhafoor/cc149986fd8588e4c6ed31e9866d29a3 to your computer and use it in GitHub Desktop.
Web Classifier Model

webAttackDetector

A ML model to detect the payload type from the four used attacks such as XSS, SQLI, LFI and Command Injection. Model will also be looking if payload is valid payload or not

Features

  • It can detect four attacks very effeciently such as XSS, LFI, SQLI and Command Injection
  • It also verifies either entered input by the user is a valid payload or a simple string such as abc or 123 etc
  • It can also be used as a WAF because it will trigger and alert if any of the web attacks is detected from the payload

Code Use

Installing the requirements

pip install -r requirements.txt

Run the code

python use_model_file.py

Working Examples

Enter payload: hello world                   
Input Response
hello world Dear user! please enter some valid payload..
123 Dear user! please enter some valid payload..
admin") or "1"="1"/* sqli
javascript:alert(1) xss
/etc/passwd lfi
&ls; command injection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment