code2prompt_core 4.2.0

A command-line (CLI) tool to generate an LLM prompt from codebases of any size, fast.
Documentation
Challenge Name: {{challenge_name}}
Category: Binary Exploitation

Description: {{challenge_description}}

Provided Files:
{{#each files}}
{{#if code}} 
`{{path}}`:
{{code}}

{{/if}}
{{/each}}

To solve this binary exploitation challenge:

1. Examine the provided source code (if any):
- Identify vulnerabilities (buffer overflow, use-after-free, integer issues, etc.)
- Understand intended behavior and user input 
- Note compiled binary type (ELF 32/64-bit, Windows PE, etc.)

2. Perform static analysis on the binary:
- Enumerate input vectors (local files, network port, stdin, etc.) 
- Reverse engineer relevant code paths
- Locate vulnerable functions (unsafe C functions, syscalls, etc.)
- Check for stack canaries, NX, PIE, ASLR, RELRO 

3. Proceed to dynamic analysis:
- Attach debugger and send input
- Determine segfault type (IP overwrite, invalid read/write, etc.)
- Inspect registers, stack, heap contents
- Dump process memory 
- Set breakpoints and watchpoints as needed

4. Develop your exploit strategy:
- Goal (EIP control, arbitrary read/write, information leak, etc.) 
- Payload (spawning a shell, leaking a flag, ret2libc, ROP, etc.)
- Method to reach vulnerable code
- Bypassing any exploit mitigations

5. Construct your exploit payload:
- Determine bad characters and encoding 
- Find ROP gadgets, function addresses, etc. as needed
- Use pwntools, Ropper, one_gadget, etc. 
- Build payload in debugger, then script it

6. If remote, ensure your exploit is stable and reliable:
- Adapt to remote environment 
- Handle network quirks, latency
- Encode payload for transmission

7. Launch the exploit, catch the shell or leaked flag.

Include your process, not just the final payload. Stay within scope (no attacking unintended targets).