MobSF / Mobile-Security-Framework-MobSF

Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
https://opensecurity.in
GNU General Public License v3.0
17.36k stars 3.23k forks source link

Issues of running on MacOS #370

Closed chaohaiding closed 7 years ago

chaohaiding commented 7 years ago

EXPLANATION OF THE ISSUE

run python manage.py runserver on Mac Os

STEPS TO REPRODUCE THE ISSUE

1. run python manage.py runserver

CONSOLE OUTPUT

Traceback (most recent call last):
  File "/Users/chaohaiding/Project/PenTest/MobSF/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 342, in execute
    self.check()
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 313, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
    return import_module(self.urlconf_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/chaohaiding/Project/PenTest/MobSF/MobSF/urls.py", line 4, in <module>
    import DynamicAnalyzer.views.android
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/views/android.py", line 25, in <module>
    from DynamicAnalyzer.pyWebProxy.pywebproxy import *
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/pywebproxy.py", line 51, in <module>
    from DynamicAnalyzer.pyWebProxy.socket_wrapper import wrap_socket
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/socket_wrapper.py", line 35, in <module>
    from gen_cert import gen_signed_cert
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/gen_cert.py", line 32, in <module>
    from OpenSSL import crypto
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/__init__.py", line 8, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/rand.py", line 12, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/_util.py", line 6, in <module>
  File "/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
  Referenced from: /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
Traceback (most recent call last):
  File "/Users/chaohaiding/Project/PenTest/MobSF/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 342, in execute
    self.check()
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 313, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
    return import_module(self.urlconf_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/chaohaiding/Project/PenTest/MobSF/MobSF/urls.py", line 4, in <module>
    import DynamicAnalyzer.views.android
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/views/android.py", line 25, in <module>
    from DynamicAnalyzer.pyWebProxy.pywebproxy import *
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/pywebproxy.py", line 51, in <module>
    from DynamicAnalyzer.pyWebProxy.socket_wrapper import wrap_socket
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/socket_wrapper.py", line 35, in <module>
    from gen_cert import gen_signed_cert
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/gen_cert.py", line 32, in <module>
    from OpenSSL import crypto
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/__init__.py", line 8, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/rand.py", line 12, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/_util.py", line 6, in <module>
  File "/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
  Referenced from: /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
Traceback (most recent call last):
  File "/Users/chaohaiding/Project/PenTest/MobSF/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 342, in execute
    self.check()
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
    issues.extend(super(Command, self)._run_checks(**kwargs))
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 313, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
    return import_module(self.urlconf_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/chaohaiding/Project/PenTest/MobSF/MobSF/urls.py", line 4, in <module>
    import DynamicAnalyzer.views.android
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/views/android.py", line 25, in <module>
    from DynamicAnalyzer.pyWebProxy.pywebproxy import *
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/pywebproxy.py", line 51, in <module>
    from DynamicAnalyzer.pyWebProxy.socket_wrapper import wrap_socket
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/socket_wrapper.py", line 35, in <module>
    from gen_cert import gen_signed_cert
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/gen_cert.py", line 32, in <module>
    from OpenSSL import crypto
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/__init__.py", line 8, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/rand.py", line 12, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/_util.py", line 6, in <module>
  File "/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
  Referenced from: /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x101c68320>
Traceback (most recent call last):
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
    self.check(display_num_errors=True)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 313, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/chaohaiding/Library/Python/2.7/lib/python/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
    return import_module(self.urlconf_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/chaohaiding/Project/PenTest/MobSF/MobSF/urls.py", line 4, in <module>
    import DynamicAnalyzer.views.android
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/views/android.py", line 25, in <module>
    from DynamicAnalyzer.pyWebProxy.pywebproxy import *
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/pywebproxy.py", line 51, in <module>
    from DynamicAnalyzer.pyWebProxy.socket_wrapper import wrap_socket
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/socket_wrapper.py", line 35, in <module>
    from gen_cert import gen_signed_cert
  File "/Users/chaohaiding/Project/PenTest/MobSF/DynamicAnalyzer/pyWebProxy/gen_cert.py", line 32, in <module>
    from OpenSSL import crypto
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/__init__.py", line 8, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/rand.py", line 12, in <module>
  File "/Library/Python/2.7/site-packages/pyOpenSSL-16.2.0-py2.7.egg/OpenSSL/_util.py", line 6, in <module>
  File "/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
  Referenced from: /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/cryptography-1.7.2-py2.7-macosx-10.12-intel.egg/cryptography/hazmat/bindings/_openssl.so
chaohaiding commented 7 years ago

please help. thanks

ajinabraham commented 7 years ago

You haven't installed the requirements.

chaohaiding commented 7 years ago

@ajinabraham I have run the : pip install -r requirements.txt --user with following logs:

Requirement already satisfied: Django==1.10.5 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 1)) Requirement already satisfied: tornado==4.4.2 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 2)) Requirement already satisfied: pyOpenSSL in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 3)) Requirement already satisfied: rsa in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 4)) Requirement already satisfied: configparser in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 5)) Requirement already satisfied: pdfkit in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 6)) Requirement already satisfied: lxml in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 7)) Requirement already satisfied: backports-abc>=0.4 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from tornado==4.4.2->-r requirements.txt (line 2)) Requirement already satisfied: certifi in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from tornado==4.4.2->-r requirements.txt (line 2)) Requirement already satisfied: singledispatch in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from tornado==4.4.2->-r requirements.txt (line 2)) Requirement already satisfied: six>=1.5.2 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: cryptography>=1.3.4 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: pyasn1>=0.1.3 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from rsa->-r requirements.txt (line 4)) Requirement already satisfied: setuptools>=11.3 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.3.4->pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: cffi>=1.4.1 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from cryptography>=1.3.4->pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: enum34 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from cryptography>=1.3.4->pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: ipaddress in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from cryptography>=1.3.4->pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: idna>=2.0 in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from cryptography>=1.3.4->pyOpenSSL->-r requirements.txt (line 3)) Requirement already satisfied: pycparser in /Users/chaohaiding/Library/Python/2.7/lib/python/site-packages (from cffi>=1.4.1->cryptography>=1.3.4->pyOpenSSL->-r requirements.txt (line 3))

ajinabraham commented 7 years ago

Symbol not found: _BIO_new_CMS is coming because you have issues with open ssl libs

http://stackoverflow.com/questions/37412529/install-scrapy-on-os-x-el-capitan