Metadata-Version: 2.4
Name: parallax-grid
Version: 1.0.1
Summary: PARALLAX // an offline systems, adversary-simulation and defence console
Author: kredt
License: MIT
Project-URL: Homepage, https://example.invalid/parallax
Project-URL: Documentation, https://example.invalid/parallax/docs
Keywords: terminal,tui,cybersecurity,simulation,offline,training,recon,blue-team,red-team,ctf,soc
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Terminals
Classifier: Topic :: Education
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Dynamic: license-file

# PARALLAX

**Offline systems, adversary-simulation and defence console.**
Codename `GLASS HORIZON` · version `1.0.1` · command `parallax` / `prx`.

```text
╔══════════════════════════════════════════════════════════════════╗
║  P A R A L L A X                                                 ║
║  offline systems · adversary simulation · defence                ║
║  v1.0.1 · GLASS HORIZON · simulation build                       ║
╚══════════════════════════════════════════════════════════════════╝
```

PARALLAX is a self-contained terminal console for practising the full shape of
security work: enumeration, crypto, OSINT, adversary simulation, detection
engineering, cloud and Kubernetes review, incident response, reporting and
programming. It generates a deterministic synthetic universe and realistic
synthetic evidence locally, then gives you the tooling to investigate it.

It is **not** a parody and **not** a live attack tool. It opens no sockets,
resolves no names, installs no dependencies and sends nothing anywhere. Every
host, person, credential, packet and log line is synthetic.

```text
$ prx
prx operator@parallax:/ › scope accept --engagement training --authorisation SELF
prx operator@parallax:/ › mission next
prx operator@parallax:/ › grid
prx operator@parallax:/ › scan org-01 --fast
prx operator@parallax:/ › logs gen --org org-01 --scenario credential-access
prx operator@parallax:/ › logs analyze
prx operator@parallax:/ › report --write
```

---

## Quick start

```bash
# from this directory
python3 -m pip install .

# both entry points are installed
parallax
# or
prx
```

Requires **Python 3.10+**. There are no runtime dependencies — the standard
library is sufficient. A normal wheel build works offline:

```bash
python3 -m pip wheel . --no-deps --no-build-isolation -w dist
python3 -m pip install --no-index dist/parallax_grid-1.0.1-py3-none-any.whl
```

`--no-build-isolation` uses the setuptools and wheel already present, so the
build itself needs no package index. Installing from the wheel needs no network
either.

Run one command without entering the shell:

```bash
parallax version
parallax help --all
parallax scan grid --fast
parallax mission next
parallax selftest
```

Run a workspace script:

```bash
parallax --script /scripts/recon.prx
parallax --script /scripts/recon.prx --stop-on-error
```

Useful flags:

| flag | meaning |
| --- | --- |
| `--home DIR` | data directory (default `$PARALLAX_HOME` or `~/.local/share/parallax`) |
| `--seed N` | override the universe seed for this run |
| `--theme NAME` | `graphite`, `amber`, `phosphor`, `ice`, `violet`, `mono` |
| `--ascii` | ASCII glyphs only |
| `--no-color` | disable ANSI colour |
| `--no-boot` | skip the boot banner |
| `--script PATH` | execute a `.prx` workspace script |
| `--stop-on-error` | stop a script at the first error |

---

## What is inside

**190 commands in ten categories.** Run `help --all` for the index, or
`help <command>` for usage and examples.

| category | examples | what it covers |
| --- | --- | --- |
| `system` | `help`, `scope`, `profile`, `theme`, `selftest` | session, configuration, integrity checks |
| `files` | `ls`, `cat`, `grep`, `sed`, `diff`, `hexdump` | sandboxed workspace inspection |
| `crypto` | `hash`, `b64`, `jwt`, `totp`, `crack`, `secretbox`, `pqc` | hashing, encodings, tokens, ciphers, PQC migration |
| `network` | `grid`, `org`, `scan`, `dns`, `http`, `tls`, `pcap` | the simulated estate and its protocols |
| `recon` | `osint`, `employees`, `leaks`, `dorks`, `graph`, `timeline` | attack-surface mapping and OSINT discipline |
| `adversary` | `exploit`, `shell`, `campaign`, `phish`, `c2`, `privesc` | safe range work, ATT&CK and technique depth |
| `defence` | `logs`, `siem`, `sigma`, `yara`, `cloud`, `k8s`, `incident` | detection engineering and defensive review |
| `code` | `py`, `forge`, `sql`, `regex`, `bf`, `jq` | programming and data work inside the console |
| `missions` | `mission` | procedural career with verifiable tokens |
| `ops` | `dash`, `watch`, `report`, `notes`, `journal`, `artifacts` | dashboards, evidence and reporting |

### The grid

Ten synthetic organisations, roughly 90–100 hosts, services, certificates, DNS
zones, web content and vulnerability exposures. Addresses are drawn only from
RFC 5737 documentation ranges and `10.42.0.0/16`; names only from `.example`,
`.test` and `.internal` (RFC 2606).

```bash
grid                       # estate overview
org helios                 # organisation profile
scan helios --fast         # ports and services
host 192.0.2.21            # fingerprint and exposure
vuln --severity critical   # exposure register
http get <ip> /            # simulated web response
tls <ip>                   # certificate and protocol review
dns <domain> TXT           # zone records
traceroute <ip>            # synthetic path
pcap gen /labs/beacon.pcap --scenario beacon
pcap hunt /labs/beacon.pcap
```

The universe is a pure function of the session seed. The same seed always
produces the same organisations, hosts, exposures and mission pool, which is
what makes findings reproducible and reports meaningful.

### Missions

Missions are procedural objectives with a hidden `PRX{...}` token planted in
the artefact the brief names. The engine generates web, DNS, crypto, range,
hunt, detection, Forge, cloud, Kubernetes and reporting missions.

```bash
mission next
mission brief
mission hint
mission submit 'PRX{...}'
mission daily --accept
mission generate --kind crypto --difficulty hard
mission career
```

Hints reveal progressively. Tokens are case-sensitive and cannot be recovered
from `mission list --json`; the JSON view strips the answer. Progress, rank,
XP and streak persist in the local state file.

### Blue team and detection

```bash
logs gen --org org-01 --scenario credential-access
logs list
logs analyze
siem query 'eventName=ConsoleLogin AND errorCode!=*' --file /logs/cloudtrail.json
sigma --technique T1110
yara --string 'powershell -enc'
forensics timeline --file /logs/auth.log
incident new --title 'Suspicious sign-in'
playbook ransomware
```

Generated corpora include authentication logs, web access logs, CloudTrail-style
events, DNS and proxy records. The analyser and mini-SIEM are heuristic and
documented as such: absence of a finding is not evidence of absence.

### Crypto and post-quantum migration

```bash
hash sha256 /README.md
hashid 5f4dcc3b5aa765d61d8327deb882cf99
b64 encode 'text'          # encode / decode
jwt decode <token>         # inspect, never trust
totp --secret JBSWY3DPEHPK3PXP
passgen 24
passaudit --file /wordlists/top-passwords.txt
crack --hash <digest> --wordlist /wordlists/top-passwords.txt
secretbox seal --text 'evidence' --passphrase 'correct horse'
pqc checklist
agility --file /data/crypto-inventory.json
```

### Programming inside the console

All of these are offline and write only inside the workspace.

```bash
py                                     # interactive Python sandbox
py -c 'for h in hosts()[:5]: print(h.ip, h.hostname)'
py /scripts/asset-report.py
forge run /scripts/hello.fx             # Forge stack machine
forge run /scripts/count.fx --trace
forge --code 'PUSH 2; PUSH 8; POW; PRINT; HALT'
forge opcodes
sql "select org_name, count(*) n from hosts group by 1 order by n desc"
sql "select hostname, port, product from services where port = 443" --json
sql --load /data/assets.json --tables
regex 'PRX\{[^}]+\}' --file /reports/latest.md
bf /scripts/fizzbuzz.bf
jq /data/assets.json .assets[0].host
```

`py` exposes `read`, `write`, `listdir`, `hosts()`, `orgs()`, `find_host()`,
`mission`, `seed` and `rng`, plus a curated set of standard-library modules.
It is a convenience sandbox, not a security boundary. Do not run untrusted code.

---

## Pipelines, redirection and scripts

The shell supports `|`, `>`, `>>`, quoting, `;` sequencing, aliases, history,
`!!`, environment variables and workspace scripts.

```bash
scan grid --fast | grep 443
vuln --severity critical | wc -l
report --write > /notes/report-path.txt
alias crit='vuln --severity critical --limit 10'
crit | head -n 5
script /scripts/recon.prx
```

`export KEY=value` stores session variables; `env` masks values that look
secret unless `--show` is passed. `history search scan` finds old work.

Scripts are plain text, one command per line, comments with `#`:

```text
scope accept
grid
org helios
scan helios --fast
hosts
vuln --severity high
report --write
```

---

## Workspace and content packs

Everything persistent lives under one directory:

```text
$PARALLAX_HOME/                 # default ~/.local/share/parallax
├── state.json                  # profile, seed, missions, findings, notes
├── workspace/                  # the sandboxed VFS seen as /
│   ├── scripts/ cloud/ k8s/ data/ logs/ labs/ wordlists/ ...
├── exports/                    # optional copies of exported artefacts
└── plugins/                    # reserved for local extensions
```

Path traversal and symlink escapes are refused by the VFS resolver. `reset
workspace --yes` re-seeds the sandbox; `reset career --yes` clears progress.
Back up `/reports` and `/notes` before resetting.

External material can be brought in without a network. Drop Markdown, JSON or
text into `/contentpacks` in the workspace (or the folder on disk) and run:

```bash
pack list
pack import vendor-notes
```

The import is a local file copy plus a manifest in `/library`. Nothing is
fetched.

---

## Security model

- **No network.** The code contains no socket, DNS, HTTP-client or subprocess
  call. `doctor` and `selftest` verify the installed runtime; `selftest` runs in
  a temporary home and leaves no state behind.
- **Documentation space only.** TEST-NET-1/2/3 (`192.0.2.0/24`,
  `198.51.100.0/24`, `203.0.113.0/24`), `10.42.0.0/16`, and RFC 2606 names.
- **Sandboxed writes.** The workspace resolver refuses `..` and symlink escapes.
- **Explicit scope gate.** Range and exploitation commands require
  `scope accept`; the acknowledgement is local and grants no real authority.
- **Technique depth for defence.** Adversary commands describe tradecraft at the
  level required to detect and defend against it, and execute only inside the
  simulation.
- **Synthetic people and data.** Names, breaches and credentials are generated;
  they are not real people or live secrets.

`scope` is a discipline tool, not a legal contract. Real work needs written
authorisation, a signed scope, a window, data-handling rules and an escalation
path. See `ethics` and `/scope/authorization.md`.

### Known limitations

- The Python sandbox is curated, not isolated. A determined user can escape a
  same-process Python namespace; the console trusts its operator.
- Log analysis and packet heuristics are intentionally simple and explainable.
- Data corpora are training snapshots, not live advisory feeds. Verify against
  NVD, the vendor advisory, CISA KEV and MITRE ATT&CK before acting.
- Determinism covers the universe and mission generation; clock, history and
  operator input naturally vary between sessions.

---

## Development

```bash
# run from the source tree without installing
PYTHONPATH=src python3 -m parallax --no-color --no-boot selftest

# unit tests (stdlib unittest; pytest is not required)
PYTHONPATH=src python3 -m unittest discover -s tests -v

# build
python3 -m pip wheel . --no-deps --no-build-isolation -w dist
```

Project layout:

```text
pyproject.toml
src/parallax/
├── cli.py shell.py registry.py parser.py theme.py tui.py
├── constants.py util.py storage.py vfs.py
├── data/          advisories.py mitre.py llmsec.py
├── sim/           universe.py session.py
├── engines/       missions.py logs.py packets.py
└── commands/      system, files, crypto, network, recon,
                   adversary, defence, code, missions, ops
docs/              COMMANDS.md ARCHITECTURE.md
tests/             unittest suite
```

Read `docs/ARCHITECTURE.md` before adding a command, engine or data source.
The short version: register with `@command(name, category, summary)`, use
`ctx.parse`, return a string, raise `CommandError(message, hint)` for user
errors, and keep all I/O inside `ctx.vfs`.

---

## License and notice

MIT. See `LICENSE`.

Every network, host, person, credential, log and vulnerability in this software
is synthetic. PARALLAX is not a live scanning or exploitation tool. Do not
repurpose it as one. Use the same authorisation discipline on real systems that
the console enforces on its own range.
