Quickstart¶
Three commands are enough to watch Phronesis pick a script from a demo XML file, with no network traffic.
Before you start
You need Python 3.10 or later (3.11 tested), PyTorch and the dependencies installed. If you haven't done that yet, follow the installation guide.
1. First offline run¶
Phronesis reads the facts the scan already knows, picks at most one script per port, or answers STOP, then prints the matching Nmap command. --top 8 limits the list of candidates sent to the model.
Nothing is executed
By default, the command only shows a suggestion. No NSE script is launched. --run actually runs the chosen scripts.
2. Analyze your own scan¶
The output gives the chosen script and an Nmap command ready to copy.
-oX - is required so that Nmap writes XML to standard output. phronesis prints one line per port.
3. Pick an output format¶
phronesis --xml scan.xml --format jsonl # un objet JSON par décision
phronesis --xml scan.xml --table # tableau lisible
phronesis --xml scan.xml --commands # commandes Nmap seules
These outputs let you plug Phronesis into an orchestration script.
4. See the full ranking¶
The default mode returns one action. suggest scores every candidate and shows the probabilities:
In text mode, each line gives the rank, the script and a probability conditional on the list you supplied. --explain adds the reasons when a template changed the score. --format jsonl adds the raw score and the calibrated field, which stays false until calibration on out-of-training contexts is done.
Going further
Suggestions and templates covers profiles, thresholds and custom rules. NSE library explains how to add your own scripts and update the database.
All use cases¶
| Case | Command | What it does |
|---|---|---|
| Existing XML | phronesis --xml scan.xml |
One decision per port |
| From a stored XML file | cat scan.xml then phronesis (pipe, see below) |
Reads XML from standard input |
| From Nmap | nmap -Pn -sV -oX - then phronesis (pipe) |
Chains the scan and the decision |
| Reconnaissance, then choice | phronesis 10.10.10.5 -p 80,443 |
Runs -sV, then suggests a script |
| Real execution | phronesis --xml scan.xml --run |
Runs the chosen scripts |
| Ranking | phronesis suggest --xml scan.xml --top-k 5 |
Scores candidates and shows probabilities |
| Exhaustive ranking | phronesis suggest --xml scan.xml --all-candidates |
Scores the whole pool, with no prefilter cap |
| Machine output | phronesis --xml scan.xml --format jsonl |
One JSON object per decision |
| Readable table | phronesis --xml scan.xml --table |
Column output |
| Commands only | phronesis --xml scan.xml --commands |
No decision, just the Nmap commands |
| Catalog | phronesis --catalog |
Lists the NSE library |
| Integrity | phronesis update-db --check |
Checks the local library |
| Simulated update | phronesis update-db --dry-run --source-dir D:\nse-scripts |
Prepares the update without writing |
| Custom scripts | phronesis --xml scan.xml --personal-dir .\mes-scripts |
Includes documented, safe scripts |
| Custom index | phronesis index --personal .\mes-scripts --output .\mes-scripts\catalog.jsonl |
Writes the catalog of your scripts |
| Templates | phronesis suggest --xml scan.xml --templates templates |
Applies your boost, exclusion and add rules |
| No templates | phronesis --xml scan.xml --no-templates |
Ignores all templates |
| Profile | phronesis --xml scan.xml --profile templates\example-profile.yaml |
Loads default values |
| Version | phronesis --version |
Prints the version |
The two pipe forms, exactly as you type them:
In PowerShell, Get-Content scan.xml | phronesis works too.
A few useful combinations:
# Les 5 meilleurs candidats, avec les raisons issues des templates
phronesis suggest --xml scan.xml --templates templates --top-k 5 --explain
# Tout le pool, en JSON, pour un script d'orchestration
phronesis suggest --xml scan.xml --all-candidates --format jsonl > decisions.jsonl
# Scripts persos, classement restreint aux scripts sûrs
phronesis suggest --xml scan.xml --personal-dir .\mes-scripts --top-k 3
# Mode une action, exécution comprise, sur une cible autorisée uniquement
phronesis 10.10.10.5 -p 80,443 --run
Real traffic
phronesis 10.10.10.5 and --run send traffic and run NSE scripts. The --xml, cat ... | phronesis and phronesis --catalog commands work offline, with no traffic.
Summary¶
| Command | Effect |
|---|---|
phronesis --xml scan.xml |
One decision per port, display only |
phronesis --xml scan.xml --run |
Runs the chosen scripts |
phronesis suggest --xml scan.xml --top-k 5 |
Candidate ranking with probabilities |
phronesis --catalog |
Lists the NSE library |
phronesis update-db --check |
Checks the integrity of the local library, without changing it |
Scope and authorization
Phronesis checks neither the target nor your authorization. --run and the direct scan send real traffic. Check the target, the command and the scope before running anything.