# Payload Extensions

Payload extensions add a custom checkbox to the payload build menu via the [register\_payload\_extension](/crystalc2/documentation/sleep/functions.md#register_payload_extension) sleep function.  They are useful for merging evasion or other runtime capabilities into the agent, where you want the easy option of enabling/disabling them each time you build a new payload.  Capabilities that you always want merged are better off being put in the `agent.spec` file directly.

Your spec file must use the `ext` label, e.g. `ext.64` and/or `ext.x86`.  See the SOCKS extension as an example.

{% embed url="<https://github.com/crystal-c2/crystal-extensions/tree/master/socks>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rasta-mouse.gitbook.io/crystalc2/documentation/extensions/payload-extensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
