# b3tt3rlynx/thefatrat_v2 architecture

> Architecture diagram of the GitHub repository b3tt3rlynx/thefatrat_v2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/b3tt3rlynx/thefatrat_v2
- Repository: https://github.com/b3tt3rlynx/thefatrat_v2

## Overview

The README describes TheFatRat_v2 as a Linux-oriented payload and backdoor creation tool: users choose an operating-system category and payload format, generate a payload, and may set up a local or remote listener. It also documents file pumping, network-address discovery, and removable-media autorun generation. The tree additionally contains a substantial libbpf implementation, but the supplied evidence does not connect it to TheFatRat workflow. Several product capabilities are documented without their implementing source being shown, so those nodes use the existing tools directory; links between them reflect README descriptions, not inspected calls.

Main entry points: [`tools`](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools) (Payload generation), [`bin/log/load/libbpf.c`](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/libbpf.c) (BPF object loading), [`bin/log/load/btf.c`](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/btf.c) (BTF processing), [`bin/log/load/btf_dump.c`](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/btf_dump.c) (BTF to C)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_payload["Payload creation"]
  node_category["OS category"]
  node_payloadgen["Payload generation"]
  node_formats["Payload formats"]
end

subgraph group_delivery["Delivery and listeners"]
  node_listener["Listener setup"]
  node_autorun["Autorun files"]
end

subgraph group_utilities["Supporting utilities"]
  node_pumper["File pumper<br/>[pump.py]"]
  node_network["Address discovery"]
end

subgraph group_libbpf["Embedded libbpf"]
  node_libbpf["BPF object loading<br/>[libbpf.c]"]
  node_btf["BTF processing<br/>[btf.c]"]
  node_btfdump["BTF to C<br/>[btf_dump.c]"]
  node_linker["BPF linker<br/>[linker.c]"]
  node_genloader["Loader generation<br/>[gen_loader.c]"]
  node_netlink["Netlink operations<br/>[netlink.c]"]
  node_hashmap["Hash map helper<br/>[hashmap.c]"]
end

node_user(("User"))
node_msfvenom["MSFvenom"]
node_metasploit["Metasploit"]

node_user -->|"chooses"| node_category
node_category -->|"selects"| node_payloadgen
node_payloadgen -->|"automates"| node_msfvenom
node_payloadgen -->|"automates"| node_metasploit
node_payloadgen -->|"generates"| node_formats
node_user -->|"requests"| node_listener
node_user -->|"generates"| node_autorun
node_user -->|"uses"| node_pumper
node_user -->|"requests"| node_network
node_libbpf -->|"uses"| node_btf
node_libbpf -->|"uses"| node_genloader
node_btf -->|"uses"| node_hashmap
node_btfdump -->|"converts"| node_btf
node_btfdump -->|"uses"| node_hashmap
node_linker -->|"uses"| node_btf
node_linker -->|"uses"| node_libbpf
node_netlink -->|"uses"| node_libbpf

click node_category "https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools"
click node_payloadgen "https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools"
click node_formats "https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools"
click node_listener "https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools"
click node_autorun "https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools"
click node_pumper "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/tools/pump.py"
click node_network "https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools"
click node_libbpf "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/libbpf.c"
click node_btf "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/btf.c"
click node_btfdump "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/btf_dump.c"
click node_linker "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/linker.c"
click node_genloader "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/gen_loader.c"
click node_netlink "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/netlink.c"
click node_hashmap "https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/hashmap.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_category,node_payloadgen,node_formats,node_user toneBlue
class node_listener,node_autorun toneAmber
class node_pumper,node_network toneMint
class node_libbpf,node_btf,node_btfdump,node_linker,node_genloader,node_netlink,node_hashmap toneRose
class node_msfvenom,node_metasploit toneIndigo
```

## Components

### Payload creation

- [OS category](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools): `tools`
- [Payload generation](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools): `tools`
- [Payload formats](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools): `tools`

### Delivery and listeners

- [Listener setup](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools): `tools`
- [Autorun files](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools): `tools`

### Supporting utilities

- [File pumper](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/tools/pump.py): `tools/pump.py`
- [Address discovery](https://github.com/b3tt3rlynx/thefatrat_v2/tree/main/tools): `tools`

### Embedded libbpf

- [BPF object loading](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/libbpf.c): `bin/log/load/libbpf.c`
- [BTF processing](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/btf.c): `bin/log/load/btf.c`
- [BTF to C](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/btf_dump.c): `bin/log/load/btf_dump.c`
- [BPF linker](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/linker.c): `bin/log/load/linker.c`
- [Loader generation](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/gen_loader.c): `bin/log/load/gen_loader.c`
- [Netlink operations](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/netlink.c): `bin/log/load/netlink.c`
- [Hash map helper](https://github.com/b3tt3rlynx/thefatrat_v2/blob/main/bin/log/load/hashmap.c): `bin/log/load/hashmap.c`

### Other components

- **User**
- **MSFvenom**
- **Metasploit**

## Connections

- User → OS category: chooses
- OS category → Payload generation: selects
- Payload generation → MSFvenom: automates
- Payload generation → Metasploit: automates
- Payload generation → Payload formats: generates
- User → Listener setup: requests
- User → Autorun files: generates
- User → File pumper: uses
- User → Address discovery: requests
- BPF object loading → BTF processing: uses (evidence: `bin/log/load/libbpf.c`)
- BPF object loading → Loader generation: uses (evidence: `bin/log/load/libbpf.c`)
- BTF processing → Hash map helper: uses (evidence: `bin/log/load/btf.c`)
- BTF to C → BTF processing: converts (evidence: `bin/log/load/btf_dump.c`)
- BTF to C → Hash map helper: uses (evidence: `bin/log/load/btf_dump.c`)
- BPF linker → BTF processing: uses (evidence: `bin/log/load/linker.c`)
- BPF linker → BPF object loading: uses (evidence: `bin/log/load/linker.c`)
- Netlink operations → BPF object loading: uses (evidence: `bin/log/load/netlink.c`)
