MITRECND / chopshop

Protocol Analysis/Decoder Framework
https://chopshop.readthedocs.org/
487 stars 112 forks source link

Not checking if htpy is installed #49

Closed eldraco closed 9 years ago

eldraco commented 9 years ago

If htpy is not installed on the system, the error is not catched.

wxsBSD commented 9 years ago

When running a module that requires htpy it should be a hard error. Unless I'm missing something this is not a bug.

eldraco commented 9 years ago

Well not sure, but it looks like the error should be captured and maybe printed an explanation on how to install htpy

./chopshop -f test.pcap 'http' Traceback (most recent call last): File "/home/xxx/chopshop/shop/ChopLib.py", line 492, in _loadModules loaded_mod = imp.load_module(name, file, pathname, description) File "/home/xxx/chopshop/modules/http.py", line 28, in import htpy ImportError: No module named htpy

Exception in thread ChopUi: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/home/xxx/chopshop/shop/ChopUi.py", line 218, in run self.stdclass.handle_ctrl(message) File "/home/xxx/chopshop/shop/ChopUiStd.py", line 170, in handle_ctrl raise ChopLibException("Error Shown Above") ChopLibException: 'Error Shown Above'

wxsBSD commented 9 years ago

I'm inclined not to do this because we would have to do it in multiple places for multiple modules. Instead we have a "dependency-check" target which will tell you about missing modules.

wxs@psh chopshop % make dependency-check 
Checking dependencies...
Checking python...
Python OK: Python 2.7.6
Checking pynids...
pynids OK
Checking pymongo...
pymongo OK
Checking htpy...
htpy OK
Checking dnslib...
dnslib OK
Checking yaraprocessor...
yaraprocessor OK
Checking pylibemu...
pylibemu OK
wxs@psh chopshop %