feat(exploit): Add checkm8 DFU exploit engine with payload headers

Four-stage checkm8 exploit (reset, spray, setup, patch) targeting
A5-A11 BootROM vulnerability. Includes ROP chain headers for A10/A11
and shellcode placeholder. Verify via PWND: serial marker.

Files created:
- include/exploit/exploit.h
- include/exploit/checkm8.h
- include/exploit/checkm8_internal.h
- src/exploit/checkm8.c
- src/exploit/checkm8_stages.c
- src/exploit/payload/rop_a10.h
- src/exploit/payload/rop_a11.h
- src/exploit/payload/shellcode.h
- src/exploit/payload/ramdisk.h

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
tr4m0ryp 2026-04-05 02:16:52 +02:00
parent 82bec20452
commit 17fca828a5
9 changed files with 911 additions and 0 deletions

53
include/exploit/exploit.h Normal file
View file

@ -0,0 +1,53 @@
/* exploit.h -- Common exploit types and lifecycle API */
#ifndef EXPLOIT_H
#define EXPLOIT_H
#include <stddef.h>
#include <stdint.h>
#include "device/device.h"
#include "device/chip_db.h"
/* Exploit phase constants */
#define EXPLOIT_PHASE_INIT 0
#define EXPLOIT_PHASE_RESET 1
#define EXPLOIT_PHASE_SPRAY 2
#define EXPLOIT_PHASE_SETUP 3
#define EXPLOIT_PHASE_PATCH 4
#define EXPLOIT_PHASE_DONE 5
/*
* exploit_ctx_t -- shared context for any DFU exploit.
*
* Holds the device, chip info, current exploit phase, and the assembled
* payload buffer (ROP chain + shellcode concatenated).
*/
typedef struct {
device_info_t *dev;
const chip_info_t *chip;
int phase; /* EXPLOIT_PHASE_* */
uint8_t *payload_buf;
size_t payload_len;
} exploit_ctx_t;
/*
* exploit_init -- Populate ctx from device info. Looks up chip_info via
* cpid, verifies checkm8 vulnerability, allocates payload buffer.
* Returns 0 on success, -1 on failure.
*/
int exploit_init(exploit_ctx_t *ctx, device_info_t *dev);
/*
* exploit_deliver -- Execute the exploit stages (reset, spray, setup, patch).
* The specific exploit is selected based on chip type (currently only checkm8).
* Returns 0 on success, -1 on failure.
*/
int exploit_deliver(exploit_ctx_t *ctx);
/*
* exploit_cleanup -- Free payload buffer and zero the context.
*/
void exploit_cleanup(exploit_ctx_t *ctx);
#endif /* EXPLOIT_H */