Metadata-Version: 2.4
Name: AIScanner
Version: 0.1.0
Summary: AI-powered web vulnerability scanner based on OWASP Top 10
Author-email: prodip1023 <prodip1023@gmail.com>
License: Apache License
        Version 2.0, January 2004
        TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
        1. Definitions.
        "License" shall mean the terms and conditions for using this License.
        "Copyright" shall mean the notices that indicate copyright ownership.
        "Work" shall mean the original work that is licensed under this License.
        "Derivative Works" shall mean any work based on or derived from the Work.
        "Distribution" shall mean the act of distributing or making available the Work or Derivative Works.
        "Source Code" shall mean the प्रकट code of the Work.
        "Object Code" shall mean the machine code of the compiled Work.
        "Workstation" shall mean the computer or system on which the Work is executed.
        "Workstation" means the computer or system on which the Work is executed.
        
        2. Grant of Copyright License.
        Pursuant to this License, each Contributor hereby grants to any other party the copyright license that is granted to them under this License.
        
        3. Redistribution.
        Redistribution of the Work or Derivative Works is permitted under the terms of this License, provided that all other provisions of this License are met.
        
        4. Redistribution of Source Code.
        If you distribute the Work or Derivative Works, you must make the following modifications to the Work or Derivative Works:
        (a) You must cause any modified files to carry a prominent notice stating that you changed the files.
        (b) You must cause any other files to carry a prominent notice stating that you changed the files.
        (c) You must cause any other files to carry a prominent notice stating that you changed the files.
        (d) You must cause any other files to carry a prominent notice stating that you changed the files.
        (e) You must cause any other files to carry a prominent notice stating that you changed the files.
        (f) You must cause any other files to carry a prominent notice stating that you changed the files.
        (g) You must cause any other files to carry a prominent notice stating that you changed the files.
        (h) You must cause any other files to carry a prominent notice stating that you changed the files.
        
        5. Trademark.
        No rights are granted under this License for the use of trademarks or trade names, except as expressly granted by law.
        
        6. Limitation of Liability.
        THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.
        
        7. Indemnification.
        Each Contributor agrees to indemnify, defend, and hold harmless the other Contributors and the Licensor from and against any and all claims, damages, losses, liabilities, costs, or expenses, including reasonable attorneys' fees, arising out of or related to their contribution to the Work or the use of the Work.
Project-URL: Homepage, https://github.com/prodip1023/AIScanner
Project-URL: Documentation, https://github.com/prodip1023/AIScanner#readme
Project-URL: Bug Tracker, https://github.com/prodip1023/AIScanner/issues
Project-URL: Source Code, https://github.com/prodip1023/AIScanner
Keywords: security,owasp,vulnerability,scanner,crawler,web
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Security
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: lxml>=5.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.9
Provides-Extra: async
Requires-Dist: aiohttp>=3.9; extra == "async"
Provides-Extra: testing
Requires-Dist: pytest>=8.0; extra == "testing"
Requires-Dist: pytest-cov>=5.0; extra == "testing"
Requires-Dist: flake8>=7.0; extra == "testing"
Requires-Dist: mypy>=1.8; extra == "testing"
Requires-Dist: tox>=4.0; extra == "testing"
Requires-Dist: types-requests; extra == "testing"
Requires-Dist: responses>=0.25; extra == "testing"
Dynamic: license-file

# AIScanner 🔍

[![PyPI version](https://badge.fury.io/py/AIScanner.svg)](https://pypi.org/project/AIScanner/)
[![Python](https://img.shields.io/pypi/pyversions/AIScanner)](https://pypi.org/project/AIScanner/)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![CI](https://github.com/prodip1023/AIScanner/actions/workflows/publish.yml/badge.svg)](https://github.com/prodip1023/AIScanner/actions)

**AIScanner** is an AI-powered web vulnerability scanner that automatically crawls URLs and flags security risks based on the **OWASP Top 10**.

---

## ✨ Features

- 🌐 **Recursive web crawler** — follows internal links up to a configurable depth
- 🧠 **Technology detection** — identifies WordPress, React, Angular, Vue, Django, Bootstrap, jQuery, Next.js, and more
- 🛡️ **OWASP Top 10 checks** — detects XSS, SQL Injection exposure, missing CSRF tokens, sensitive data exposure, and open redirects
- 🎯 **Severity classification** — each risk is tagged CRITICAL / HIGH / MEDIUM / LOW / SAFE
- 📄 **JSON output** — results are saved to `crawl_results.json`
- 💬 **Language detection** — detects the page language (English, French, Spanish, …)

---

## 📦 Installation

```bash
pip install AIScanner
```

> Requires Python 3.9 or higher.

---

## 🚀 Quick Start

### As a CLI tool

After installation, the `aiscanner` command is available globally:

```bash
aiscanner
```

You will be prompted to enter a URL:

```
🔎 Enter URL to crawl: https://example.com
```

### As a Python library

```python
from AIScanner import WebAnalyzer, WebCrawler

# Analyze a single URL
analyzer = WebAnalyzer(".")
result = analyzer.analyze("https://example.com")

print(result["language"])    # e.g. "English"
print(result["tech_stack"])  # e.g. ["Bootstrap", "jQuery"]
for risk in result["risks"]:
    print(f"[{risk['severity']}] {risk['owasp_id']}: {risk['name']}")

# Crawl an entire site (max 2 levels deep)
crawler = WebCrawler(".", analyzer, max_depth=2)
results = crawler.run("https://example.com")
# results is a dict: { url -> analysis_result }
```

---

## 🧩 Project Structure

```
src/AIScanner/
├── __init__.py           # Public API
├── exceptions.py         # Custom exceptions
├── logger.py             # Pre-configured logger
└── crawler/
    ├── __init__.py
    ├── crawl.py          # WebCrawler — recursive URL crawler
    └── web_analyzer.py   # WebAnalyzer — tech detection + OWASP checks
```

---

## 🛡️ OWASP Checks Performed

| OWASP ID | Check | Severity |
|----------|-------|----------|
| A01 | Broken Access Control — Form without CSRF protection | MEDIUM |
| A02 | Sensitive Data Exposure — password/credit card/SSN in page text | CRITICAL |
| A03 | XSS — inline `<script>` tags found | HIGH |
| A03 | SQL Injection exposure — SQL error strings in page | HIGH |
| A05 | Missing X-Frame-Options / Content-Security-Policy | LOW |
| A10 | Open Redirect — `?redirect=` or `?next=` parameters | MEDIUM |

---

## ⚙️ Configuration

| Parameter | Default | Description |
|-----------|---------|-------------|
| `max_depth` | `2` | How many link levels deep to crawl |
| `base_path` | `"."` | Directory where `crawl_results.json` is saved |

---

## 🔧 Development Setup

```bash
git clone https://github.com/prodip1023/AIScanner.git
cd AIScanner

# Install with dev dependencies
pip install -e ".[testing]"

# Run tests
pytest -v tests/

# Lint
flake8 src

# Type check
mypy src
```

---

## 📤 Publishing (maintainers)

```bash
# 1. Bump version in pyproject.toml and src/AIScanner/__init__.py
# 2. Commit and tag
git tag v0.1.0
git push origin v0.1.0
# GitHub Actions will automatically build and publish to PyPI
```

---

## 📄 License

[Apache 2.0](LICENSE) © 2024 prodip1023
