sufa 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sufa-0.1.0/.github/workflows/ci.yml +47 -0
- sufa-0.1.0/.github/workflows/docker.yml +38 -0
- sufa-0.1.0/.github/workflows/release.yml +64 -0
- sufa-0.1.0/.gitignore +37 -0
- sufa-0.1.0/Dockerfile +23 -0
- sufa-0.1.0/LICENSE +21 -0
- sufa-0.1.0/PKG-INFO +139 -0
- sufa-0.1.0/README.md +74 -0
- sufa-0.1.0/alembic/env.py +39 -0
- sufa-0.1.0/alembic/script.py.mako +24 -0
- sufa-0.1.0/alembic.ini +36 -0
- sufa-0.1.0/docker-compose.yml +41 -0
- sufa-0.1.0/plugins/graphql_scanner/plugin.py +37 -0
- sufa-0.1.0/plugins/jwt_analyzer/plugin.py +70 -0
- sufa-0.1.0/plugins/oauth_analyzer/plugin.py +50 -0
- sufa-0.1.0/pyproject.toml +84 -0
- sufa-0.1.0/src/sufa/__init__.py +3 -0
- sufa-0.1.0/src/sufa/__main__.py +5 -0
- sufa-0.1.0/src/sufa/burp/__init__.py +3 -0
- sufa-0.1.0/src/sufa/burp/bridge.py +33 -0
- sufa-0.1.0/src/sufa/burp/extension.py +138 -0
- sufa-0.1.0/src/sufa/cli/__init__.py +0 -0
- sufa-0.1.0/src/sufa/cli/app.py +49 -0
- sufa-0.1.0/src/sufa/cli/commands/__init__.py +0 -0
- sufa-0.1.0/src/sufa/cli/commands/config_cmd.py +65 -0
- sufa-0.1.0/src/sufa/cli/commands/findings.py +115 -0
- sufa-0.1.0/src/sufa/cli/commands/import_cmd.py +145 -0
- sufa-0.1.0/src/sufa/cli/commands/project.py +66 -0
- sufa-0.1.0/src/sufa/cli/commands/provider.py +63 -0
- sufa-0.1.0/src/sufa/cli/commands/proxy.py +44 -0
- sufa-0.1.0/src/sufa/cli/commands/replay.py +79 -0
- sufa-0.1.0/src/sufa/cli/commands/report.py +70 -0
- sufa-0.1.0/src/sufa/cli/commands/scan.py +119 -0
- sufa-0.1.0/src/sufa/cli/commands/server.py +37 -0
- sufa-0.1.0/src/sufa/cli/display.py +146 -0
- sufa-0.1.0/src/sufa/core/__init__.py +0 -0
- sufa-0.1.0/src/sufa/core/ai/__init__.py +4 -0
- sufa-0.1.0/src/sufa/core/ai/base.py +55 -0
- sufa-0.1.0/src/sufa/core/ai/claude.py +98 -0
- sufa-0.1.0/src/sufa/core/ai/cost.py +66 -0
- sufa-0.1.0/src/sufa/core/ai/gemini.py +109 -0
- sufa-0.1.0/src/sufa/core/ai/ollama.py +93 -0
- sufa-0.1.0/src/sufa/core/ai/openai.py +92 -0
- sufa-0.1.0/src/sufa/core/ai/router.py +136 -0
- sufa-0.1.0/src/sufa/core/core_types.py +15 -0
- sufa-0.1.0/src/sufa/core/db/__init__.py +4 -0
- sufa-0.1.0/src/sufa/core/db/engine.py +53 -0
- sufa-0.1.0/src/sufa/core/db/models.py +136 -0
- sufa-0.1.0/src/sufa/core/db/repository.py +350 -0
- sufa-0.1.0/src/sufa/core/dedup/__init__.py +4 -0
- sufa-0.1.0/src/sufa/core/dedup/deduplicator.py +51 -0
- sufa-0.1.0/src/sufa/core/dedup/fingerprint.py +54 -0
- sufa-0.1.0/src/sufa/core/events/__init__.py +7 -0
- sufa-0.1.0/src/sufa/core/events/bus.py +82 -0
- sufa-0.1.0/src/sufa/core/events/events.py +90 -0
- sufa-0.1.0/src/sufa/core/graph/__init__.py +12 -0
- sufa-0.1.0/src/sufa/core/graph/attack_graph.py +125 -0
- sufa-0.1.0/src/sufa/core/graph/builder.py +89 -0
- sufa-0.1.0/src/sufa/core/graph/chain_analyzer.py +128 -0
- sufa-0.1.0/src/sufa/core/http/__init__.py +4 -0
- sufa-0.1.0/src/sufa/core/http/normalizer.py +109 -0
- sufa-0.1.0/src/sufa/core/http/parser.py +84 -0
- sufa-0.1.0/src/sufa/core/http/redactor.py +98 -0
- sufa-0.1.0/src/sufa/core/models/__init__.py +35 -0
- sufa-0.1.0/src/sufa/core/models/finding.py +76 -0
- sufa-0.1.0/src/sufa/core/models/project.py +18 -0
- sufa-0.1.0/src/sufa/core/models/request.py +62 -0
- sufa-0.1.0/src/sufa/core/models/scan.py +61 -0
- sufa-0.1.0/src/sufa/core/plugins/__init__.py +5 -0
- sufa-0.1.0/src/sufa/core/plugins/interface.py +53 -0
- sufa-0.1.0/src/sufa/core/plugins/loader.py +95 -0
- sufa-0.1.0/src/sufa/core/plugins/registry.py +45 -0
- sufa-0.1.0/src/sufa/core/reports/__init__.py +5 -0
- sufa-0.1.0/src/sufa/core/reports/html.py +136 -0
- sufa-0.1.0/src/sufa/core/reports/json_report.py +62 -0
- sufa-0.1.0/src/sufa/core/reports/sarif.py +93 -0
- sufa-0.1.0/src/sufa/core/reports/templates/report.html +102 -0
- sufa-0.1.0/src/sufa/core/rules/__init__.py +3 -0
- sufa-0.1.0/src/sufa/core/rules/builtin/__init__.py +0 -0
- sufa-0.1.0/src/sufa/core/rules/builtin/owasp_top10.yaml +128 -0
- sufa-0.1.0/src/sufa/core/rules/custom/__init__.py +0 -0
- sufa-0.1.0/src/sufa/core/rules/engine.py +152 -0
- sufa-0.1.0/src/sufa/core/scanner/__init__.py +4 -0
- sufa-0.1.0/src/sufa/core/scanner/active/__init__.py +3 -0
- sufa-0.1.0/src/sufa/core/scanner/active/engine.py +108 -0
- sufa-0.1.0/src/sufa/core/scanner/active/fuzz.py +94 -0
- sufa-0.1.0/src/sufa/core/scanner/active/verifier.py +89 -0
- sufa-0.1.0/src/sufa/core/scanner/passive.py +315 -0
- sufa-0.1.0/src/sufa/core/scanner/profiles.py +67 -0
- sufa-0.1.0/src/sufa/core/scanner/scope.py +114 -0
- sufa-0.1.0/src/sufa/core/session/__init__.py +3 -0
- sufa-0.1.0/src/sufa/core/session/manager.py +116 -0
- sufa-0.1.0/src/sufa/core/traffic/__init__.py +3 -0
- sufa-0.1.0/src/sufa/core/traffic/models.py +22 -0
- sufa-0.1.0/src/sufa/core/traffic/replay.py +48 -0
- sufa-0.1.0/src/sufa/core/traffic/repository.py +19 -0
- sufa-0.1.0/src/sufa/core/traffic/store.py +90 -0
- sufa-0.1.0/src/sufa/core/utils/__init__.py +4 -0
- sufa-0.1.0/src/sufa/core/utils/config.py +144 -0
- sufa-0.1.0/src/sufa/core/utils/logging.py +41 -0
- sufa-0.1.0/src/sufa/crawler/__init__.py +3 -0
- sufa-0.1.0/src/sufa/crawler/api_discovery.py +132 -0
- sufa-0.1.0/src/sufa/crawler/js_parser.py +45 -0
- sufa-0.1.0/src/sufa/crawler/spider.py +101 -0
- sufa-0.1.0/src/sufa/payloads/idor.txt +10 -0
- sufa-0.1.0/src/sufa/payloads/lfi.txt +13 -0
- sufa-0.1.0/src/sufa/payloads/sqli.txt +16 -0
- sufa-0.1.0/src/sufa/payloads/ssrf.txt +13 -0
- sufa-0.1.0/src/sufa/payloads/xss.txt +15 -0
- sufa-0.1.0/src/sufa/proxy/__init__.py +3 -0
- sufa-0.1.0/src/sufa/proxy/handler.py +22 -0
- sufa-0.1.0/src/sufa/proxy/interceptor.py +108 -0
- sufa-0.1.0/src/sufa/server/__init__.py +3 -0
- sufa-0.1.0/src/sufa/server/app.py +52 -0
- sufa-0.1.0/src/sufa/server/auth/__init__.py +3 -0
- sufa-0.1.0/src/sufa/server/auth/rbac.py +73 -0
- sufa-0.1.0/src/sufa/server/middleware/__init__.py +0 -0
- sufa-0.1.0/src/sufa/server/middleware/audit.py +33 -0
- sufa-0.1.0/src/sufa/server/routes/__init__.py +0 -0
- sufa-0.1.0/src/sufa/server/routes/findings.py +61 -0
- sufa-0.1.0/src/sufa/server/routes/projects.py +63 -0
- sufa-0.1.0/src/sufa/server/routes/scans.py +59 -0
- sufa-0.1.0/src/sufa/server/routes/traffic.py +63 -0
- sufa-0.1.0/tests/__init__.py +0 -0
- sufa-0.1.0/tests/conftest.py +98 -0
- sufa-0.1.0/tests/integration/__init__.py +0 -0
- sufa-0.1.0/tests/unit/__init__.py +0 -0
- sufa-0.1.0/tests/unit/test_config.py +43 -0
- sufa-0.1.0/tests/unit/test_dedup.py +81 -0
- sufa-0.1.0/tests/unit/test_events.py +91 -0
- sufa-0.1.0/tests/unit/test_http.py +68 -0
- sufa-0.1.0/tests/unit/test_models.py +67 -0
- sufa-0.1.0/tests/unit/test_repository.py +88 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.12"
|
|
17
|
+
- run: pip install ruff
|
|
18
|
+
- run: ruff check src/ tests/
|
|
19
|
+
- run: ruff format --check src/ tests/
|
|
20
|
+
|
|
21
|
+
test:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
strategy:
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
- run: pip install -e ".[dev]"
|
|
32
|
+
- run: pytest tests/ -v --tb=short
|
|
33
|
+
|
|
34
|
+
build:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
needs: [lint, test]
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
- uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
- run: pip install build
|
|
43
|
+
- run: python -m build
|
|
44
|
+
- uses: actions/upload-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
path: dist/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Docker
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
branches: [master]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-push:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- uses: docker/setup-buildx-action@v3
|
|
15
|
+
|
|
16
|
+
- uses: docker/login-action@v3
|
|
17
|
+
if: github.event_name != 'pull_request'
|
|
18
|
+
with:
|
|
19
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
20
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
21
|
+
|
|
22
|
+
- uses: docker/metadata-action@v5
|
|
23
|
+
id: meta
|
|
24
|
+
with:
|
|
25
|
+
images: sufiyansaidsha/sufaai
|
|
26
|
+
tags: |
|
|
27
|
+
type=ref,event=branch
|
|
28
|
+
type=semver,pattern={{version}}
|
|
29
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
30
|
+
|
|
31
|
+
- uses: docker/build-push-action@v6
|
|
32
|
+
with:
|
|
33
|
+
context: .
|
|
34
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
35
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
36
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
37
|
+
cache-from: type=gha
|
|
38
|
+
cache-to: type=gha,mode=max
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- run: pip install -e ".[dev]"
|
|
20
|
+
- run: pytest tests/ -v --tb=short
|
|
21
|
+
|
|
22
|
+
build:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
needs: test
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
- uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
- run: pip install build
|
|
31
|
+
- run: python -m build
|
|
32
|
+
- uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: dist
|
|
35
|
+
path: dist/
|
|
36
|
+
|
|
37
|
+
pypi:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
needs: build
|
|
40
|
+
environment: pypi
|
|
41
|
+
permissions:
|
|
42
|
+
id-token: write
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/download-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
path: dist/
|
|
48
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
49
|
+
|
|
50
|
+
github-release:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
needs: build
|
|
53
|
+
permissions:
|
|
54
|
+
contents: write
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
- uses: actions/download-artifact@v4
|
|
58
|
+
with:
|
|
59
|
+
name: dist
|
|
60
|
+
path: dist/
|
|
61
|
+
- uses: softprops/action-gh-release@v2
|
|
62
|
+
with:
|
|
63
|
+
files: dist/*
|
|
64
|
+
generate_release_notes: true
|
sufa-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.eggs/
|
|
8
|
+
*.egg
|
|
9
|
+
|
|
10
|
+
.env
|
|
11
|
+
.env.*
|
|
12
|
+
*.key
|
|
13
|
+
secrets.*
|
|
14
|
+
credentials.*
|
|
15
|
+
|
|
16
|
+
*.sqlite
|
|
17
|
+
*.db
|
|
18
|
+
*.sqlite3
|
|
19
|
+
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.coverage
|
|
22
|
+
htmlcov/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
|
|
25
|
+
.venv/
|
|
26
|
+
venv/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
*.log
|
|
30
|
+
logs/
|
|
31
|
+
|
|
32
|
+
.idea/
|
|
33
|
+
.vscode/
|
|
34
|
+
.cursor/
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
*~
|
sufa-0.1.0/Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
6
|
+
gcc libffi-dev && \
|
|
7
|
+
rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
COPY pyproject.toml README.md LICENSE ./
|
|
10
|
+
COPY src/ src/
|
|
11
|
+
COPY alembic.ini alembic/ ./alembic/
|
|
12
|
+
COPY plugins/ plugins/
|
|
13
|
+
|
|
14
|
+
RUN pip install --no-cache-dir ".[server,crawler]"
|
|
15
|
+
|
|
16
|
+
EXPOSE 9000
|
|
17
|
+
|
|
18
|
+
ENV SUFA_DB_URL="sqlite:///data/sufa.db"
|
|
19
|
+
|
|
20
|
+
VOLUME ["/data"]
|
|
21
|
+
|
|
22
|
+
ENTRYPOINT ["sufa"]
|
|
23
|
+
CMD ["server", "start", "--port", "9000"]
|
sufa-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sufa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sufa-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sufa
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI-powered web vulnerability analysis platform
|
|
5
|
+
Project-URL: Homepage, https://github.com/sufiyansaidsha/sufaAI
|
|
6
|
+
Project-URL: Repository, https://github.com/sufiyansaidsha/sufaAI
|
|
7
|
+
Project-URL: Issues, https://github.com/sufiyansaidsha/sufaAI/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/sufiyansaidsha/sufaAI#readme
|
|
9
|
+
Author: sufiyansaidsha
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai,burp,llm,owasp,pentest,scanner,security,vulnerability
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: alembic>=1.13.0
|
|
26
|
+
Requires-Dist: httpx>=0.27.0
|
|
27
|
+
Requires-Dist: jinja2>=3.1.0
|
|
28
|
+
Requires-Dist: keyring>=25.0.0
|
|
29
|
+
Requires-Dist: pydantic>=2.0.0
|
|
30
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
31
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
32
|
+
Requires-Dist: rich>=13.0.0
|
|
33
|
+
Requires-Dist: sqlalchemy>=2.0.0
|
|
34
|
+
Requires-Dist: structlog>=24.0.0
|
|
35
|
+
Requires-Dist: typer>=0.9.0
|
|
36
|
+
Provides-Extra: all
|
|
37
|
+
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'all'
|
|
38
|
+
Requires-Dist: fastapi>=0.110.0; extra == 'all'
|
|
39
|
+
Requires-Dist: lxml>=5.0.0; extra == 'all'
|
|
40
|
+
Requires-Dist: mitmproxy>=10.0.0; extra == 'all'
|
|
41
|
+
Requires-Dist: passlib[bcrypt]>=1.7.4; extra == 'all'
|
|
42
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == 'all'
|
|
43
|
+
Requires-Dist: python-jose[cryptography]>=3.3.0; extra == 'all'
|
|
44
|
+
Requires-Dist: uvicorn>=0.27.0; extra == 'all'
|
|
45
|
+
Requires-Dist: weasyprint>=62.0; extra == 'all'
|
|
46
|
+
Provides-Extra: crawler
|
|
47
|
+
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'crawler'
|
|
48
|
+
Requires-Dist: lxml>=5.0.0; extra == 'crawler'
|
|
49
|
+
Provides-Extra: dev
|
|
50
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
51
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
|
52
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
53
|
+
Requires-Dist: ruff>=0.3.0; extra == 'dev'
|
|
54
|
+
Provides-Extra: pdf
|
|
55
|
+
Requires-Dist: weasyprint>=62.0; extra == 'pdf'
|
|
56
|
+
Provides-Extra: proxy
|
|
57
|
+
Requires-Dist: mitmproxy>=10.0.0; extra == 'proxy'
|
|
58
|
+
Provides-Extra: server
|
|
59
|
+
Requires-Dist: fastapi>=0.110.0; extra == 'server'
|
|
60
|
+
Requires-Dist: passlib[bcrypt]>=1.7.4; extra == 'server'
|
|
61
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == 'server'
|
|
62
|
+
Requires-Dist: python-jose[cryptography]>=3.3.0; extra == 'server'
|
|
63
|
+
Requires-Dist: uvicorn>=0.27.0; extra == 'server'
|
|
64
|
+
Description-Content-Type: text/markdown
|
|
65
|
+
|
|
66
|
+
# sufa
|
|
67
|
+
|
|
68
|
+
AI-powered web vulnerability analysis platform.
|
|
69
|
+
|
|
70
|
+
sufa combines AI reasoning, traditional scanning techniques, attack chain discovery, and pentester workflows into a unified CLI tool with Burp Suite integration.
|
|
71
|
+
|
|
72
|
+
## Features
|
|
73
|
+
|
|
74
|
+
- **AI-Powered Analysis** -- Passive and active vulnerability detection using Ollama, OpenAI, Claude, or Gemini
|
|
75
|
+
- **Central Traffic Store** -- Persist, replay, and analyze HTTP traffic
|
|
76
|
+
- **Smart Deduplication** -- Endpoint normalization prevents redundant analysis
|
|
77
|
+
- **Attack Chain Discovery** -- AI connects individual findings into multi-step attack paths
|
|
78
|
+
- **Event-Driven Architecture** -- Extensible plugin system with publish/subscribe events
|
|
79
|
+
- **Data Redaction** -- Automatically strips sensitive data before sending to AI providers
|
|
80
|
+
- **Multiple Report Formats** -- JSON, HTML, PDF, SARIF for CI/CD integration
|
|
81
|
+
|
|
82
|
+
## Quick Start
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install sufa
|
|
86
|
+
|
|
87
|
+
# Configure AI provider
|
|
88
|
+
sufa config set ai.provider ollama
|
|
89
|
+
sufa config set ai.model deepseek-r1:latest
|
|
90
|
+
|
|
91
|
+
# Test connectivity
|
|
92
|
+
sufa provider test
|
|
93
|
+
|
|
94
|
+
# Scan a target
|
|
95
|
+
sufa scan https://target.example.com
|
|
96
|
+
|
|
97
|
+
# View findings
|
|
98
|
+
sufa findings list
|
|
99
|
+
|
|
100
|
+
# Generate report
|
|
101
|
+
sufa report generate --format html
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## CLI Commands
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
sufa scan <url> Passive scan a target
|
|
108
|
+
sufa scan --profile deep <url> Deep scan with active verification
|
|
109
|
+
sufa proxy start --port 8080 Start intercept proxy
|
|
110
|
+
sufa import <file.har> Import HAR file for analysis
|
|
111
|
+
sufa replay <request-id> Replay a stored request
|
|
112
|
+
sufa findings list List all findings
|
|
113
|
+
sufa findings chains Show discovered attack chains
|
|
114
|
+
sufa report generate --format pdf Generate report
|
|
115
|
+
sufa project create "name" Create a project
|
|
116
|
+
sufa config set <key> <value> Set configuration
|
|
117
|
+
sufa provider test Test AI provider connectivity
|
|
118
|
+
sufa server start Start API server (Enterprise)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## AI Providers
|
|
122
|
+
|
|
123
|
+
| Provider | Local | Cost |
|
|
124
|
+
|----------|-------|------|
|
|
125
|
+
| Ollama | Yes | Free |
|
|
126
|
+
| OpenAI | No | Paid |
|
|
127
|
+
| Claude | No | Paid |
|
|
128
|
+
| Gemini | No | Paid |
|
|
129
|
+
|
|
130
|
+
## Development
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pip install -e ".[dev,all]"
|
|
134
|
+
pytest
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
sufa-0.1.0/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# sufa
|
|
2
|
+
|
|
3
|
+
AI-powered web vulnerability analysis platform.
|
|
4
|
+
|
|
5
|
+
sufa combines AI reasoning, traditional scanning techniques, attack chain discovery, and pentester workflows into a unified CLI tool with Burp Suite integration.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **AI-Powered Analysis** -- Passive and active vulnerability detection using Ollama, OpenAI, Claude, or Gemini
|
|
10
|
+
- **Central Traffic Store** -- Persist, replay, and analyze HTTP traffic
|
|
11
|
+
- **Smart Deduplication** -- Endpoint normalization prevents redundant analysis
|
|
12
|
+
- **Attack Chain Discovery** -- AI connects individual findings into multi-step attack paths
|
|
13
|
+
- **Event-Driven Architecture** -- Extensible plugin system with publish/subscribe events
|
|
14
|
+
- **Data Redaction** -- Automatically strips sensitive data before sending to AI providers
|
|
15
|
+
- **Multiple Report Formats** -- JSON, HTML, PDF, SARIF for CI/CD integration
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install sufa
|
|
21
|
+
|
|
22
|
+
# Configure AI provider
|
|
23
|
+
sufa config set ai.provider ollama
|
|
24
|
+
sufa config set ai.model deepseek-r1:latest
|
|
25
|
+
|
|
26
|
+
# Test connectivity
|
|
27
|
+
sufa provider test
|
|
28
|
+
|
|
29
|
+
# Scan a target
|
|
30
|
+
sufa scan https://target.example.com
|
|
31
|
+
|
|
32
|
+
# View findings
|
|
33
|
+
sufa findings list
|
|
34
|
+
|
|
35
|
+
# Generate report
|
|
36
|
+
sufa report generate --format html
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## CLI Commands
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
sufa scan <url> Passive scan a target
|
|
43
|
+
sufa scan --profile deep <url> Deep scan with active verification
|
|
44
|
+
sufa proxy start --port 8080 Start intercept proxy
|
|
45
|
+
sufa import <file.har> Import HAR file for analysis
|
|
46
|
+
sufa replay <request-id> Replay a stored request
|
|
47
|
+
sufa findings list List all findings
|
|
48
|
+
sufa findings chains Show discovered attack chains
|
|
49
|
+
sufa report generate --format pdf Generate report
|
|
50
|
+
sufa project create "name" Create a project
|
|
51
|
+
sufa config set <key> <value> Set configuration
|
|
52
|
+
sufa provider test Test AI provider connectivity
|
|
53
|
+
sufa server start Start API server (Enterprise)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## AI Providers
|
|
57
|
+
|
|
58
|
+
| Provider | Local | Cost |
|
|
59
|
+
|----------|-------|------|
|
|
60
|
+
| Ollama | Yes | Free |
|
|
61
|
+
| OpenAI | No | Paid |
|
|
62
|
+
| Claude | No | Paid |
|
|
63
|
+
| Gemini | No | Paid |
|
|
64
|
+
|
|
65
|
+
## Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install -e ".[dev,all]"
|
|
69
|
+
pytest
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Alembic environment configuration."""
|
|
2
|
+
|
|
3
|
+
from logging.config import fileConfig
|
|
4
|
+
|
|
5
|
+
from alembic import context
|
|
6
|
+
from sqlalchemy import engine_from_config, pool
|
|
7
|
+
|
|
8
|
+
from sufa.core.db.models import Base
|
|
9
|
+
|
|
10
|
+
config = context.config
|
|
11
|
+
if config.config_file_name is not None:
|
|
12
|
+
fileConfig(config.config_file_name)
|
|
13
|
+
|
|
14
|
+
target_metadata = Base.metadata
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def run_migrations_offline() -> None:
|
|
18
|
+
url = config.get_main_option("sqlalchemy.url")
|
|
19
|
+
context.configure(url=url, target_metadata=target_metadata, literal_binds=True)
|
|
20
|
+
with context.begin_transaction():
|
|
21
|
+
context.run_migrations()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def run_migrations_online() -> None:
|
|
25
|
+
connectable = engine_from_config(
|
|
26
|
+
config.get_section(config.config_ini_section, {}),
|
|
27
|
+
prefix="sqlalchemy.",
|
|
28
|
+
poolclass=pool.NullPool,
|
|
29
|
+
)
|
|
30
|
+
with connectable.connect() as connection:
|
|
31
|
+
context.configure(connection=connection, target_metadata=target_metadata)
|
|
32
|
+
with context.begin_transaction():
|
|
33
|
+
context.run_migrations()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if context.is_offline_mode():
|
|
37
|
+
run_migrations_offline()
|
|
38
|
+
else:
|
|
39
|
+
run_migrations_online()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""${message}
|
|
2
|
+
|
|
3
|
+
Revision ID: ${up_revision}
|
|
4
|
+
Revises: ${down_revision | comma,n}
|
|
5
|
+
Create Date: ${create_date}
|
|
6
|
+
"""
|
|
7
|
+
from typing import Sequence, Union
|
|
8
|
+
|
|
9
|
+
from alembic import op
|
|
10
|
+
import sqlalchemy as sa
|
|
11
|
+
${imports if imports else ""}
|
|
12
|
+
|
|
13
|
+
revision: str = ${repr(up_revision)}
|
|
14
|
+
down_revision: Union[str, None] = ${repr(down_revision)}
|
|
15
|
+
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
|
16
|
+
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def upgrade() -> None:
|
|
20
|
+
${upgrades if upgrades else "pass"}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def downgrade() -> None:
|
|
24
|
+
${downgrades if downgrades else "pass"}
|
sufa-0.1.0/alembic.ini
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[alembic]
|
|
2
|
+
script_location = alembic
|
|
3
|
+
sqlalchemy.url = sqlite:///%(here)s/sufa.db
|
|
4
|
+
|
|
5
|
+
[loggers]
|
|
6
|
+
keys = root,sqlalchemy,alembic
|
|
7
|
+
|
|
8
|
+
[handlers]
|
|
9
|
+
keys = console
|
|
10
|
+
|
|
11
|
+
[formatters]
|
|
12
|
+
keys = generic
|
|
13
|
+
|
|
14
|
+
[logger_root]
|
|
15
|
+
level = WARN
|
|
16
|
+
handlers = console
|
|
17
|
+
|
|
18
|
+
[logger_sqlalchemy]
|
|
19
|
+
level = WARN
|
|
20
|
+
handlers =
|
|
21
|
+
qualname = sqlalchemy.engine
|
|
22
|
+
|
|
23
|
+
[logger_alembic]
|
|
24
|
+
level = INFO
|
|
25
|
+
handlers =
|
|
26
|
+
qualname = alembic
|
|
27
|
+
|
|
28
|
+
[handler_console]
|
|
29
|
+
class = StreamHandler
|
|
30
|
+
args = (sys.stderr,)
|
|
31
|
+
level = NOTSET
|
|
32
|
+
formatter = generic
|
|
33
|
+
|
|
34
|
+
[formatter_generic]
|
|
35
|
+
format = %(levelname)-5.5s [%(name)s] %(message)s
|
|
36
|
+
datefmt = %H:%M:%S
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
version: "3.9"
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
sufa:
|
|
5
|
+
build: .
|
|
6
|
+
ports:
|
|
7
|
+
- "9000:9000"
|
|
8
|
+
volumes:
|
|
9
|
+
- sufa-data:/data
|
|
10
|
+
environment:
|
|
11
|
+
- SUFA_DB_URL=sqlite:///data/sufa.db
|
|
12
|
+
restart: unless-stopped
|
|
13
|
+
|
|
14
|
+
sufa-postgres:
|
|
15
|
+
image: postgres:16-alpine
|
|
16
|
+
environment:
|
|
17
|
+
POSTGRES_DB: sufa
|
|
18
|
+
POSTGRES_USER: sufa
|
|
19
|
+
POSTGRES_PASSWORD: sufa_secret
|
|
20
|
+
ports:
|
|
21
|
+
- "5432:5432"
|
|
22
|
+
volumes:
|
|
23
|
+
- pg-data:/var/lib/postgresql/data
|
|
24
|
+
profiles:
|
|
25
|
+
- enterprise
|
|
26
|
+
|
|
27
|
+
sufa-enterprise:
|
|
28
|
+
build: .
|
|
29
|
+
ports:
|
|
30
|
+
- "9000:9000"
|
|
31
|
+
environment:
|
|
32
|
+
- SUFA_DB_URL=postgresql://sufa:sufa_secret@sufa-postgres:5432/sufa
|
|
33
|
+
depends_on:
|
|
34
|
+
- sufa-postgres
|
|
35
|
+
restart: unless-stopped
|
|
36
|
+
profiles:
|
|
37
|
+
- enterprise
|
|
38
|
+
|
|
39
|
+
volumes:
|
|
40
|
+
sufa-data:
|
|
41
|
+
pg-data:
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""GraphQL Scanner Plugin -- detects GraphQL-specific security issues."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from sufa.core.events.events import Event
|
|
8
|
+
from sufa.core.plugins.interface import SufaPlugin
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class GraphQLScannerPlugin(SufaPlugin):
|
|
12
|
+
name = "graphql_scanner"
|
|
13
|
+
version = "0.1.0"
|
|
14
|
+
description = "Detect GraphQL-specific vulnerabilities"
|
|
15
|
+
author = "sufa"
|
|
16
|
+
|
|
17
|
+
def on_load(self, context: dict[str, Any]) -> None:
|
|
18
|
+
self._graphql_endpoints: set[str] = set()
|
|
19
|
+
|
|
20
|
+
def on_response(self, event: Event) -> None:
|
|
21
|
+
url = event.data.get("url", "")
|
|
22
|
+
body = event.data.get("body", "")
|
|
23
|
+
|
|
24
|
+
if any(p in url.lower() for p in ("/graphql", "/gql")):
|
|
25
|
+
self._graphql_endpoints.add(url)
|
|
26
|
+
|
|
27
|
+
if '"__schema"' in body or '"__type"' in body:
|
|
28
|
+
self._report_introspection(url)
|
|
29
|
+
|
|
30
|
+
if "errors" in body and "locations" in body:
|
|
31
|
+
self._report_verbose_errors(url)
|
|
32
|
+
|
|
33
|
+
def _report_introspection(self, url: str) -> None:
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
def _report_verbose_errors(self, url: str) -> None:
|
|
37
|
+
pass
|