> For the complete documentation index, see [llms.txt](https://codex-7.gitbook.io/codexs-terminal-window/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-party-agents/4-testing-the-agent.md).

# 4: Testing the agent

First, start up a Havoc teamserver and start a HTTP listener This is what our custom agent will be calling back to.

<figure><img src="/files/jZ6VQagFgrZYO3465Kka" alt=""><figcaption><p>Listener started</p></figcaption></figure>

Then we run the python handler to register our custom agent. Do take note of the service credentials for the Havoc service. For this post I have left it as default, but if you have changed it you need to change it in your script accordingly.

<figure><img src="/files/A9754W2TjnQz23BoiOfv" alt=""><figcaption><p>Handler started</p></figcaption></figure>

Now we can run our agent and we should have a callback.

<figure><img src="/files/NfjljvNDCrikOOlxKDOj" alt=""><figcaption><p>We have a callback!</p></figcaption></figure>

We can try running commands such as shell {commandhere} and exit to test that they work.

<figure><img src="/files/fXKmza2T4N55jKFelIf0" alt=""><figcaption><p>Agent works!</p></figcaption></figure>

We have successfully created a third party agent and integrated it into Havoc C2!
