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

celery error #12

Closed ch0wn closed 5 years ago

ch0wn commented 5 years ago

When running this command: celery -A firmware_slap.celery_tasks worker --loglevel=info

I get the following error:

`Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/app/utils.py", line 369, in find_app sym = symbol_by_name(app, imp=imp) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/bin/base.py", line 527, in symbol_by_name return imports.symbol_by_name(name, imp=imp) File "/usr/local/lib/python3.6/dist-packages/kombu-4.6.3-py3.6.egg/kombu/utils/imports.py", line 62, in symbol_by_name return getattr(module, cls_name) if cls_name else module AttributeError: module 'firmware_slap' has no attribute 'celery_tasks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/celery", line 11, in load_entry_point('celery==4.4.0rc2', 'console_scripts', 'celery')() File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/main.py", line 16, in main _main() File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/bin/celery.py", line 322, in main cmd.execute_from_commandline(argv) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/bin/celery.py", line 496, in execute_from_commandline super(CeleryCommand, self).execute_from_commandline(argv))) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/bin/base.py", line 288, in execute_from_commandline argv = self.setup_app_from_commandline(argv) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/bin/base.py", line 502, in setup_app_from_commandline self.app = self.find_app(app) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/bin/base.py", line 524, in find_app return find_app(app, symbol_by_name=self.symbol_by_name) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/app/utils.py", line 372, in find_app sym = imp(app) File "/usr/local/lib/python3.6/dist-packages/celery-4.4.0rc2-py3.6.egg/celery/utils/imports.py", line 111, in import_from_cwd return imp(module, package=package) File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/user/Firmware_Slap/firmware_slap/celery_tasks.py", line 7, in from firmware_slap.function_analyzer import File "/home/user/Firmware_Slap/firmware_slap/function_analyzer.py", line 1, in import angr File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/init.py", line 30, in from .sim_procedure import SimProcedure File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/sim_procedure.py", line 498, in from angr.sim_type import SimTypePointer File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/sim_type.py", line 1287, in from .state_plugins.view import SimMemView File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/state_plugins/init.py", line 10, in from .javavm_memory import File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/state_plugins/javavm_memory.py", line 7, in from ..engines.soot.values import (SimSootValue_ArrayRef, File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/engines/init.py", line 4, in from .vex import SimEngineVEX File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/engines/vex/init.py", line 1, in from .engine import SimEngineVEX File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/engines/vex/engine.py", line 17, in from ...utils.constants import DEFAULT_STATEMENT File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/utils/init.py", line 4, in from . import enums_conv File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/utils/enums_conv.py", line 6, in from ..protos.primitives_pb2 import Edge File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/protos/init.py", line 2, in from . import primitives_pb2 File "/usr/local/lib/python3.6/dist-packages/angr-8.19.7.25-py3.6-linux-x86_64.egg/angr/protos/primitives_pb2.py", line 23, in serialized_pb=_b('\n\x17protos/primitives.proto\x12\x0b\x61ngr.protos\"\xf6\x04\n\rCodeReference\x12:\n\x0btarget_type\x18\x01 \x01(\x0e\x32%.angr.protos.CodeReference.TargetType\x12<\n\x0coperand_type\x18\x02 \x01(\x0e\x32&.angr.protos.CodeReference.OperandType\x12\x35\n\x08location\x18\x03 \x01(\x0e\x32#.angr.protos.CodeReference.Location\x12\n\n\x02\x65\x61\x18\x04 \x01(\x03\x12\x0c\n\x04mask\x18\x05 \x01(\x03\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x0f\n\x07\x64\x61ta_ea\x18\x07 \x01(\x03\x12\x10\n\x08\x62lock_ea\x18\x08 \x01(\x03\x12\x10\n\x08stmt_idx\x18\t \x01(\x05\x12\x13\n\x0boperand_idx\x18\n \x01(\x05\x12:\n\x08ref_type\x18\x0b \x01(\x0e\x32(.angr.protos.CodeReference.ReferenceType\",\n\nTargetType\x12\x0e\n\nCodeTarget\x10\x00\x12\x0e\n\nDataTarget\x10\x01\"~\n\x0bOperandType\x12\x14\n\x10ImmediateOperand\x10\x00\x12\x11\n\rMemoryOperand\x10\x01\x12\x1d\n\x19MemoryDisplacementOperand\x10\x02\x12\x16\n\x12\x43ontrolFlowOperand\x10\x03\x12\x0f\n\x0bOffsetTable\x10\x04\"&\n\x08Location\x12\x0c\n\x08Internal\x10\x00\x12\x0c\n\x08\x45xternal\x10\x01\"0\n\rReferenceType\x12\n\n\x06offset\x10\x00\x12\x08\n\x04read\x10\x01\x12\t\n\x05write\x10\x02\"k\n\x0bInstruction\x12\n\n\x02\x65\x61\x18\x01 \x01(\x03\x12\r\n\x05\x62ytes\x18\x02 \x01(\x0c\x12)\n\x05xrefs\x18\x03 \x01(\x0b\x32\x1a.angr.protos.CodeReference\x12\x16\n\x0elocal_noreturn\x18\x04 \x01(\x08\"\n\x05\x42lock\x12\n\n\x02\x65\x61\x18\x01 \x01(\x03\x12.\n\x0cinstructions\x18\x02 \x01(\x0b\x32\x18.angr.protos.Instruction\x12\x0c\n\x04size\x18\x04 \x01(\x05\x12\r\n\x05\x62ytes\x18\x05 \x01(\x0c\"\x95\x02\n\x10\x45xternalFunction\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02\x65\x61\x18\x02 \x01(\x03\x12;\n\x02\x63\x63\x18\x03 \x01(\x0e\x32/.angr.protos.ExternalFunction.CallingConvention\x12\x12\n\nhas_return\x18\x04 \x01(\x08\x12\x11\n\tno_return\x18\x05 \x01(\x08\x12\x16\n\x0e\x61rgument_count\x18\x06 \x01(\x05\x12\x0f\n\x07is_weak\x18\x07 \x01(\x08\x12\x11\n\tprototype\x18\x08 \x01(\t\"G\n\x11\x43\x61llingConvention\x12\x11\n\rCallerCleanup\x10\x00\x12\x11\n\rCalleeCleanup\x10\x01\x12\x0c\n\x08\x46\x61stCall\x10\x02\"d\n\x10\x45xternalVariable\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02\x65\x61\x18\x02 \x01(\x03\x12\x0c\n\x04size\x18\x03 \x01(\x05\x12\x0f\n\x07is_weak\x18\x04 \x01(\x08\x12\x17\n\x0fis_thread_local\x18\x05 \x01(\x08\"\xd6\x03\n\x04\x45\x64ge\x12\x0e\n\x06src_ea\x18\x01 \x01(\x03\x12\x0e\n\x06\x64st_ea\x18\x02 \x01(\x03\x12,\n\x08jumpkind\x18\x03 \x01(\x0e\x32\x1a.angr.protos.Edge.JumpKind\x12\x12\n\nis_outside\x18\x04 \x01(\x08\x12\x10\n\x08ins_addr\x18\x05 \x01(\x03\x12\x10\n\x08stmt_idx\x18\x06 \x01(\x03\x12)\n\x04\x64\x61ta\x18\x07 \x03(\x0b\x32\x1b.angr.protos.Edge.DataEntry\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"\xef\x01\n\x08JumpKind\x12\x13\n\x0fUnknownJumpkind\x10\x00\x12\n\n\x06\x42oring\x10\x01\x12\x08\n\x04\x43\x61ll\x10\x02\x12\n\n\x06Return\x10\x03\x12\x0e\n\nFakeReturn\x10\x04\x12\x0b\n\x07Syscall\x10\x05\x12\x0f\n\x0bSys_syscall\x10\x06\x12\x0e\n\nSys_int128\x10\x07\x12\x0c\n\x08NoDecode\x10\x08\x12\n\n\x06\x45mWarn\x10\t\x12\x11\n\rSigFPE_IntDiv\x10\n\x12\x0b\n\x07SigTRAP\x10\x0b\x12\x0b\n\x07SigSEGV\x10\x0c\x12\x0b\n\x07MapFail\x10\r\x12\x0b\n\x07NoRedir\x10\x0e\x12\r\n\tClientReq\x10\x0f\".\n\nBlockGraph\x12 \n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x11.angr.protos.Edgeb\x06proto3') TypeError: __new__() got an unexpected keyword argument 'serialized_options' Could you please help me out? Thanks!

nstarke commented 5 years ago

Are you running the celery command in the top level Firmware_Slap directory?

ch0wn commented 5 years ago

I run it from /home/user/Firmware_Slap

:~/Firmware_Slap$ ls

bin  build  dist  examples  firmware_slap  Firmware_Slap.egg-info  LICENSE  MANIFEST.in  README.md  requirements  setup.py  setup.sh
nstarke commented 5 years ago

What happens when you run ls firmware_slap in that directory? Can you paste the output?

nstarke commented 5 years ago

It also looks like you may not be using virtualenv - I'm not sure if that would make any difference or not.

ChrisTheCoolHut commented 5 years ago

It looks like an install error: https://github.com/protocolbuffers/protobuf/issues/4716

sudo pip3 install celery protobuf --upgrade

Your celery is using a dated version of protobuf. You could either manually update both protobuf and celery, or create a new virtualenv and run the python setup.py install in there. I'd advice the latter.

ch0wn commented 5 years ago

I did the update and it's working now :) Many thanks for the help!