> 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.md).

# Red Team

- [Red Team OPSEC](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-opsec.md): This page is just a collection of things I think should be done on a red team operation to hinder detection and response. Work in progress. Will be updated whenever I learn new tricks
- [Infrastructure](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-opsec/infrastructure.md)
- [Example Red Team Infra](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-opsec/infrastructure/example-red-team-infra.md)
- [Cobalt Strike Redirectors](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-opsec/infrastructure/cobalt-strike-redirectors.md): A redirector a day keeps IR away
- [Using SSH Tunneling to secure C2 infra](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-opsec/infrastructure/using-ssh-tunneling-to-secure-c2-infra.md): Pesky AV vendors keep scanning my stuff >:C
- [Red Team Dev](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev.md): red team related dev work that doesnt directly fall under malware dev
- [Extending Havoc C2](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2.md): Blog series where I try to explain the third party interfaces in @C5pider's Havoc C2
- [Third Party Agents](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-party-agents.md)
- [1: Understanding the interface](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-party-agents/1-understanding-the-interface.md)
- [2: Writing the agent](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-party-agents/2-writing-the-agent.md)
- [3: Writing the agent handler](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-party-agents/3-writing-the-agent-handler.md)
- [4: Testing the agent](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-party-agents/4-testing-the-agent.md)
- [Loader Dev](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev.md): CreateRemoteThread()
- [In Memory OPSEC](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/in-memory-opsec.md)
- [PE Structures](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/in-memory-opsec/pe-structures.md)
- [Memory Permissions and Allocation Types](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/in-memory-opsec/memory-permissions-and-allocation-types.md)
- [In Memory Signatures](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/in-memory-opsec/in-memory-signatures.md)
- [Evasion Adventures](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/evasion-adventures.md): Talk I gave on in memory evasion and memory OPSEC.
- [Sleep masking](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/sleep-masking.md): Because sometimes set sleep\_mask "true"; isnt enough
- [Mimikatz vs Windows Defender](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/mimikatz-vs-windows-defender.md): Ever wanted to drop Mimikatz to disk during an engagement? Probably not. Lets do it anyways!
- [Indirect syscalls](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/loader-dev/indirect-syscalls.md): Referenced from: https://www.cobaltstrike.com/blog/writing-beacon-object-files-flexible-stealthy-and-compatible/
- [Cobalt Strike](https://codex-7.gitbook.io/codexs-terminal-window/red-team/cobalt-strike.md): Fire teh lazer!
- [Building custom C2 channels by hooking wininet](https://codex-7.gitbook.io/codexs-terminal-window/red-team/cobalt-strike/building-custom-c2-channels-by-hooking-wininet.md): Because official specs sometimes (often) suck
- [Modifying the Sleep Mask Kit](https://codex-7.gitbook.io/codexs-terminal-window/red-team/cobalt-strike/modifying-the-sleep-mask-kit.md)
- [Discord Beacon Notifications](https://codex-7.gitbook.io/codexs-terminal-window/red-team/cobalt-strike/discord-beacon-notifications.md): :ping:
- [Evading Hunt-Sleeping-Beacons](https://codex-7.gitbook.io/codexs-terminal-window/red-team/cobalt-strike/evading-hunt-sleeping-beacons.md): Reference: https://github.com/thefLink/Hunt-Sleeping-Beacons
- [Beacon Object Files](https://codex-7.gitbook.io/codexs-terminal-window/red-team/cobalt-strike/beacon-object-files.md): No mor fork and run
- [Misc. Interesting Stuff](https://codex-7.gitbook.io/codexs-terminal-window/red-team/misc.-interesting-stuff.md): This is where I put stuff that I'm lazy to categorize


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://codex-7.gitbook.io/codexs-terminal-window/red-team.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
