ChrisTheCoolHut / Firmware_Slap

Discovering vulnerabilities in firmware through concolic analysis and function clustering.
GNU General Public License v3.0
468 stars 79 forks source link

looking for radare even though ghidra is installed #17

Open Alien-AV opened 5 years ago

Alien-AV commented 5 years ago

Running "Discover_And_Dump.py" from Quickstart section of the readme results in "radare not found" messages on the celery side. Discover_And_Dump.py examples/iwconfig -D iwconfig_results

However, I've installed ghidra according to instructions and I expected slap to use it instead of radare. Is it supposed to use ghidra instead of radare automatically? (Or am I misunderstanding the instructions?) What could be wrong with my setup? (I seem to have followed the instructions correctly.)

nstarke commented 5 years ago

I had to install both Ghidra and Radare2 to get it to run as well. I think the documentation might need to be changed to state both are required to be installed. @ChrisTheCoolHut what are your thoughts?

ChrisTheCoolHut commented 5 years ago

I'll install it on a clean VM tonight and check it out.

I thought I had segregated the radare2 and ghidra code. and at the top of Discover and Dump I have use_ghidra defined.

Function_handler and ghidra_handler should probably be named radare2_handler and ghidra_handler.

PhatHub commented 5 years ago

I can confirm op's report. I ran the example with iwconfig, and for some reason it would not find radare2, even though Discover_and_Dump.py had use_ghidra as True.

I then installed radare2, (like nstarke did) but r2pipe still couldn't find it.

So I added the path to the radare2 executable (radare2home="/usr/bin/") in both r2pipe.open() function calls in function_handler.py.

I'm running into a different issue now, but I currently don't have a radare2 PATH error.

mmiszczyk commented 4 years ago

I think the problem is that Discover_And_Dump.py always imports function_handler, which always imports r2pipe - and if you don't have radare installed, you won't have r2pipe. As there's always either function_handler or ghidra_handler used but never both, it would make sense to make the import conditional. I'll draft a patch for that.