# ExploitDB C Compiler Skill

Help compile and run ExploitDB C exploits in controlled batches. Parse compile instructions from top-of-file comments (usage, gcc lines, Makefile hints). Produce a runnable wrapper and YAML entry.

## When to use
- Exploit in `/usr/share/exploitdb/exploits/**/*.c`
- Need to compile for target arch/os
- Want to test in sandbox before adding to auto_loop

## Workflow
1. Pick batch: `python3 -c "from modules import exploitdb_bridge; print(exploitdb_bridge.scan_tier0(limit=20,platform='linux'))"` no, use csv filter for .c + remote/webapps
2. For each: read first 80-120 lines, grep for `gcc`, `cc`, `make`, `-o`, `include`, `apt install`, library names
3. Infer compile: try simple `gcc -o /tmp/edb-<id> <src> -pthread -lcrypto ...` from hints; add common flags
4. If needs complex build (Makefile), copy dir to `/tmp/edb-build-<id>/` and run make
5. Create wrapper script `sessions/exploitdb_c/edb_<id>_run.sh` taking {rhost} {rport}
6. Generate `exploits/edb_c_<id>.yaml` similar to tier0 but `commands` run the wrapper
7. Test with --help or syntax; log to `sessions/exploitdb_c/compile.log`

## Safety
- Compile in /tmp
- Never auto-run against real targets unless operator confirms
- Use `gcc` with warnings but don't suppress
- Check for fork bombs/shellcode blobs
