Skip to content

MrGreyHat07/SHASTRA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

# 🛡️ Shastra

**Shastra** is a powerful and flexible SQL Injection (SQLi) scanner and static analyzer built using [Playwright](https://playwright.dev/), with support for dynamic form fuzzing, header injection, parameter tampering, and optional static code analysis via Bandit.  
Screenshot 2025-07-31 220053
## ⚙️ Features

- 🔎 Dynamic SQL Injection detection using full browser emulation (Playwright)
- 🧪 Automatic fuzzing of:
  - Query parameters
  - Form inputs
  - HTTP headers
  - URL path
- 🐛 Optional static analysis using Bandit
- 🧰 Customizable payloads and error signature detection
- 🖥️ Debug mode to dump raw HTTP requests/responses
- 📦 JSON output for easy reporting or integration
- 🎨 Colorful terminal output with [Rich](https://github.com/Textualize/rich)

---

## 🛠 Installation

### 1. Clone the Repository
```bash
git clone https://github.com/MrGreyHat07/SHASTRA.git
cd shastra

2. Install Python Requirements

pip install -r requirements.txt

3. Install Playwright Browsers

playwright install

🚀 Usage

Scan a single URL

python shastra.py -u https://example.com/page.php?id=1

Scan multiple URLs from a file

python shastra.py -l urls.txt

Output results to JSON

python shastra.py -u https://example.com -o results.json

Fuzz additional headers

python shastra.py -u https://target.com -H Referer -H X-Forwarded-For

Increase concurrency and reduce delay

python shastra.py -l urls.txt --threads 5 --delay 0.5

Show raw HTTP requests and responses (debug mode)

python shastra.py -u https://example.com --debug

🧪 Sample Output

{
  "dynamic": [
    {
      "https://example.com/page.php?id=1": [
        [
          "https://example.com/page.php?id='",
          "param id",
          "'",
          ["error signature"]
        ]
      ]
    }
  ],
  "static": [
    {
      "filename": "somefile.py",
      "line_number": 23,
      "issue_text": "Possible SQL injection via string-based query construction",
      ...
    }
  ]
}

⚡ Advanced

Customize Payloads

Edit the SQL_PAYLOADS list in shastra.py:

SQL_PAYLOADS = ["'", "''", "--", "-- OR 1=1", "--1=1"]

Customize Error Matchers

Edit the ERROR_SIGNS list:

ERROR_SIGNS = ["sql syntax", "mysql", "ora-", "syntax error", "unclosed quotation"]

🔒 Disclaimer

Shastra is intended for ethical and legal use only. Do not use it on websites or systems you do not own or have explicit permission to test. Unauthorized usage may be illegal.


🧑‍💻 Author

Shastra is developed by mrgreyhat07 Contributions, ideas, and pull requests are welcome!


About

Shastra is a powerful and flexible SQL Injection (SQLi) scanner and static analyzer built using Playwright, with support for dynamic form fuzzing, header injection, parameter tampering, and optional static code analysis via Bandit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages