jscope 0.4.3__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.3 → jscope-0.5.0}/PKG-INFO +18 -9
- {jscope-0.4.3 → jscope-0.5.0}/README.md +14 -5
- jscope-0.5.0/jscope/__init__.py +1 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/cli.py +18 -11
- {jscope-0.4.3 → jscope-0.5.0}/jscope/terminal.py +26 -4
- jscope-0.5.0/jscope/wizard.py +107 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope.egg-info/PKG-INFO +18 -9
- {jscope-0.4.3 → jscope-0.5.0}/jscope.egg-info/SOURCES.txt +2 -0
- {jscope-0.4.3 → jscope-0.5.0}/pyproject.toml +3 -3
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_cli_entry.py +22 -2
- jscope-0.4.3/jscope/__init__.py +0 -1
- {jscope-0.4.3 → jscope-0.5.0}/LICENSE +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/__main__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/ai/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/ai/explain.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/ai/providers.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/auth_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/authorization_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/base.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/common.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/dataflow_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/endpoint_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/framework_detector.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/graphql_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/graphql_schema_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/html_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/manager.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/openapi_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/router_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/secret_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/service_worker_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/source_map_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/storage_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/analyzers/wasm_analyzer.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/assessment_engine.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/assessment_reporting.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/benchmark/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/benchmark/fixtures.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/benchmark/runner.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/config.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/artifacts.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/cache.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/classification.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/evidence.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/graph.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/core/redact.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/crawler/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/crawler/crawler.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/dataflow/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/dataflow/engine.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/dataflow/modules.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/dataflow/rules.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/downloader/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/downloader/downloader.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/parsing/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/parsing/ast_engine.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/parsing/graphql_schema.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/parsing/html.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/parsing/queries.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/parsing/wasm.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/passive_discovery.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/pipeline.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/plugin/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/plugin/_worker.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/plugin/loader.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/plugin/sandbox.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/reporting/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/reporting/formats.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/reporting/human.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/reporting/json_report.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/reporting/priority.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/runtime/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/runtime/observe.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/runtime/prober.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/runtime/scope.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/security_transport.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/verify/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/verify/engine.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/workspace/__init__.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/workspace/assessment.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/workspace/common.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/workspace/diff.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope/workspace/store.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope.egg-info/dependency_links.txt +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope.egg-info/entry_points.txt +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope.egg-info/requires.txt +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/jscope.egg-info/top_level.txt +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/setup.cfg +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_analyzers.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_assessment_scope.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_ast_engine.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_benchmark.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_dataflow.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_engine_hardening_and_plugins.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_evidence_engine.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_graph_correlation.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_incremental.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_live_local.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_observe.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_path_independence.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_phase2_analyzers.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_phase2_scope_transport.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_phase3.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_phase4.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_phases345_hardening.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_plugin_isolation.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_router.py +0 -0
- {jscope-0.4.3 → jscope-0.5.0}/tests/test_scope.py +0 -0
- {jscope-0.4.3 → 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/
|
|
8
|
-
Project-URL: Issues, https://github.com/
|
|
9
|
-
Project-URL: Changelog, https://github.com/
|
|
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
|
|
@@ -50,7 +50,7 @@ Dynamic: license-file
|
|
|
50
50
|
</p>
|
|
51
51
|
|
|
52
52
|
<p align="center">
|
|
53
|
-
<a href="https://github.com/
|
|
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>
|
|
54
54
|
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
55
55
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green">
|
|
56
56
|
</p>
|
|
@@ -94,11 +94,20 @@ Try it yourself on the bundled fixture (`tests/sample_react`).
|
|
|
94
94
|
## Install
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
pip install
|
|
98
|
-
jscope
|
|
97
|
+
python -m pip install --upgrade jscope
|
|
98
|
+
jscope # opens the guided terminal wizard
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
|
|
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
|
|
108
|
+
```
|
|
109
|
+
|
|
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.
|
|
102
111
|
|
|
103
112
|
## Quick start
|
|
104
113
|
|
|
@@ -165,7 +174,7 @@ JScope is a **beta development tool, not a production scanner.** Be aware of the
|
|
|
165
174
|
## Development
|
|
166
175
|
|
|
167
176
|
```bash
|
|
168
|
-
git clone https://github.com/
|
|
177
|
+
git clone https://github.com/LIME1Star/Jscope && cd JScope
|
|
169
178
|
python -m venv .venv && . .venv/bin/activate
|
|
170
179
|
pip install -e ".[dev]"
|
|
171
180
|
pytest
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<a href="https://github.com/
|
|
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>
|
|
15
15
|
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
16
16
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green">
|
|
17
17
|
</p>
|
|
@@ -55,11 +55,20 @@ Try it yourself on the bundled fixture (`tests/sample_react`).
|
|
|
55
55
|
## Install
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
pip install
|
|
59
|
-
jscope
|
|
58
|
+
python -m pip install --upgrade jscope
|
|
59
|
+
jscope # opens the guided terminal wizard
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
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
|
|
69
|
+
```
|
|
70
|
+
|
|
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.
|
|
63
72
|
|
|
64
73
|
## Quick start
|
|
65
74
|
|
|
@@ -126,7 +135,7 @@ JScope is a **beta development tool, not a production scanner.** Be aware of the
|
|
|
126
135
|
## Development
|
|
127
136
|
|
|
128
137
|
```bash
|
|
129
|
-
git clone https://github.com/
|
|
138
|
+
git clone https://github.com/LIME1Star/Jscope && cd JScope
|
|
130
139
|
python -m venv .venv && . .venv/bin/activate
|
|
131
140
|
pip install -e ".[dev]"
|
|
132
141
|
pytest
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.0"
|
|
@@ -32,8 +32,6 @@ def _emit(text: str, output: str | None) -> None:
|
|
|
32
32
|
|
|
33
33
|
def _run_analysis(paths, config, label: str = "Inspecting JavaScript and related source files"):
|
|
34
34
|
"""Run the existing engine with JScope's terminal activity treatment."""
|
|
35
|
-
if sys.stderr.isatty():
|
|
36
|
-
terminal.banner()
|
|
37
35
|
with terminal.activity(label):
|
|
38
36
|
return run_analysis(paths, config)
|
|
39
37
|
|
|
@@ -237,7 +235,7 @@ def cmd_go(args: argparse.Namespace) -> int:
|
|
|
237
235
|
if headers is None:
|
|
238
236
|
return 1
|
|
239
237
|
rc, updated = _confirm_core(payload, url, args.allow_host or [host], args.rate, args.max_requests,
|
|
240
|
-
headers, config, dry_run=False,
|
|
238
|
+
headers, config, dry_run=False, authorize_active_tests=args.authorize_active_tests)
|
|
241
239
|
if rc == 0 and updated:
|
|
242
240
|
with open(findings_path, "w") as f:
|
|
243
241
|
json.dump(updated, f, indent=2)
|
|
@@ -806,7 +804,7 @@ def cmd_report(args: argparse.Namespace) -> int:
|
|
|
806
804
|
|
|
807
805
|
|
|
808
806
|
def _confirm_core(data: dict, base_url: str, allow_hosts: list[str], rate: float | None, max_requests: int | None,
|
|
809
|
-
headers: dict, config: Config, dry_run: bool,
|
|
807
|
+
headers: dict, config: Config, dry_run: bool, authorize_active_tests: bool) -> tuple[int, dict | None]:
|
|
810
808
|
"""Shared by `jscope confirm` and `jscope go --confirm`. Returns (exit_code, updated_payload_or_None)."""
|
|
811
809
|
from jscope.runtime.prober import Prober, ScopeError, apply_results
|
|
812
810
|
findings = [finding_from_dict(m) for m in data["findings"]]
|
|
@@ -825,8 +823,8 @@ def _confirm_core(data: dict, base_url: str, allow_hosts: list[str], rate: float
|
|
|
825
823
|
if dry_run:
|
|
826
824
|
print("[dry run: nothing was sent]", file=sys.stderr)
|
|
827
825
|
return 0, None
|
|
828
|
-
if not
|
|
829
|
-
print("error: refusing to send requests without --
|
|
826
|
+
if not authorize_active_tests:
|
|
827
|
+
print("error: refusing to send requests without --authorize-active-tests. "
|
|
830
828
|
"Use --dry-run to review the plan first.", file=sys.stderr)
|
|
831
829
|
return 1, None
|
|
832
830
|
_, results = prober.run(findings)
|
|
@@ -988,7 +986,7 @@ def cmd_confirm(args: argparse.Namespace) -> int:
|
|
|
988
986
|
if headers is None:
|
|
989
987
|
return 1
|
|
990
988
|
rc, updated = _confirm_core(data, args.base_url, args.allow_host or [], args.rate, args.max_requests,
|
|
991
|
-
headers, config, args.dry_run, args.
|
|
989
|
+
headers, config, args.dry_run, args.authorize_active_tests)
|
|
992
990
|
if rc == 0 and updated and args.out:
|
|
993
991
|
with open(args.out, "w") as fh:
|
|
994
992
|
json.dump(updated, fh, indent=2)
|
|
@@ -1031,9 +1029,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1031
1029
|
pg2.add_argument("--allow-private", action="store_true", help="permit loopback/private destinations (controlled local testing only)")
|
|
1032
1030
|
pg2.add_argument("--no-probe", action="store_true", help="skip well-known OpenAPI/GraphQL spec paths (remote targets only)")
|
|
1033
1031
|
pg2.add_argument("-y", "--yes", action="store_true", help="skip the target-confirmation prompt (required in non-interactive sessions)")
|
|
1034
|
-
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)")
|
|
1035
1033
|
pg2.add_argument("--allow-host", action="append", help="host(s) allowed for --confirm (default: the target's own host)")
|
|
1036
|
-
pg2.add_argument("--
|
|
1034
|
+
pg2.add_argument("--authorize-active-tests", action="store_true", help="explicitly authorize the opt-in confirmation requests")
|
|
1037
1035
|
pg2.add_argument("--header", action="append", help="extra header for --confirm, e.g. 'Cookie: session=...'")
|
|
1038
1036
|
pg2.add_argument("--rate", type=float, default=None)
|
|
1039
1037
|
pg2.add_argument("--max-requests", type=int, default=None)
|
|
@@ -1111,7 +1109,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1111
1109
|
pk.add_argument("findings_file", help="saved with `jscope analyze --save-findings`")
|
|
1112
1110
|
pk.add_argument("--base-url", required=True, help="origin to test, e.g. https://app.example.com")
|
|
1113
1111
|
pk.add_argument("--allow-host", action="append", help="host[:port] you are authorized to test (repeatable, required)")
|
|
1114
|
-
pk.add_argument("--
|
|
1112
|
+
pk.add_argument("--authorize-active-tests", action="store_true", help="explicitly authorize the planned confirmation requests")
|
|
1115
1113
|
pk.add_argument("--dry-run", action="store_true", help="print the request plan and send nothing")
|
|
1116
1114
|
pk.add_argument("--header", action="append", help="extra request header 'Name: value' (e.g. a session cookie you own)")
|
|
1117
1115
|
pk.add_argument("--rate", type=float, default=None, help="requests per second (default 2)")
|
|
@@ -1238,8 +1236,17 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
1238
1236
|
return p
|
|
1239
1237
|
|
|
1240
1238
|
|
|
1241
|
-
def main(argv: list[str] | None = None) -> int:
|
|
1239
|
+
def main(argv: list[str] | None = None, *, _show_banner: bool = True) -> int:
|
|
1242
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"]
|
|
1243
1250
|
argv = _rewrite_bare_target(argv)
|
|
1244
1251
|
parser = build_parser()
|
|
1245
1252
|
args = parser.parse_args(argv)
|
|
@@ -39,12 +39,34 @@ def feather() -> str:
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def banner() -> None:
|
|
42
|
-
"""Print the
|
|
42
|
+
"""Print the JScope hawk identity on interactive terminal startup."""
|
|
43
43
|
enabled = _color_enabled(sys.stderr)
|
|
44
|
-
|
|
44
|
+
hawk = r"""⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⢀⠀⠀⠀⣰⡇⢀⡄⠀⠀⠀
|
|
45
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡄⠀⣿⣰⡀⢠⣿⣇⣾⡇⠀⠀⠀
|
|
46
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣰⣿⣿⢇⣾⣿⣼⣿⢃⡞⠀⠀
|
|
47
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⢋⣾⣿⣿⣿⣯⣿⠇⠀⠀
|
|
48
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⢟⣵⣿⣿⣿⣿⣿⣿⣯⡞⠀⠀
|
|
49
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣵⣿⣿⣿⣿⣿⣿⣿⣿⡿⡁⠀⠀
|
|
50
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣦⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀
|
|
51
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀
|
|
52
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⡡⠀⠀⠀
|
|
53
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀
|
|
54
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀
|
|
55
|
+
⠀⠀⢀⣀⣄⣀⡀⡀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡥⠀⠀⠀⠀⠀⠀
|
|
56
|
+
⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀
|
|
57
|
+
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀
|
|
58
|
+
⠘⣿⠋⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
59
|
+
⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣀⡀⠀⠀⠀⠀
|
|
60
|
+
⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⡛⠃⠀⠀
|
|
61
|
+
⠀⠀⠀⠀⠀⠀⢈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀
|
|
62
|
+
⠀⠀⠀⠀⠀⢰⣾⣿⣿⣿⣿⣿⠟⠁⠉⠙⠻⠯⡛⠿⠛⠻⠿⠟⠛⠓⠀⠀
|
|
63
|
+
⠀⠜⡿⠳⡶⠻⣿⣿⣿⣿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
64
|
+
⠀⠀⣠⣽⣧⣾⠛⠉⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
65
|
+
⠀⠀⠉⠟⠁⠘⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"""
|
|
45
66
|
name = _paint("JSCOPE", _Style.WHITE + _Style.BOLD, enabled)
|
|
46
|
-
tagline = _paint("JavaScript Intelligence", _Style.DIM, enabled)
|
|
47
|
-
|
|
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)
|
|
48
70
|
|
|
49
71
|
|
|
50
72
|
@contextmanager
|
|
@@ -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/
|
|
8
|
-
Project-URL: Issues, https://github.com/
|
|
9
|
-
Project-URL: Changelog, https://github.com/
|
|
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
|
|
@@ -50,7 +50,7 @@ Dynamic: license-file
|
|
|
50
50
|
</p>
|
|
51
51
|
|
|
52
52
|
<p align="center">
|
|
53
|
-
<a href="https://github.com/
|
|
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>
|
|
54
54
|
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
55
55
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green">
|
|
56
56
|
</p>
|
|
@@ -94,11 +94,20 @@ Try it yourself on the bundled fixture (`tests/sample_react`).
|
|
|
94
94
|
## Install
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
pip install
|
|
98
|
-
jscope
|
|
97
|
+
python -m pip install --upgrade jscope
|
|
98
|
+
jscope # opens the guided terminal wizard
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
|
|
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
|
|
108
|
+
```
|
|
109
|
+
|
|
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.
|
|
102
111
|
|
|
103
112
|
## Quick start
|
|
104
113
|
|
|
@@ -165,7 +174,7 @@ JScope is a **beta development tool, not a production scanner.** Be aware of the
|
|
|
165
174
|
## Development
|
|
166
175
|
|
|
167
176
|
```bash
|
|
168
|
-
git clone https://github.com/
|
|
177
|
+
git clone https://github.com/LIME1Star/Jscope && cd JScope
|
|
169
178
|
python -m venv .venv && . .venv/bin/activate
|
|
170
179
|
pip install -e ".[dev]"
|
|
171
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
|
|
@@ -11,6 +12,7 @@ jscope/passive_discovery.py
|
|
|
11
12
|
jscope/pipeline.py
|
|
12
13
|
jscope/security_transport.py
|
|
13
14
|
jscope/terminal.py
|
|
15
|
+
jscope/wizard.py
|
|
14
16
|
jscope.egg-info/PKG-INFO
|
|
15
17
|
jscope.egg-info/SOURCES.txt
|
|
16
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/
|
|
42
|
-
Issues = "https://github.com/
|
|
43
|
-
Changelog = "https://github.com/
|
|
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.3/jscope/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.3"
|
|
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
|