Skip to content

Back to the catalog

Artificial Intelligence (AI) in Cybersecurity, Part 30: Shannon – AI Pentester for Web Apps and APIs
hackers-arise.comarticle

Artificial Intelligence (AI) in Cybersecurity, Part 30: Shannon – AI Pentester for Web Apps and APIs

Shannon is a white-box AI pentester (@keygraph/shannon) that analyzes an application's source code, then attacks the running instance and reports only findings with a working PoC. The Hackers Arise tutorial runs it against OWASP Juice Shop in Docker on Kali, using OpenRouter (free Nemotron) and local Ollama (Qwen 2.5 Coder 7B) via a models.json file. Output includes PDF, Markdown, JSON and SARIF reports.

TL;DR Walkthrough of setting up the Shannon white-box AI pentester against Juice Shop with OpenRouter or Ollama models and producing PoC-validated reports.
Document

What it is

Shannon (@keygraph/shannon) is a white-box AI pentester run through npx. It needs two inputs: the application's source repository and a running instance of the same application. It analyses the code first, then attacks the live instance. Only findings with a working PoC reach the report. The page says this removes the model's need to guess at vulnerabilities, which varies by model.

Preconditions / Affected

  • Docker, Node.js and npm. The tutorial installs them on Kali with sudo apt install -y docker.io nodejs npm.
  • A local copy of the target source, here git clone --depth 1 https://github.com/juice-shop/juice-shop.git.
  • The target running in a container, here bkimminich/juice-shop on port 3000.
  • A model reachable through an OpenAI-compatible endpoint, described in a models.json file.
  • Authorization to test the target. The page says to test only systems you own or have written permission to test.

What to do

Shannon reads the model and key from environment variables. For OpenRouter's free Nemotron model:

export SHANNON_AI_API_KEY="sk-or-v1-YOUR_KEY"
export SHANNON_AI_MODEL="openrouter:nvidia/nemotron-3.5-lightning:free"
npx @keygraph/shannon@latest start -u http://172.17.0.1:3000 -r /home/kali/juice-shop --validate-model

For a local Ollama model (the page uses qwen2.5-coder:7b):

export SHANNON_AI_API_KEY=ollama
export SHANNON_AI_MODEL=ollama:qwen2.5-coder:7b
npx @keygraph/shannon@latest start -u http://172.17.0.1:3000 -r /home/kali/juice-shop -c ~/juice-quick.yaml --models-config ~/models.json --validate-model

After validation succeeds, run the full scan with --follow to stream the commands and prompts:

npx @keygraph/shannon@latest start -u http://172.17.0.1:3000 -r /home/kali/juice-shop -c ~/juice-quick.yaml --models-config ~/models.json --follow

Details that affect setup:

  • -u points at the Docker bridge address 172.17.0.1, not localhost.
  • -r is the path to the cloned source.
  • The Ollama models.json uses base URL http://127.0.0.1:11434/v1, API type openai-completions, context window 32768 and max tokens 8192.
  • The OpenRouter models.json uses https://openrouter.ai/api/v1, context window 262144 and max tokens 65536.
  • Both set supportsDeveloperRole to false.

Output is a PDF and a Markdown report with evidence attached, plus JSON and SARIF files for downstream systems such as CI or code-scanning tools.

Caveats

  • The page says the free OpenRouter daily token allowance will not be enough to finish a scan.
  • It says frontier models give better results. The 7B Qwen model is shown only as a demonstration, and the page reports no results from it.
  • The commands use -c ~/juice-quick.yaml, but the page never shows that file or its contents. The first OpenRouter validation command omits -c.
  • The page shows one example PDF with several findings, some rated High. It gives no counts, timings, costs or false-negative rates.
  • The author says the tool does not replace a human reviewer.

Organisations named here

  • Keygraph
  • Nemotron

Technologies named here

  • OWASP Juice Shop
  • Node.js and npm
  • git
  • Pentestcode
  • Shannon
  • OpenRouter
  • Ollama
  • Docker
  • Kali Linux
  • SARIF
  • Juice Shop

Techniques named here

  • White-box AI-driven penetration testing
  • PoC validation of findings
  • Model validation before scanning