king-phisher: ImportError: No module named 'graphene

Issue Description

tldr -

import graphene.relay ImportError: No module named 'graphene

Reproduction Steps

  1. Start King Phisher
  2. Do something to trigger the crash

Environment Details

Host OS: Debian 9 x86_64 CLI King Phisher Version: Latest

Error Details / Stack Trace

root@host:/opt/king-phisher# ls
CODE_OF_CONDUCT.md  king_phisher       Pipfile        server_config.yml
data            KingPhisher        Pipfile.lock    tests
docs            KingPhisherServer  README.md    tools
INSTALL.md        LICENSE           readthedocs.yml
root@host:/opt/king-phisher# ./KingPhisherServer config_file
Loading .env environment variables…
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/king-phisher/king_phisher/server/__main__.py", line 50, in <module>
    from king_phisher.server import build
  File "/opt/king-phisher/king_phisher/server/build.py", line 39, in <module>
    from king_phisher.server.server import KingPhisherRequestHandler, KingPhisherServer
  File "/opt/king-phisher/king_phisher/server/server.py", line 55, in <module>
    from king_phisher.server import server_rpc
  File "/opt/king-phisher/king_phisher/server/server_rpc.py", line 48, in <module>
    from king_phisher.server.graphql import schema
  File "/opt/king-phisher/king_phisher/server/graphql/schema.py", line 39, in <module>
    import king_phisher.server.graphql.types as gql_types
  File "/opt/king-phisher/king_phisher/server/graphql/types/__init__.py", line 35, in <module>
    from .database import *
  File "/opt/king-phisher/king_phisher/server/graphql/types/database.py", line 38, in <module>
    from . import misc as gql_misctypes
  File "/opt/king-phisher/king_phisher/server/graphql/types/misc.py", line 42, in <module>
    import graphene.relay
ImportError: No module named 'graphene'
root@host:/opt/king-phisher#
root@host:/opt/king-phisher# pip freeze | grep -e graph -e Django
cryptography==1.7.1
Django==2.2
graphene==2.1.3
graphene-django==2.2.0
graphql-core==2.1
graphql-relay==0.4.5
root@host:/opt/king-phisher#

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16

Most upvoted comments

Oh yeah, that’s probably your issue. If you changed 0.0.0.0 to your external IP address then the client won’t be able to connect to the lookback interface when it SSHes in. I’d suggest changing that back to it’s default value. If you can’t bind to all interfaces, it’d be more complicated to setup. The easiest thing to do would be to set the interface back.

You don’t need to uninstall it, just stop it and probably disable it so it doesn’t automatically start the next time you reboot.

What’s probably more important is the port. It looks like you have something else already running on the port (most likely 80). Do you either a second instance of King Phisher already running or another web server like Apache or Nginx?

Run # ./KingPhisherServer --env-install. This could take a while to run, up to 15 minutes if your internet connection is slow and it won’t print any output IIRC. This should have been handled when you ran the installer but if you aborted that or something failed it could have skipped this step.

Your last command showing that graphene is installed isn’t valid, King Phisher uses pipenv to install it’s requirements within a virtual environment to ensure that the dependencies are predictable. Additionally on most systems, pip is for Python 2.7 and King Phisher is Python 3.4+ only at this point. To check correctly you’d need to run pipenv run pip freeze.