Help PhishTrainer Reports
Send PhishTrainer data to your tools with webhooks
What a webhook is for
A webhook is a web address (URL) of your application to which PhishTrainer sends data as your campaigns run, for example to feed a SIEM, a ticketing tool or a team channel.
Create a webhook
The webhook is created under Settings › Webhooks, with a name of at least 5 characters. Give the full address of the receiving application, using https://, for example https://siem.your-domain.com/phishtrainer.
The Secret is optional, but without it deliveries are not signed and your application cannot check that they come from PhishTrainer. Enter a long random string known only to PhishTrainer and your application.
Only webhooks with Is active ? turned on receive data: check it before saving.
To pause deliveries without losing the configuration, turn off Is active ? rather than deleting the webhook: deletion cannot be undone.
Delivery format
Each delivery is an HTTP POST request whose body is a JSON document. Your application must answer with an HTTP code below 400: a code of 400 or more, or no answer within 10 seconds, counts as a failure. Redirects are not followed. Headers sent:
Check the signature
When a secret is set, PhishTrainer adds the X-Gophish-Signature header, in the form sha256= followed by a hexadecimal signature. This signature is the HMAC-SHA256 of the raw request body, computed with the secret as key. To check a delivery, your application computes this HMAC over the body as received, before any JSON decoding, and compares it with the header value. Reject any request without the header or with a different signature.
hash_equals in PHP, hmac.compare_digest in Python) and never log the secret.Troubleshooting
| Message or symptom | What to do |
|---|---|
| Webhook: no data received | Check that Is active ? is on, that the URL can be reached from the internet and that your application answers with a code below 400 within 10 seconds, without redirect. |
Didn’t find the answer? Contact us