jscope 0.4.2__tar.gz → 0.5.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.
- {jscope-0.4.2 → jscope-0.5.0}/PKG-INFO +18 -10
- {jscope-0.4.2 → jscope-0.5.0}/README.md +14 -6
- jscope-0.5.0/jscope/__init__.py +1 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/cli.py +30 -14
- jscope-0.5.0/jscope/terminal.py +118 -0
- jscope-0.5.0/jscope/wizard.py +107 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope.egg-info/PKG-INFO +18 -10
- {jscope-0.4.2 → jscope-0.5.0}/jscope.egg-info/SOURCES.txt +3 -0
- {jscope-0.4.2 → jscope-0.5.0}/pyproject.toml +3 -3
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_cli_entry.py +22 -2
- jscope-0.4.2/jscope/__init__.py +0 -1
- {jscope-0.4.2 → jscope-0.5.0}/LICENSE +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/__main__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/ai/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/ai/explain.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/ai/providers.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/auth_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/authorization_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/base.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/common.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/dataflow_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/endpoint_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/framework_detector.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/graphql_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/graphql_schema_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/html_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/manager.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/openapi_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/router_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/secret_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/service_worker_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/source_map_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/storage_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/analyzers/wasm_analyzer.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/assessment_engine.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/assessment_reporting.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/benchmark/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/benchmark/fixtures.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/benchmark/runner.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/config.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/artifacts.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/cache.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/classification.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/evidence.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/graph.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/core/redact.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/crawler/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/crawler/crawler.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/dataflow/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/dataflow/engine.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/dataflow/modules.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/dataflow/rules.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/downloader/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/downloader/downloader.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/parsing/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/parsing/ast_engine.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/parsing/graphql_schema.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/parsing/html.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/parsing/queries.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/parsing/wasm.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/passive_discovery.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/pipeline.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/plugin/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/plugin/_worker.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/plugin/loader.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/plugin/sandbox.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/reporting/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/reporting/formats.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/reporting/human.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/reporting/json_report.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/reporting/priority.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/runtime/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/runtime/observe.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/runtime/prober.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/runtime/scope.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/security_transport.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/verify/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/verify/engine.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/workspace/__init__.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/workspace/assessment.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/workspace/common.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/workspace/diff.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope/workspace/store.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope.egg-info/dependency_links.txt +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope.egg-info/entry_points.txt +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope.egg-info/requires.txt +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/jscope.egg-info/top_level.txt +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/setup.cfg +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_analyzers.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_assessment_scope.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_ast_engine.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_benchmark.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_dataflow.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_engine_hardening_and_plugins.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_evidence_engine.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_graph_correlation.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_incremental.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_live_local.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_observe.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_path_independence.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_phase2_analyzers.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_phase2_scope_transport.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_phase3.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_phase4.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_phases345_hardening.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_plugin_isolation.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_router.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_scope.py +0 -0
- {jscope-0.4.2 → jscope-0.5.0}/tests/test_verify.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jscope
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Evidence-based JavaScript intelligence for bug bounty hunters and web app pentesters
|
|
5
5
|
Author: Muhammed Ali
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/LIME1Star/
|
|
8
|
-
Project-URL: Issues, https://github.com/LIME1Star/
|
|
9
|
-
Project-URL: Changelog, https://github.com/LIME1Star/
|
|
7
|
+
Project-URL: Homepage, https://github.com/LIME1Star/Jscope
|
|
8
|
+
Project-URL: Issues, https://github.com/LIME1Star/Jscope/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/LIME1Star/Jscope/blob/main/CHANGELOG.md
|
|
10
10
|
Keywords: security,bug-bounty,pentest,javascript,static-analysis,appsec,recon
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Environment :: Console
|
|
@@ -37,7 +37,6 @@ Requires-Dist: build; extra == "dev"
|
|
|
37
37
|
Requires-Dist: twine; extra == "dev"
|
|
38
38
|
Dynamic: license-file
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
<p align="center">
|
|
42
41
|
<picture>
|
|
43
42
|
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.svg">
|
|
@@ -51,7 +50,7 @@ Dynamic: license-file
|
|
|
51
50
|
</p>
|
|
52
51
|
|
|
53
52
|
<p align="center">
|
|
54
|
-
<a href="https://github.com/LIME1Star/
|
|
53
|
+
<a href="https://github.com/LIME1Star/Jscope/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/LIME1Star/Jscope/actions/workflows/ci.yml/badge.svg"></a>
|
|
55
54
|
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
56
55
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green">
|
|
57
56
|
</p>
|
|
@@ -95,11 +94,20 @@ Try it yourself on the bundled fixture (`tests/sample_react`).
|
|
|
95
94
|
## Install
|
|
96
95
|
|
|
97
96
|
```bash
|
|
98
|
-
pip install
|
|
99
|
-
jscope
|
|
97
|
+
python -m pip install --upgrade jscope
|
|
98
|
+
jscope # opens the guided terminal wizard
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
JScope starts with a hawk identity banner and a guided mode selector. **Auto mode** walks through target, assessment profile, review and execution. **Manual mode** lets you run existing JScope commands from an interactive prompt. The original direct CLI remains available:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
jscope --help
|
|
105
|
+
jscope doctor
|
|
106
|
+
jscope analyze ./path/to/project --verbose
|
|
107
|
+
jscope https://app.example.com
|
|
100
108
|
```
|
|
101
109
|
|
|
102
|
-
Python 3.10+. For YAML OpenAPI specs: `pip install "jscope[yaml]
|
|
110
|
+
Python 3.10+. For YAML OpenAPI specs: `python -m pip install "jscope[yaml]"`. For development, clone the repository and install `python -m pip install -e ".[dev]"`. See [docs/RELEASING.md](docs/RELEASING.md) for GitHub and PyPI publishing.
|
|
103
111
|
|
|
104
112
|
## Quick start
|
|
105
113
|
|
|
@@ -166,7 +174,7 @@ JScope is a **beta development tool, not a production scanner.** Be aware of the
|
|
|
166
174
|
## Development
|
|
167
175
|
|
|
168
176
|
```bash
|
|
169
|
-
git clone https://github.com/LIME1Star/
|
|
177
|
+
git clone https://github.com/LIME1Star/Jscope && cd JScope
|
|
170
178
|
python -m venv .venv && . .venv/bin/activate
|
|
171
179
|
pip install -e ".[dev]"
|
|
172
180
|
pytest
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
<picture>
|
|
4
3
|
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.svg">
|
|
@@ -12,7 +11,7 @@
|
|
|
12
11
|
</p>
|
|
13
12
|
|
|
14
13
|
<p align="center">
|
|
15
|
-
<a href="https://github.com/LIME1Star/
|
|
14
|
+
<a href="https://github.com/LIME1Star/Jscope/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/LIME1Star/Jscope/actions/workflows/ci.yml/badge.svg"></a>
|
|
16
15
|
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
17
16
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green">
|
|
18
17
|
</p>
|
|
@@ -56,11 +55,20 @@ Try it yourself on the bundled fixture (`tests/sample_react`).
|
|
|
56
55
|
## Install
|
|
57
56
|
|
|
58
57
|
```bash
|
|
59
|
-
pip install
|
|
60
|
-
jscope
|
|
58
|
+
python -m pip install --upgrade jscope
|
|
59
|
+
jscope # opens the guided terminal wizard
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
JScope starts with a hawk identity banner and a guided mode selector. **Auto mode** walks through target, assessment profile, review and execution. **Manual mode** lets you run existing JScope commands from an interactive prompt. The original direct CLI remains available:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
jscope --help
|
|
66
|
+
jscope doctor
|
|
67
|
+
jscope analyze ./path/to/project --verbose
|
|
68
|
+
jscope https://app.example.com
|
|
61
69
|
```
|
|
62
70
|
|
|
63
|
-
Python 3.10+. For YAML OpenAPI specs: `pip install "jscope[yaml]
|
|
71
|
+
Python 3.10+. For YAML OpenAPI specs: `python -m pip install "jscope[yaml]"`. For development, clone the repository and install `python -m pip install -e ".[dev]"`. See [docs/RELEASING.md](docs/RELEASING.md) for GitHub and PyPI publishing.
|
|
64
72
|
|
|
65
73
|
## Quick start
|
|
66
74
|
|
|
@@ -127,7 +135,7 @@ JScope is a **beta development tool, not a production scanner.** Be aware of the
|
|
|
127
135
|
## Development
|
|
128
136
|
|
|
129
137
|
```bash
|
|
130
|
-
git clone https://github.com/LIME1Star/
|
|
138
|
+
git clone https://github.com/LIME1Star/Jscope && cd JScope
|
|
131
139
|
python -m venv .venv && . .venv/bin/activate
|
|
132
140
|
pip install -e ".[dev]"
|
|
133
141
|
pytest
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.0"
|
|
@@ -18,6 +18,7 @@ from jscope.core.graph import KnowledgeGraph
|
|
|
18
18
|
from jscope import __version__
|
|
19
19
|
from jscope.pipeline import run_analysis
|
|
20
20
|
from jscope.reporting import human, json_report
|
|
21
|
+
from jscope import terminal
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
def _emit(text: str, output: str | None) -> None:
|
|
@@ -29,6 +30,12 @@ def _emit(text: str, output: str | None) -> None:
|
|
|
29
30
|
print(text)
|
|
30
31
|
|
|
31
32
|
|
|
33
|
+
def _run_analysis(paths, config, label: str = "Inspecting JavaScript and related source files"):
|
|
34
|
+
"""Run the existing engine with JScope's terminal activity treatment."""
|
|
35
|
+
with terminal.activity(label):
|
|
36
|
+
return run_analysis(paths, config)
|
|
37
|
+
|
|
38
|
+
|
|
32
39
|
def _print_report(res, fmt: str, verbose: bool, output: str | None = None):
|
|
33
40
|
if fmt in ("markdown", "md", "html", "sarif"):
|
|
34
41
|
from jscope.reporting.formats import render_payload
|
|
@@ -57,7 +64,7 @@ def cmd_analyze(args: argparse.Namespace) -> int:
|
|
|
57
64
|
config.data["source_maps"]["expand"] = True
|
|
58
65
|
for pth in args.plugin_path or []:
|
|
59
66
|
config.data["plugins"]["paths"].append(pth)
|
|
60
|
-
res =
|
|
67
|
+
res = _run_analysis(args.paths, config)
|
|
61
68
|
|
|
62
69
|
if res.file_count == 0:
|
|
63
70
|
print("no analyzable files (JavaScript, HTML, OpenAPI, GraphQL schema, WASM) found at given path(s)", file=sys.stderr)
|
|
@@ -159,7 +166,7 @@ def cmd_go(args: argparse.Namespace) -> int:
|
|
|
159
166
|
|
|
160
167
|
if local_path.exists():
|
|
161
168
|
print(f"-> local path: {local_path}", file=sys.stderr)
|
|
162
|
-
res =
|
|
169
|
+
res = _run_analysis([str(local_path)], config, "Inspecting local target")
|
|
163
170
|
if res.file_count == 0:
|
|
164
171
|
print("no analyzable files (JavaScript, HTML, OpenAPI, GraphQL schema, WASM) found at that path", file=sys.stderr)
|
|
165
172
|
return 1
|
|
@@ -200,7 +207,7 @@ def cmd_go(args: argparse.Namespace) -> int:
|
|
|
200
207
|
failed = [r for r in results if not r.ok]
|
|
201
208
|
print(f" saved {ok} file(s)" + (f", {len(failed)} failed (run `jscope download {url_list} --out <dir>` to see why)" if failed else ""), file=sys.stderr)
|
|
202
209
|
print("[3/3] analyzing ...", file=sys.stderr)
|
|
203
|
-
res =
|
|
210
|
+
res = _run_analysis([str(site_dir)], config, "Analyzing downloaded source")
|
|
204
211
|
if res.file_count == 0:
|
|
205
212
|
print("downloaded files contained nothing analyzable", file=sys.stderr)
|
|
206
213
|
return 1
|
|
@@ -228,7 +235,7 @@ def cmd_go(args: argparse.Namespace) -> int:
|
|
|
228
235
|
if headers is None:
|
|
229
236
|
return 1
|
|
230
237
|
rc, updated = _confirm_core(payload, url, args.allow_host or [host], args.rate, args.max_requests,
|
|
231
|
-
headers, config, dry_run=False,
|
|
238
|
+
headers, config, dry_run=False, authorize_active_tests=args.authorize_active_tests)
|
|
232
239
|
if rc == 0 and updated:
|
|
233
240
|
with open(findings_path, "w") as f:
|
|
234
241
|
json.dump(updated, f, indent=2)
|
|
@@ -415,7 +422,7 @@ def cmd_scan(args: argparse.Namespace) -> int:
|
|
|
415
422
|
config.data["min_confidence"] = args.min_confidence
|
|
416
423
|
if args.format:
|
|
417
424
|
config.data["output"]["format"] = args.format
|
|
418
|
-
res =
|
|
425
|
+
res = _run_analysis([str(root)], config, "Analyzing workspace target")
|
|
419
426
|
if res.file_count == 0:
|
|
420
427
|
print("downloaded files contained nothing analyzable", file=sys.stderr)
|
|
421
428
|
return 1
|
|
@@ -442,7 +449,7 @@ def cmd_graph(args: argparse.Namespace) -> int:
|
|
|
442
449
|
graph = KnowledgeGraph.from_dict(data["graph"])
|
|
443
450
|
else:
|
|
444
451
|
config = Config.load(args.config)
|
|
445
|
-
res =
|
|
452
|
+
res = _run_analysis([args.source], config, "Analyzing input source")
|
|
446
453
|
graph = res.graph
|
|
447
454
|
chains = graph.route_chains()
|
|
448
455
|
if args.format == "json":
|
|
@@ -797,7 +804,7 @@ def cmd_report(args: argparse.Namespace) -> int:
|
|
|
797
804
|
|
|
798
805
|
|
|
799
806
|
def _confirm_core(data: dict, base_url: str, allow_hosts: list[str], rate: float | None, max_requests: int | None,
|
|
800
|
-
headers: dict, config: Config, dry_run: bool,
|
|
807
|
+
headers: dict, config: Config, dry_run: bool, authorize_active_tests: bool) -> tuple[int, dict | None]:
|
|
801
808
|
"""Shared by `jscope confirm` and `jscope go --confirm`. Returns (exit_code, updated_payload_or_None)."""
|
|
802
809
|
from jscope.runtime.prober import Prober, ScopeError, apply_results
|
|
803
810
|
findings = [finding_from_dict(m) for m in data["findings"]]
|
|
@@ -816,8 +823,8 @@ def _confirm_core(data: dict, base_url: str, allow_hosts: list[str], rate: float
|
|
|
816
823
|
if dry_run:
|
|
817
824
|
print("[dry run: nothing was sent]", file=sys.stderr)
|
|
818
825
|
return 0, None
|
|
819
|
-
if not
|
|
820
|
-
print("error: refusing to send requests without --
|
|
826
|
+
if not authorize_active_tests:
|
|
827
|
+
print("error: refusing to send requests without --authorize-active-tests. "
|
|
821
828
|
"Use --dry-run to review the plan first.", file=sys.stderr)
|
|
822
829
|
return 1, None
|
|
823
830
|
_, results = prober.run(findings)
|
|
@@ -979,7 +986,7 @@ def cmd_confirm(args: argparse.Namespace) -> int:
|
|
|
979
986
|
if headers is None:
|
|
980
987
|
return 1
|
|
981
988
|
rc, updated = _confirm_core(data, args.base_url, args.allow_host or [], args.rate, args.max_requests,
|
|
982
|
-
headers, config, args.dry_run, args.
|
|
989
|
+
headers, config, args.dry_run, args.authorize_active_tests)
|
|
983
990
|
if rc == 0 and updated and args.out:
|
|
984
991
|
with open(args.out, "w") as fh:
|
|
985
992
|
json.dump(updated, fh, indent=2)
|
|
@@ -1022,9 +1029,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1022
1029
|
pg2.add_argument("--allow-private", action="store_true", help="permit loopback/private destinations (controlled local testing only)")
|
|
1023
1030
|
pg2.add_argument("--no-probe", action="store_true", help="skip well-known OpenAPI/GraphQL spec paths (remote targets only)")
|
|
1024
1031
|
pg2.add_argument("-y", "--yes", action="store_true", help="skip the target-confirmation prompt (required in non-interactive sessions)")
|
|
1025
|
-
pg2.add_argument("--confirm", action="store_true", help="after analyzing,
|
|
1032
|
+
pg2.add_argument("--confirm", action="store_true", help="after analyzing, run opt-in runtime confirmation (requires --authorize-active-tests to send requests)")
|
|
1026
1033
|
pg2.add_argument("--allow-host", action="append", help="host(s) allowed for --confirm (default: the target's own host)")
|
|
1027
|
-
pg2.add_argument("--
|
|
1034
|
+
pg2.add_argument("--authorize-active-tests", action="store_true", help="explicitly authorize the opt-in confirmation requests")
|
|
1028
1035
|
pg2.add_argument("--header", action="append", help="extra header for --confirm, e.g. 'Cookie: session=...'")
|
|
1029
1036
|
pg2.add_argument("--rate", type=float, default=None)
|
|
1030
1037
|
pg2.add_argument("--max-requests", type=int, default=None)
|
|
@@ -1102,7 +1109,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1102
1109
|
pk.add_argument("findings_file", help="saved with `jscope analyze --save-findings`")
|
|
1103
1110
|
pk.add_argument("--base-url", required=True, help="origin to test, e.g. https://app.example.com")
|
|
1104
1111
|
pk.add_argument("--allow-host", action="append", help="host[:port] you are authorized to test (repeatable, required)")
|
|
1105
|
-
pk.add_argument("--
|
|
1112
|
+
pk.add_argument("--authorize-active-tests", action="store_true", help="explicitly authorize the planned confirmation requests")
|
|
1106
1113
|
pk.add_argument("--dry-run", action="store_true", help="print the request plan and send nothing")
|
|
1107
1114
|
pk.add_argument("--header", action="append", help="extra request header 'Name: value' (e.g. a session cookie you own)")
|
|
1108
1115
|
pk.add_argument("--rate", type=float, default=None, help="requests per second (default 2)")
|
|
@@ -1229,8 +1236,17 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1229
1236
|
return p
|
|
1230
1237
|
|
|
1231
1238
|
|
|
1232
|
-
def main(argv: list[str] | None = None) -> int:
|
|
1239
|
+
def main(argv: list[str] | None = None, *, _show_banner: bool = True) -> int:
|
|
1233
1240
|
argv = sys.argv[1:] if argv is None else list(argv)
|
|
1241
|
+
if not argv and sys.stdin.isatty() and sys.stderr.isatty():
|
|
1242
|
+
if _show_banner:
|
|
1243
|
+
terminal.banner()
|
|
1244
|
+
from jscope.wizard import launch_wizard
|
|
1245
|
+
return launch_wizard()
|
|
1246
|
+
if _show_banner and sys.stderr.isatty():
|
|
1247
|
+
terminal.banner()
|
|
1248
|
+
if not argv:
|
|
1249
|
+
argv = ["--help"]
|
|
1234
1250
|
argv = _rewrite_bare_target(argv)
|
|
1235
1251
|
parser = build_parser()
|
|
1236
1252
|
args = parser.parse_args(argv)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""JScope's terminal presentation layer.
|
|
2
|
+
|
|
3
|
+
Presentation only: analysis, findings, and report generation remain independent.
|
|
4
|
+
Animations are restricted to interactive terminals; redirected output stays plain.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import itertools
|
|
9
|
+
import os
|
|
10
|
+
import sys
|
|
11
|
+
import threading
|
|
12
|
+
import time
|
|
13
|
+
from contextlib import contextmanager
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _Style:
|
|
17
|
+
RESET = "\x1b[0m"
|
|
18
|
+
DIM = "\x1b[2m"
|
|
19
|
+
BOLD = "\x1b[1m"
|
|
20
|
+
WHITE = "\x1b[97m"
|
|
21
|
+
SILVER = "\x1b[37m"
|
|
22
|
+
LIME = "\x1b[38;5;154m"
|
|
23
|
+
AMBER = "\x1b[38;5;214m"
|
|
24
|
+
RED = "\x1b[38;5;203m"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _color_enabled(stream) -> bool:
|
|
28
|
+
return bool(getattr(stream, "isatty", lambda: False)()) and not os.environ.get("NO_COLOR") and os.environ.get("TERM") != "dumb"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _paint(value: str, code: str, enabled: bool) -> str:
|
|
32
|
+
return f"{code}{value}{_Style.RESET}" if enabled else value
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def feather() -> str:
|
|
36
|
+
"""Small ASCII-native signature: reliable across terminal fonts and encodings."""
|
|
37
|
+
enabled = _color_enabled(sys.stderr)
|
|
38
|
+
return _paint("//>", _Style.LIME + _Style.BOLD, enabled)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def banner() -> None:
|
|
42
|
+
"""Print the JScope hawk identity on interactive terminal startup."""
|
|
43
|
+
enabled = _color_enabled(sys.stderr)
|
|
44
|
+
hawk = r"""⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⢀⠀⠀⠀⣰⡇⢀⡄⠀⠀⠀
|
|
45
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡄⠀⣿⣰⡀⢠⣿⣇⣾⡇⠀⠀⠀
|
|
46
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣰⣿⣿⢇⣾⣿⣼⣿⢃⡞⠀⠀
|
|
47
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⢋⣾⣿⣿⣿⣯⣿⠇⠀⠀
|
|
48
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⢟⣵⣿⣿⣿⣿⣿⣿⣯⡞⠀⠀
|
|
49
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣵⣿⣿⣿⣿⣿⣿⣿⣿⡿⡁⠀⠀
|
|
50
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣦⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀
|
|
51
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀
|
|
52
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⡡⠀⠀⠀
|
|
53
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀
|
|
54
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀
|
|
55
|
+
⠀⠀⢀⣀⣄⣀⡀⡀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡥⠀⠀⠀⠀⠀⠀
|
|
56
|
+
⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀
|
|
57
|
+
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀
|
|
58
|
+
⠘⣿⠋⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
59
|
+
⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣀⡀⠀⠀⠀⠀
|
|
60
|
+
⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⡛⠃⠀⠀
|
|
61
|
+
⠀⠀⠀⠀⠀⠀⢈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀
|
|
62
|
+
⠀⠀⠀⠀⠀⢰⣾⣿⣿⣿⣿⣿⠟⠁⠉⠙⠻⠯⡛⠿⠛⠻⠿⠟⠛⠓⠀⠀
|
|
63
|
+
⠀⠜⡿⠳⡶⠻⣿⣿⣿⣿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
64
|
+
⠀⠀⣠⣽⣧⣾⠛⠉⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
65
|
+
⠀⠀⠉⠟⠁⠘⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"""
|
|
66
|
+
name = _paint("JSCOPE", _Style.WHITE + _Style.BOLD, enabled)
|
|
67
|
+
tagline = _paint("JavaScript Intelligence Framework", _Style.DIM, enabled)
|
|
68
|
+
art = _paint(hawk, _Style.LIME + _Style.BOLD, enabled)
|
|
69
|
+
print(f"\n{art}\n {name} {tagline}\n", file=sys.stderr)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@contextmanager
|
|
73
|
+
def activity(label: str, *, announce: bool = True):
|
|
74
|
+
"""Show a quiet live indicator on TTYs, and deterministic status on other streams."""
|
|
75
|
+
stream = sys.stderr
|
|
76
|
+
tty = _color_enabled(stream)
|
|
77
|
+
if announce and not tty:
|
|
78
|
+
print(f"[>] {label}...", file=stream)
|
|
79
|
+
try:
|
|
80
|
+
yield
|
|
81
|
+
except BaseException:
|
|
82
|
+
print(f"[x] {label} failed", file=stream)
|
|
83
|
+
raise
|
|
84
|
+
else:
|
|
85
|
+
print(f"[+] {label} complete", file=stream)
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
if not tty:
|
|
89
|
+
yield
|
|
90
|
+
return
|
|
91
|
+
|
|
92
|
+
frames = itertools.cycle(("⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"))
|
|
93
|
+
stopped = threading.Event()
|
|
94
|
+
def animate() -> None:
|
|
95
|
+
while not stopped.is_set():
|
|
96
|
+
frame = next(frames)
|
|
97
|
+
line = f"\r {_paint(frame, _Style.LIME, True)} {_paint(label, _Style.SILVER, True)}"
|
|
98
|
+
stream.write(line)
|
|
99
|
+
stream.flush()
|
|
100
|
+
stopped.wait(0.085)
|
|
101
|
+
thread = threading.Thread(target=animate, daemon=True)
|
|
102
|
+
if announce:
|
|
103
|
+
thread.start()
|
|
104
|
+
failed = False
|
|
105
|
+
try:
|
|
106
|
+
yield
|
|
107
|
+
except BaseException:
|
|
108
|
+
failed = True
|
|
109
|
+
raise
|
|
110
|
+
finally:
|
|
111
|
+
if announce:
|
|
112
|
+
stopped.set()
|
|
113
|
+
thread.join(timeout=0.3)
|
|
114
|
+
stream.write("\r\x1b[2K")
|
|
115
|
+
marker = _paint('x' if failed else '+', (_Style.RED if failed else _Style.LIME) + _Style.BOLD, True)
|
|
116
|
+
suffix = "failed" if failed else "complete"
|
|
117
|
+
stream.write(f" {marker} {_paint(label, _Style.SILVER, True)} {_paint(suffix, _Style.DIM, True)}\n")
|
|
118
|
+
stream.flush()
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""Guided interactive entry point for JScope.
|
|
2
|
+
|
|
3
|
+
The wizard is intentionally a thin presentation layer over the existing CLI
|
|
4
|
+
application services. It never invokes a shell and never broadens target scope.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import shlex
|
|
9
|
+
from urllib.parse import urlparse
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _ask(prompt: str, default: str | None = None) -> str:
|
|
13
|
+
suffix = f" [{default}]" if default else ""
|
|
14
|
+
value = input(f"\n{prompt}{suffix}: ").strip()
|
|
15
|
+
return value or (default or "")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _choose(title: str, choices: list[str]) -> int:
|
|
19
|
+
print(f"\n{title}")
|
|
20
|
+
for i, choice in enumerate(choices, 1):
|
|
21
|
+
print(f" {i}. {choice}")
|
|
22
|
+
while True:
|
|
23
|
+
value = _ask("Select", "1")
|
|
24
|
+
if value.isdigit() and 1 <= int(value) <= len(choices):
|
|
25
|
+
return int(value)
|
|
26
|
+
print(f"Enter a number from 1 to {len(choices)}.")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def launch_wizard() -> int:
|
|
30
|
+
"""Launch the interactive Auto / Manual workflow."""
|
|
31
|
+
from jscope.cli import main
|
|
32
|
+
|
|
33
|
+
print("\nWelcome to JScope.")
|
|
34
|
+
while True:
|
|
35
|
+
mode = _choose("Choose a mode", [
|
|
36
|
+
"Auto mode — guided assessment",
|
|
37
|
+
"Manual mode — run individual tools",
|
|
38
|
+
"Exit",
|
|
39
|
+
])
|
|
40
|
+
if mode == 3:
|
|
41
|
+
print("JScope closed.")
|
|
42
|
+
return 0
|
|
43
|
+
if mode == 1:
|
|
44
|
+
return _auto_mode(main)
|
|
45
|
+
result = _manual_mode(main)
|
|
46
|
+
if result is not None:
|
|
47
|
+
return result
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _auto_mode(main) -> int:
|
|
51
|
+
print("\nAUTO MODE")
|
|
52
|
+
print("JScope will discover and analyze the target using its existing scope and transport controls.")
|
|
53
|
+
target = _ask("Target URL or local project path")
|
|
54
|
+
if not target:
|
|
55
|
+
print("No target supplied. Returning to the mode selector.")
|
|
56
|
+
return 0
|
|
57
|
+
|
|
58
|
+
profile = _choose("Assessment profile", [
|
|
59
|
+
"Passive discovery — skip well-known API specification probes",
|
|
60
|
+
"Standard discovery — include well-known API specification paths",
|
|
61
|
+
])
|
|
62
|
+
print("\nASSESSMENT REVIEW")
|
|
63
|
+
print(f" Target : {target}")
|
|
64
|
+
parsed = urlparse(target if "://" in target else f"https://{target}")
|
|
65
|
+
if parsed.hostname:
|
|
66
|
+
print(f" Scope : exact target host ({parsed.hostname}); discovered requests remain host-bound")
|
|
67
|
+
else:
|
|
68
|
+
print(" Scope : local filesystem path; no network requests")
|
|
69
|
+
print(f" Profile: {'Passive discovery' if profile == 1 else 'Standard discovery'}")
|
|
70
|
+
print(" Actions: discover assets, download discovered resources, analyze local evidence, write report")
|
|
71
|
+
print(" Limits : target-host transport policy; private/loopback destinations remain blocked by default")
|
|
72
|
+
proceed = _ask("Start this assessment? (y/N)", "n").lower()
|
|
73
|
+
if proceed not in {"y", "yes"}:
|
|
74
|
+
print("Assessment cancelled.")
|
|
75
|
+
return 0
|
|
76
|
+
|
|
77
|
+
args = ["go", target, "--yes"]
|
|
78
|
+
if profile == 1:
|
|
79
|
+
args.append("--no-probe")
|
|
80
|
+
return main(args, _show_banner=False)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _manual_mode(main) -> int | None:
|
|
84
|
+
print("\nMANUAL MODE")
|
|
85
|
+
print("Enter an existing JScope command without the leading 'jscope'.")
|
|
86
|
+
print("Examples: doctor | analyze ./project --verbose | graph findings.json | --help")
|
|
87
|
+
print("Commands run through JScope's normal parser; no shell commands are executed.")
|
|
88
|
+
last_status = 0
|
|
89
|
+
while True:
|
|
90
|
+
command = _ask("jscope>")
|
|
91
|
+
if not command:
|
|
92
|
+
continue
|
|
93
|
+
if command.lower() in {"back", "menu", "exit"}:
|
|
94
|
+
return None
|
|
95
|
+
try:
|
|
96
|
+
argv = shlex.split(command)
|
|
97
|
+
except ValueError as exc:
|
|
98
|
+
print(f"Could not parse command: {exc}")
|
|
99
|
+
continue
|
|
100
|
+
if argv and argv[0] == "jscope":
|
|
101
|
+
argv = argv[1:]
|
|
102
|
+
try:
|
|
103
|
+
last_status = main(argv, _show_banner=False)
|
|
104
|
+
except SystemExit as exc:
|
|
105
|
+
last_status = exc.code if isinstance(exc.code, int) else 0
|
|
106
|
+
if last_status:
|
|
107
|
+
print(f"Command exited with status {last_status}.")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jscope
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Evidence-based JavaScript intelligence for bug bounty hunters and web app pentesters
|
|
5
5
|
Author: Muhammed Ali
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/LIME1Star/
|
|
8
|
-
Project-URL: Issues, https://github.com/LIME1Star/
|
|
9
|
-
Project-URL: Changelog, https://github.com/LIME1Star/
|
|
7
|
+
Project-URL: Homepage, https://github.com/LIME1Star/Jscope
|
|
8
|
+
Project-URL: Issues, https://github.com/LIME1Star/Jscope/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/LIME1Star/Jscope/blob/main/CHANGELOG.md
|
|
10
10
|
Keywords: security,bug-bounty,pentest,javascript,static-analysis,appsec,recon
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Environment :: Console
|
|
@@ -37,7 +37,6 @@ Requires-Dist: build; extra == "dev"
|
|
|
37
37
|
Requires-Dist: twine; extra == "dev"
|
|
38
38
|
Dynamic: license-file
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
<p align="center">
|
|
42
41
|
<picture>
|
|
43
42
|
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.svg">
|
|
@@ -51,7 +50,7 @@ Dynamic: license-file
|
|
|
51
50
|
</p>
|
|
52
51
|
|
|
53
52
|
<p align="center">
|
|
54
|
-
<a href="https://github.com/LIME1Star/
|
|
53
|
+
<a href="https://github.com/LIME1Star/Jscope/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/LIME1Star/Jscope/actions/workflows/ci.yml/badge.svg"></a>
|
|
55
54
|
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
56
55
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green">
|
|
57
56
|
</p>
|
|
@@ -95,11 +94,20 @@ Try it yourself on the bundled fixture (`tests/sample_react`).
|
|
|
95
94
|
## Install
|
|
96
95
|
|
|
97
96
|
```bash
|
|
98
|
-
pip install
|
|
99
|
-
jscope
|
|
97
|
+
python -m pip install --upgrade jscope
|
|
98
|
+
jscope # opens the guided terminal wizard
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
JScope starts with a hawk identity banner and a guided mode selector. **Auto mode** walks through target, assessment profile, review and execution. **Manual mode** lets you run existing JScope commands from an interactive prompt. The original direct CLI remains available:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
jscope --help
|
|
105
|
+
jscope doctor
|
|
106
|
+
jscope analyze ./path/to/project --verbose
|
|
107
|
+
jscope https://app.example.com
|
|
100
108
|
```
|
|
101
109
|
|
|
102
|
-
Python 3.10+. For YAML OpenAPI specs: `pip install "jscope[yaml]
|
|
110
|
+
Python 3.10+. For YAML OpenAPI specs: `python -m pip install "jscope[yaml]"`. For development, clone the repository and install `python -m pip install -e ".[dev]"`. See [docs/RELEASING.md](docs/RELEASING.md) for GitHub and PyPI publishing.
|
|
103
111
|
|
|
104
112
|
## Quick start
|
|
105
113
|
|
|
@@ -166,7 +174,7 @@ JScope is a **beta development tool, not a production scanner.** Be aware of the
|
|
|
166
174
|
## Development
|
|
167
175
|
|
|
168
176
|
```bash
|
|
169
|
-
git clone https://github.com/LIME1Star/
|
|
177
|
+
git clone https://github.com/LIME1Star/Jscope && cd JScope
|
|
170
178
|
python -m venv .venv && . .venv/bin/activate
|
|
171
179
|
pip install -e ".[dev]"
|
|
172
180
|
pytest
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
|
+
setup.cfg
|
|
4
5
|
jscope/__init__.py
|
|
5
6
|
jscope/__main__.py
|
|
6
7
|
jscope/assessment_engine.py
|
|
@@ -10,6 +11,8 @@ jscope/config.py
|
|
|
10
11
|
jscope/passive_discovery.py
|
|
11
12
|
jscope/pipeline.py
|
|
12
13
|
jscope/security_transport.py
|
|
14
|
+
jscope/terminal.py
|
|
15
|
+
jscope/wizard.py
|
|
13
16
|
jscope.egg-info/PKG-INFO
|
|
14
17
|
jscope.egg-info/SOURCES.txt
|
|
15
18
|
jscope.egg-info/dependency_links.txt
|
|
@@ -38,9 +38,9 @@ browser = ["playwright>=1.40"]
|
|
|
38
38
|
dev = ["pytest>=7", "PyYAML>=6.0", "build", "twine"]
|
|
39
39
|
|
|
40
40
|
[project.urls]
|
|
41
|
-
Homepage = "https://github.com/LIME1Star/
|
|
42
|
-
Issues = "https://github.com/LIME1Star/
|
|
43
|
-
Changelog = "https://github.com/LIME1Star/
|
|
41
|
+
Homepage = "https://github.com/LIME1Star/Jscope"
|
|
42
|
+
Issues = "https://github.com/LIME1Star/Jscope/issues"
|
|
43
|
+
Changelog = "https://github.com/LIME1Star/Jscope/blob/main/CHANGELOG.md"
|
|
44
44
|
|
|
45
45
|
[project.scripts]
|
|
46
46
|
jscope = "jscope.cli:main"
|
|
@@ -128,14 +128,14 @@ def test_go_respects_out_and_format_overrides(tmp_path, monkeypatch):
|
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
# ------------------------------------------------------------------ go --confirm chains into the prober (dry-run only)
|
|
131
|
-
def
|
|
131
|
+
def test_go_confirm_without_active_test_authorization_refuses_to_send(tmp_path, monkeypatch, capsys):
|
|
132
132
|
monkeypatch.chdir(tmp_path)
|
|
133
133
|
srv = make_server()
|
|
134
134
|
try:
|
|
135
135
|
url = f"http://127.0.0.1:{srv.server_port}/"
|
|
136
136
|
rc = main(["go", url, "--yes", "--no-probe", "--confirm", "--allow-private"])
|
|
137
137
|
assert rc == 1 # confirm runs, but refuses to send without permission
|
|
138
|
-
assert "
|
|
138
|
+
assert "--authorize-active-tests" in capsys.readouterr().err
|
|
139
139
|
finally:
|
|
140
140
|
srv.shutdown()
|
|
141
141
|
|
|
@@ -255,3 +255,23 @@ def test_go_remote_loopback_blocked_by_default(tmp_path, monkeypatch, capsys):
|
|
|
255
255
|
assert "blocked by scope policy" in capsys.readouterr().err
|
|
256
256
|
finally:
|
|
257
257
|
srv.shutdown()
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def test_no_args_launches_wizard_and_can_exit(monkeypatch, capsys):
|
|
261
|
+
from jscope.cli import main
|
|
262
|
+
answers = iter(["3"])
|
|
263
|
+
monkeypatch.setattr("sys.stdin.isatty", lambda: True)
|
|
264
|
+
monkeypatch.setattr("sys.stderr.isatty", lambda: True)
|
|
265
|
+
monkeypatch.setattr("builtins.input", lambda *_: next(answers))
|
|
266
|
+
assert main([]) == 0
|
|
267
|
+
captured = capsys.readouterr()
|
|
268
|
+
assert "Choose a mode" in captured.out
|
|
269
|
+
assert "JScope closed" in captured.out
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def test_confirm_exposes_explicit_active_test_authorization():
|
|
273
|
+
parser = build_parser()
|
|
274
|
+
args = parser.parse_args(["confirm", "findings.json", "--base-url", "https://example.test", "--authorize-active-tests"])
|
|
275
|
+
assert args.authorize_active_tests is True
|
|
276
|
+
help_text = parser._subparsers._group_actions[0].choices["confirm"].format_help()
|
|
277
|
+
assert "--authorize-active-tests" in help_text
|
jscope-0.4.2/jscope/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|