aerosec / jetset

GNU General Public License v2.0
49 stars 6 forks source link

angr.engines.vex.ccall #6

Open CSIGUN opened 6 months ago

CSIGUN commented 6 months ago

I used this command "python3 jetset_server.py --soc gateway -o result"

But, the following error occurred:

ModuleNotFoundError : No module named 'angr.engines.vex.ccall'

How can I fix this error?

maxwell-bland commented 6 months ago

Hi,

On vacation for the holidays right now, so responses may be delayed, but at a glance this has to do with the interpretation/lifting of a condition code based branch instruction (e.g. beq), but should be handled by angr/engines/vex/ccall.py in your installation.

Check that angr's vex engine and the vex directory have the ccall file for supporting the lifter. If not, it likely points to either (a) a step missed or crashing during installation or less likely but possible (b) missing vex support for this operation. The gateway was one of the targets for our paper so everything should be supported---I do not think angr has deprecated this API.

Edit: also make sure the python virtualenvironment is activated! That could result in not being able to resolve the module.

Cheers and thanks, Max

CSIGUN commented 6 months ago

Thank you for your answer!

If I run the following command in the jetset/jetset_engine/jetset_engine path, After doing this, an error statement like this occurs

root@4b37bf30cea8:~/jetset/jetset_engine/jetset_engine# python3 jetset_server.py --soc gateway -o result

Traceback (most recent call last): File "jetset_server.py", line 6, in import configs.socs as socs File "/root/jetset/jetset_engine/jetset_engine/configs/socs.py", line 1, in import configs.cmu_config as cmu File "/root/jetset/jetset_engine/jetset_engine/configs/cmu_config.py", line 4, in from angr.engines.vex.ccall import x86g_use_seg_selector, get_segdescr_limit ModuleNotFoundError: No module named 'angr.engines.vex.ccall'

(I installed the python virtual environment and also installed angr)

I'd appreciate it if you could tell me how to solve it.

maxwell-bland commented 6 months ago

Ah,

"import configs.cmu_config as cmu" should be commented out, we did not release the communication management unit binary (since that would be bad).

This is probably my fault, I used this repo for some demos a while back and must've not checked changes on a fresh install. We just need to add a "#" to that line and any other cmu-related errors. I will check and fix tonight, unless you can beat me to it.

Thanks, Maxwell

CSIGUN commented 2 weeks ago

Hello, I tried running it again after downloading the new one.

root@4b37bf30cea8:~/jetset/jetset_engine/jetset_engine# python3 jetset_server.py --soc gateway -o results

Running ['xterm', '-e', 'None', '4444'] Warning: This program is an suid-root program or is being run by the root user. The full text of the error or warning message cannot be safely formatted in this environment. You may get a more descriptive message by running the program as a non-root user or by removing the suid bit on the executable. xterm: Xt error: Can't open display: %s xterm: DISPLAY is not set connecting to localhost port 4444 timeout = 10.0 Traceback (most recent call last): File "jetset_server.py", line 61, in main() File "jetset_server.py", line 57, in main exploration_manager.run() File "/root/jetset/jetset_engine/jetset_engine/exploration.py", line 81, in run vm = self.run_one(decision_cache=self.decision_cache) File "/root/jetset/jetset_engine/jetset_engine/exploration.py", line 49, in run_one vm = self.vm_constructor(self.vm_args, decision_cache) File "jetset_server.py", line 19, in init super(JetSetServer, self).init(decision_cache) File "/root/jetset/jetset_engine/jetset_engine/qmp.py", line 24, in init self.qmp_chan = QmpChannel(self.port) File "/root/jetset/jetset_engine/jetset_engine/qmp_channel.py", line 18, in init self.s.connect(server_address) ConnectionRefusedError: [Errno 111] Connection refused

Q. How do I resolve this error? Q. Are those options correct when running "gateway" firmware?

maxwell-bland commented 6 days ago

Hi. Looks like you are running this from a non-X11 environment (potentially i3-wm or a free non-desktop version of linux).

Part of the coordination scripts open up an xterm session in order to run a few of the commands. This really should be done via some tmux commands, but for now we don't quite support environments without a DISPLAY environment variable.

In the past, I have also run into missing DISPLAY env variable problems because I was running debian without a the non-free nvidia GPU drivers, so this error may be somewhat user-specific.

tl;dr is we may need to go back and patch out the "['xterm', '-e', 'None', '4444']" to run using a subshell or something. Alternatively, you may just go ahead and run this in an environment with an appropriate DISPLAY variable. I imagine you may be trying this from the context of some server machine. It is possible to just ensure xterm is installed onto the server and then pass the "-X" option to ssh for X11 forwarding. It may be slow, but I believe I have done this in the past and it has worked fine.

Let me know. Regards, Maxwell