# Out-of-band callbacks

Some vulnerabilities never show in the answer. A server with a blind SSRF
fetches the URL you gave it but returns nothing about it; an XML parser
with external entities, or a command injected into a background job,
behaves the same. The proof is that the target calls somewhere else. For
that, Phantom hands out callback URLs on its own public address and
records every HTTP request that reaches one.

## Turn it on

Targets must be able to reach Phantom, so callbacks need a public
address that forwards to your workstation: a tunnel, or a small relay
you control. Set `PHANTOM_OOB_URL` to it and restart, for example
`PHANTOM_OOB_URL=https://callbacks.example.com`.

Callbacks arrive at `{PHANTOM_OOB_URL}/api/v1/oob/{token}`. This path
needs no sign-in: the target's server calls it. Without the variable, the
OOB tool says how to set it, and scans skip signatures that need a
callback (the scan log names them).

## In scans

A signature that contains `{{interactsh-url}}` gets one callback URL for
its run, without the scheme, as Nuclei templates expect
(`http://{{interactsh-url}}`). After its requests, Phantom waits up to
five seconds for a callback, then matches the `interactsh_protocol` part
(`http`) and the `interactsh_request` part (the requests that arrived,
as text). The finding records where the callbacks came from.

The built-in **Blind Server-Side Request Forgery (out-of-band)** signature
(`blind-ssrf-oob`) uses this: it puts the URL in common URL-taking
parameters and reports SSRF when the target calls back.

## By hand

**Proxy › OOB** makes a URL on demand (with an optional label) and copies
it. Put it anywhere a request can carry it: a parameter, a header, a JSON
field, an XML entity. Choose a URL to see the requests that reached it,
newest last, with method, path and query, headers, body and the source
address; the list refreshes every few seconds. Right-click a URL (or use
⋯) to show its requests, copy it, or forget it (Del).

## Limits

- Only HTTP callbacks are recorded. DNS-only callbacks (a name that is
  resolved but never fetched) need a DNS zone delegated to Phantom, which
  is not built.
- Callbacks are kept in memory for three hours and are gone after a
  restart: at most 5,000 URLs, 50 requests each, and the first 8 KiB of
  each body.
- Requests to URLs Phantom did not hand out are answered the same way and
  not kept, so the public path cannot be used to fill the store or to
  learn which URLs exist.
- Managing URLs is for you only; agents see callbacks through the
  findings scans make.

## API

| Method | Path | Does |
| --- | --- | --- |
| `GET` | `/api/v1/oob-status` | Whether callbacks are on, and the address |
| `POST` | `/api/v1/oob-tokens` | A new URL (`label` optional) |
| `GET` | `/api/v1/oob-tokens` | Open URLs, newest first, with how many requests reached each |
| `GET` | `/api/v1/oob-tokens/{token}` | One URL and every request that reached it |
| `DELETE` | `/api/v1/oob-tokens/{token}` | Forget a URL |
| any | `/api/v1/oob/{token}[/…]` | The public callback endpoint |

Code: `backend/app/core/oob.py` (the store),
`backend/app/api/v1/oob.py`, `backend/app/core/scanners/signature_scanner.py`
(signatures), `frontend/src/components/proxy/oob/`.
