balrog~ ELF file analysis tool to be used after firmware extraction |
| git clone https://github.com/djnnvx/balrog.git |
| log | files | refs | archive | README |
README.md (1448B)
1 # balrog 2 3 Ranks the call sites in a firmware ELF tree that are worth opening in a decompiler. 4 5 This tool is meant to be used with `moria` and `mithril`. Basically, you can 6 think of it as a triager for ELF files, once you've extracted a firmware and looked 7 for CVEs. What deserves your attention first ? 8 9 - https://github.com/nmatt0/moria 10 - https://github.com/nmatt0/mithril 11 12 ```sh 13 moria -e firmware.bin # unpack 14 mithril firmware.bin.extracted/ # secrets, SBOM, CVEs 15 balrog scan firmware.bin.extracted/ 16 ``` 17 18 ## Build 19 20 ```sh 21 cargo build --release 22 CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \ 23 cargo build --release --target x86_64-unknown-linux-musl # static binary 24 ``` 25 26 ## Use 27 28 ``` 29 balrog scan <path>... rank risky calls, grouped by class 30 balrog scan -j <path> JSON 31 balrog scan --class exec <p> one class only 32 balrog scan --min 100 <p> score floor 33 balrog scan --per-bin 2 <p> cap findings per class per binary 34 balrog scan --top 30 <p> cap findings shown per class (default 15) 35 balrog imports <file> resolved imports and their stub addresses 36 ``` 37 38 39 Classes: `exec ipc tls fmt mem auth priv path wdt`. 40 41 Each finding lists how its score was built: 42 43 ``` 44 [ 90] memcpy poc+0xac8 heap 45 - (+35) mem base 35, rule +0 46 - (+15) arg 2 is the raw return of recv() 47 - (+40) same function as a network/env input 48 ``` 49 50 In `-j` output, `evidence` is a list of `{points, text}`.