Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Login to KingPhisher. Not sure what has changed in the past week? #293

Closed
chrisandjer949 opened this issue Apr 26, 2018 · 26 comments
Assignees
Labels
bug Appears to be a technical project-related issue can't reproduce client Relating to the client component

Comments

@chrisandjer949
Copy link

Issue Description

Unable to Login to KingPhisher. I rebooted my Kali Linux and launched ./KingPhisher. The client GUI popped up and I tried to login. Logs showed this.

EBUG 127.0.0.1 tid: 0x7f1ed37fe700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f1ed37fe700 running http request handler
DEBUG sent request with sequence number 0 and action 'authenticate'
DEBUG received request with sequence number 0 and action 'authenticate'
DEBUG pam returned code: 0 reason: 'Success' for user root after 0.03 seconds
DEBUG sent response with sequence number 0
DEBUG received response with sequence number 0
INFO user root has successfully authenticated
INFO successful login request from 127.0.0.1 for user root

However, the client GUI showed Login Failed. Why the discrepancy?
Then, I got this error below.

rror Type: advancedhttpserver.RPCError
Error Details: RPCError(message='Unauthorized', status=401, remote_exception=False)
Error UID: 94c43c84-e7b0-46ec-902e-142f1cd813de
RPC Error: N/A (Not a remote RPC error)
King Phisher Version: 1.10.0 (rev: 63aaf47)
Platform Version: Linux: Kali kali-rolling kali-rolling
Python Version: 3.6.5
Gtk Version: 3.22.29
Timezone: America/Los_Angeles

Thread Information:
=> MainThread (alive=True daemon=False)

Stack Trace:
Traceback (most recent call last):
File "/opt/king-phisher/king_phisher/client/client_rpc.py", line 421, in ping
return self.call('ping')
File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 601, in call
raise RPCError(resp.reason, resp.status)
advancedhttpserver.RPCError: the server responded with 401 'Unauthorized'

Reproduction Steps

  1. Start King Phisher
  2. Login fails via the client GUI.

Environment Details

Host OS: Kali2 2018.1
King Phisher Version: installed

Error Details / Stack Trace

If you are opening an issue regarding the client, copy text from the "Error
Details" of the error dialog in the client here. If you are opening an issue
regarding the server copy the relevant lines from the logs here.
@zeroSteiner
Copy link
Collaborator

It looks like your missing a couple of lines after the server log. Can you please include more of the data from the logs?

@chrisandjer949
Copy link
Author

I just restarted KP and failed Login at the client GUI again. Here's the server logs.

root@kali2:/opt/king-phisher# ./KingPhisherServer -f -L DEBUG server_config.yml
DEBUG king phisher version: 1.10.0 (rev: 63aaf47) python version: 3.6.5
INFO listening on 0.0.0.0:80
INFO serving files has been enabled
INFO initializing database connection with driver postgresql
DEBUG postgresql-setup was not found
DEBUG postgresql service is already running via systemctl
DEBUG current database schema version: 8 (latest)
DEBUG connected to postgresql database: king_phisher
INFO restored 0 valid sessions and skipped 0 expired sessions from the database
DEBUG use pam service 'sshd' for authentication
DEBUG forked an authenticating process with pid: 4572
INFO the job manager has been started
INFO adding new job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG web socket manager worker running in tid: 0x7f2e9ed3f700
INFO including 4 custom http headers
INFO server running in process: 4542 main tid: 0x7f2eac040740
INFO dropped privileges to the nobody account
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG sent request with sequence number 0 and action 'authenticate'
DEBUG received request with sequence number 0 and action 'authenticate'
DEBUG pam returned code: 0 reason: 'Success' for user root after 0.02 seconds
DEBUG sent response with sequence number 0
DEBUG received response with sequence number 0
INFO user root has successfully authenticated
INFO successful login request from 127.0.0.1 for user root
INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all

@zeroSteiner
Copy link
Collaborator

I'm still not seeing the ping RPC call that's causing the client to crash. Are you still getting the same error?There should be a line in the server logs like DEBUG calling RPC method ping() followed by the response.

@zeroSteiner zeroSteiner added the help me Requests for support label Apr 26, 2018
@zeroSteiner
Copy link
Collaborator

Also please include the client logs and the server logs from the same execution. All lines from when you start them to after you get the exception saying you can't login.

@chrisandjer949
Copy link
Author

Sorry, stepped away from my PC for another meeting. Here's the KP Server logs.

root@kali2:/opt/king-phisher# ./KingPhisherServer -f -L DEBUG server_config.yml
DEBUG king phisher version: 1.10.0 (rev: 63aaf47) python version: 3.6.5
INFO listening on 0.0.0.0:80
INFO serving files has been enabled
INFO initializing database connection with driver postgresql
DEBUG postgresql-setup was not found
DEBUG postgresql service is already running via systemctl
DEBUG current database schema version: 8 (latest)
DEBUG connected to postgresql database: king_phisher
INFO restored 0 valid sessions and skipped 0 expired sessions from the database
DEBUG use pam service 'sshd' for authentication
DEBUG forked an authenticating process with pid: 4572
INFO the job manager has been started
INFO adding new job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG web socket manager worker running in tid: 0x7f2e9ed3f700
INFO including 4 custom http headers
INFO server running in process: 4542 main tid: 0x7f2eac040740
INFO dropped privileges to the nobody account
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG sent request with sequence number 0 and action 'authenticate'
DEBUG received request with sequence number 0 and action 'authenticate'
DEBUG pam returned code: 0 reason: 'Success' for user root after 0.02 seconds
DEBUG sent response with sequence number 0
DEBUG received response with sequence number 0
INFO user root has successfully authenticated
INFO successful login request from 127.0.0.1 for user root
INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
DEBUG removing expired hashed and cached password for user root
DEBUG sent request with sequence number 1 and action 'authenticate'
DEBUG received request with sequence number 1 and action 'authenticate'
DEBUG pam returned code: 0 reason: 'Success' for user root after 0.02 seconds
DEBUG sent response with sequence number 1
DEBUG received response with sequence number 1
INFO user root has successfully authenticated
INFO invalidated 1 previously existing session for user 1
INFO successful login request from 127.0.0.1 for user root
INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f2e9e4fe700 running http request handler
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 401 -
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all
DEBUG executing job with id: f796a4b8-95f9-43d0-8864-dbf58fa06d64 and callback function: ping_all

======================================

Here's the client logs.

root@kali2:/opt/king-phisher# ./KingPhisher
WARNING it is not necessary to run the king phisher client as root
Memory pressure relief: Total: res = 12308480/12161024/-147456, res+swap = 8081408/7933952/-147456
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket
Memory pressure relief: Total: res = 12193792/12193792/0, res+swap = 7929856/7929856/0
Memory pressure relief: Total: res = 12193792/12197888/4096, res+swap = 7933952/7933952/0
Memory pressure relief: Total: res = 12197888/12197888/0, res+swap = 7933952/7933952/0
Memory pressure relief: Total: res = 12197888/12201984/4096, res+swap = 7933952/7938048/4096
Memory pressure relief: Total: res = 12201984/12201984/0, res+swap = 7938048/7938048/0
Memory pressure relief: Total: res = 12201984/12206080/4096, res+swap = 7942144/7942144/0
Memory pressure relief: Total: res = 12206080/12234752/28672, res+swap = 7946240/8171520/225280
Memory pressure relief: Total: res = 12242944/12247040/4096, res+swap = 7983104/7983104/0
Memory pressure relief: Total: res = 12247040/12247040/0, res+swap = 7983104/8179712/196608
Memory pressure relief: Total: res = 12247040/12247040/0, res+swap = 7983104/7983104/0
Memory pressure relief: Total: res = 12247040/12251136/4096, res+swap = 7987200/7987200/0
Memory pressure relief: Total: res = 12251136/12251136/0, res+swap = 7987200/7987200/0
Memory pressure relief: Total: res = 12251136/12255232/4096, res+swap = 7991296/7991296/0
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket
ERROR error uid: 9e9fd8e4-111e-471a-8022-853a9ef48fa4 an unhandled exception was thrown
Traceback (most recent call last):
File "/opt/king-phisher/king_phisher/client/client_rpc.py", line 421, in ping
return self.call('ping')
File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 601, in call
raise RPCError(resp.reason, resp.status)
advancedhttpserver.RPCError: the server responded with 401 'Unauthorized'
Memory pressure relief: Total: res = 12263424/12242944/-20480, res+swap = 8003584/7979008/-24576

=====================================
Just saw the RPC crash error.

Error Type: advancedhttpserver.RPCError
Error Details: RPCError(message='Unauthorized', status=401, remote_exception=False)
Error UID: 9e9fd8e4-111e-471a-8022-853a9ef48fa4
RPC Error: N/A (Not a remote RPC error)
King Phisher Version: 1.10.0 (rev: 63aaf47)
Platform Version: Linux: Kali kali-rolling kali-rolling
Python Version: 3.6.5
Gtk Version: 3.22.29
Timezone: America/Los_Angeles

Thread Information:
=> MainThread (alive=True daemon=False)

Stack Trace:
Traceback (most recent call last):
File "/opt/king-phisher/king_phisher/client/client_rpc.py", line 421, in ping
return self.call('ping')
File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 601, in call
raise RPCError(resp.reason, resp.status)
advancedhttpserver.RPCError: the server responded with 401 'Unauthorized'

@chrisandjer949
Copy link
Author

I see that KP 1.11.0 was released 10 days ago. Maybe I should upgrade from 1.10 to 1.11?

@zeroSteiner
Copy link
Collaborator

Yes, you should always update.

Also it looks like you're logging in a second time is that correct? The server logs are showing that a previously authenticated session is being invalidated. This would occur if you authenticated using the same account a second time while the first was still active which you can't do.

@chrisandjer949
Copy link
Author

I did try to reauthenticate because I was not successful the first time.
I haven't upgraded KP before so pardon my ignorance. Do I just do a re-install?

@zeroSteiner
Copy link
Collaborator

I don't think upgrading is going to fix your issue but if you fall to far behind we won't help you. Go ahead and upgrade when you get a chance and if you don't we'll just ask that you do so before we help out on your next issue. We have instructions on how to upgrade in the wiki.

So if you weren't successful in authenticating the first time what was the error, do you get the same error both times? From the server logs it looks like root logged in once, everything loaded just fine then root logged in a second time while the first client was still connected. When this happened the next time the first instance of root contacted the server, it got that ugly 401 Unauthenticated error.

@chrisandjer949
Copy link
Author

Ok, I upgraded to KP 1.11.0 following the wiki instructions. Ran the verify-config check for server_config.yml with no errors. Looks good!

  1. Open a terminal and ran "netstat -tulpn" and saw 752/python3 already running on port 80.
  2. root@kali2:/opt/king-phisher# ./KingPhisher.
  3. the KP client GUI popped up. I tried to login with my root account. Received a Login Failed message. Then, I intentionally tried a bogus password and saw an invalid credentials. Logs below. Why was there a "failed to connect to the server event socket" in the first place?

WARNING it is not necessary to run the king phisher client as root
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket
WARNING failed to authenticate to the remote king phisher service, reason: invalid credentials
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket

  1. I did a "kill 752" in another terminal and started ./KingPhisherServer debug.
    root@kali2:/opt/king-phisher# kill 752
    root@kali2:/opt/king-phisher# ./KingPhisherServer -f -L DEBUG server_config.yml
    DEBUG king phisher version: 1.11.1 (rev: 0d6c0c1) python version: 3.6.5
    INFO listening on 0.0.0.0:80
    INFO serving files has been enabled
    INFO initializing database connection with driver postgresql
    DEBUG postgresql-setup was not found
    DEBUG postgresql service is already running via systemctl
    DEBUG current database schema version: 8 (latest)
    DEBUG connected to postgresql database: king_phisher
    INFO restored 0 valid sessions and skipped 0 expired sessions from the database
    DEBUG use pam service 'sshd' for authentication
    DEBUG forked an authenticating process with pid: 2158
    INFO the job manager has been started
    INFO adding new job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
    DEBUG web socket manager worker running in tid: 0x7f52e33b9700
    INFO including 4 custom http headers
    INFO server running in process: 2128 main tid: 0x7f52f0983740
    INFO dropped privileges to the nobody account
    DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all

DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
DEBUG sent request with sequence number 0 and action 'authenticate'
DEBUG received request with sequence number 0 and action 'authenticate'
DEBUG pam returned code: 0 reason: 'Success' for user root after 0.01 seconds
DEBUG sent response with sequence number 0
DEBUG received response with sequence number 0
INFO user root has successfully authenticated
INFO successful login request from 127.0.0.1 for user root
INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 -
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 401 -
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
DEBUG calling RPC method rpc_ping()
INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 -
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f52e2bb8700 running http request handler
INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 -
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG executing job with id: 3006b809-df9e-4603-a74c-289472c8d279 and callback function: ping_all
DEBUG 127.0.0.1 tid:

I just noticed in the background that KP GUI client crashed!
rror Type: advancedhttpserver.RPCError
Error Details: RPCError(message='Unauthorized', status=401, remote_exception=False)
Error UID: c97168bd-fffc-4347-9c46-8bb765f12d39
RPC Error: N/A (Not a remote RPC error)
King Phisher Version: 1.11.1 (rev: 0d6c0c1)
Platform Version: Linux: Kali kali-rolling kali-rolling
Python Version: 3.6.5
Gtk Version: 3.22.29
Timezone: America/Los_Angeles

Thread Information:
=> MainThread (alive=True daemon=False)

Stack Trace:
Traceback (most recent call last):
File "/opt/king-phisher/king_phisher/client/client_rpc.py", line 421, in ping
return self.call('ping')
File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 601, in call
raise RPCError(resp.reason, resp.status)
advancedhttpserver.RPCError: the server responded with 401 'Unauthorized'

=====================
root@kali2:/opt/king-phisher# ./KingPhisher
WARNING it is not necessary to run the king phisher client as root
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket
WARNING failed to authenticate to the remote king phisher service, reason: invalid credentials
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket

ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket
Memory pressure relief: Total: res = 12173312/12115968/-57344, res+swap = 8003584/7942144/-61440
Memory pressure relief: Total: res = 12111872/12111872/0, res+swap = 7938048/7938048/0
ERROR error uid: c97168bd-fffc-4347-9c46-8bb765f12d39 an unhandled exception was thrown
Traceback (most recent call last):
File "/opt/king-phisher/king_phisher/client/client_rpc.py", line 421, in ping
return self.call('ping')
File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 601, in call
raise RPCError(resp.reason, resp.status)
advancedhttpserver.RPCError: the server responded with 401 'Unauthorized'
Memory pressure relief: Total: res = 12111872/12111872/0, res+swap = 7938048/7938048/0
Memory pressure relief: Total: res = 12111872/12115968/4096, res+swap = 7942144/7942144/0
Memory pressure relief: Total: res = 12115968/12115968/0, res+swap = 7942144/7942144/0
Memory pressure relief: Total: res = 12115968/12144640/28672, res+swap = 7950336/8196096/245760
Memory pressure relief: Total: res = 12152832/12152832/0, res+swap = 7979008/7979008/0
Memory pressure relief: Total: res = 12152832/12152832/0, res+swap = 7979008/7979008/0
Memory pressure relief: Total: res = 12152832/12156928/4096, res+swap = 7983104/7983104/0
Memory pressure relief: Total: res = 12156928/12156928/0, res+swap = 7983104/7983104/0
Memory pressure relief: Total: res = 12156928/12161024/4096, res+swap = 7987200/7987200/0
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket

@zeroSteiner
Copy link
Collaborator

When you run the client can you please specify -L DEBUG as well to get more output from those logs? Can you also confirm for me that you're only running one instance of the client? From what you're saying it's unclear to me if you're running one or more and trying to log in.

It looks like this error has something to do with the websocket failing to connect. Can you also please send me the output of the command: python3 -c "import advancedhttpserver; print(advancedhttpserver.__file__ + ' v' + advancedhttpserver.__version__)"

@zeroSteiner
Copy link
Collaborator

Also what are your Server, HTTP SSL and HTTP Port options all set to on the login dialog?

@zeroSteiner zeroSteiner self-assigned this Apr 26, 2018
@chrisandjer949
Copy link
Author

root@kali2:/opt/king-phisher# python3 -c "import advancedhttpserver; print(advancedhttpserver.file + ' v' + advancedhttpserver.version)"
/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py v2.0.11
root@kali2:/opt/king-phisher# python3 -c "import advancedhttpserver; print(advancedhttpserver.file + ' v' + advancedhttpserver.version)"
/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py v2.0.11
root@kali2:/opt/king-phisher#

========================================

root@kali2:/opt/king-phisher# ./KingPhisher -L DEBUG
WARNING it is not necessary to run the king phisher client as root
DEBUG king phisher version: 1.11.1 (rev: 0d6c0c1) python version: 3.6.5
DEBUG client running in process: 3445 main tid: 0x7fd170302740
DEBUG using ui data from glade file: /opt/king-phisher/data/client/king_phisher/king-phisher-client.ui
DEBUG gi.repository GLib version: 2.56.0
DEBUG gi.repository GObject version: 3.28.1
DEBUG gi.repository Gtk version: 3.22.29
DEBUG gi.repository VTE version: 2.91
DEBUG matplotlib version: 2.2.2
INFO loading the config from: /root/.config/king-phisher/config.json
INFO loading 1 plugins
DEBUG plugin 'check_for_updates' has been loaded
DEBUG client loaded in 0.00 seconds
DEBUG resetting the gtk-theme-name property to it's default value
DEBUG resetting the gtk-icon-theme-name property to it's default value
DEBUG loading style from css file: /opt/king-phisher/data/client/king_phisher/style/theme.v2.css
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_file_open
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_file_quit
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_tools_rpc_terminal
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_tools_sftp_client
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_tools_create_graph
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.button_target_file_select
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.calendar_calendar_invite_date
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_calendar_invite_all_day
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_calendar_request_rsvp
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_message_uid_charset_digits
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_message_uid_charset_lower
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_message_uid_charset_upper
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.combobox_importance
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.combobox_sensitivity
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_webserver_url
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_calendar_invite_location
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_calendar_invite_summary
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_company_name
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_recipient_email_cc
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_recipient_email_to
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_source_email
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_source_email_smtp
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_source_email_alias
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_subject
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_reply_to_email
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_html_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_target_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_target_name
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_target_email_address
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_attachment_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.expander_calendar_invite_settings
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.expander_email_settings
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.label_target_count
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_message_type_calendar_invite
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_message_type_email
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_field_bcc
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_field_cc
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_field_to
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_type_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_type_single
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.spinbutton_calendar_invite_duration
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.spinbutton_calendar_invite_start_hour
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.spinbutton_calendar_invite_start_minute
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.viewport
DEBUG loading GTK builder object with id: MailSenderEditTab.toolbutton_save_as_html_file
DEBUG loading GTK builder object with id: MailSenderEditTab.toolbutton_save_html_file
DEBUG loading GTK builder object with id: MailSenderEditTab.view_html_file
DEBUG loading HTML completion data from: /opt/king-phisher/data/client/king_phisher/completion/html.json
DEBUG loading Jinja completion data from: /opt/king-phisher/data/client/king_phisher/completion/jinja.json
DEBUG loading GTK builder object with id: MailSenderSendTab.button_mail_sender_start
DEBUG loading GTK builder object with id: MailSenderSendTab.button_mail_sender_stop
DEBUG loading GTK builder object with id: MailSenderSendTab.textview_mail_sender_progress
DEBUG loading GTK builder object with id: MailSenderSendTab.togglebutton_mail_sender_pause
DEBUG loading GTK builder object with id: MailSenderSendTab.progressbar_mail_sender
DEBUG loading GTK builder object with id: MailSenderSendTab.scrolledwindow_mail_sender_progress
INFO matplotlib is installed, dashboard will be available
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.box_top_left
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.box_top_right
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.box_bottom
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.scrolledwindow_top_left
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.scrolledwindow_top_right
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.scrolledwindow_bottom
DEBUG dashboard refresh frequency set to 300 seconds
DEBUG loading GTK builder object with id: CampaignViewMessagesTab.button_refresh
DEBUG loading GTK builder object with id: CampaignViewMessagesTab.treeview_campaign
DEBUG loading GTK builder object with id: CampaignViewVisitsTab.button_refresh
DEBUG loading GTK builder object with id: CampaignViewVisitsTab.treeview_campaign
DEBUG loading GTK builder object with id: CampaignViewCredentialsTab.button_refresh
DEBUG loading GTK builder object with id: CampaignViewCredentialsTab.treeview_campaign
DEBUG loading GTK builder object with id: LoginDialog.button_connect
DEBUG loading GTK builder object with id: LoginDialog.entry_server
DEBUG loading GTK builder object with id: LoginDialog.entry_server_username
DEBUG loading GTK builder object with id: LoginDialog.entry_server_password
DEBUG loading GTK builder object with id: LoginDialog.entry_server_one_time_password
DEBUG loading GTK builder object with id: LoginDialog.label_main
DEBUG loading GTK builder object with id: LoginDialog.label_server_one_time_password
DEBUG loading GTK builder object with id: LoginDialog.revealer_server_one_time_password
DEBUG loading GTK builder object with id: LoginDialog.spinbutton_server_remote_port
DEBUG loading GTK builder object with id: LoginDialog.switch_server_use_ssl
INFO connecting to local king phisher instance
DEBUG using serializer: application/json
DEBUG using serializer: binary/message-pack
DEBUG calling RPC method: version
INFO successfully connected to the king phisher server (version: 1.11.1 (rev: 0d6c0c1) rpc api version: 6.1)
DEBUG calling RPC method: login
DEBUG successfully authenticated to the remote king phisher service
INFO connecting to the server event socket
ERROR failed to connect to the server event socket
ERROR failed to connect the server event socket
DEBUG shutting down the server event socket
Memory pressure relief: Total: res = 12218368/12152832/-65536, res+swap = 8056832/7987200/-69632

======================================
root@kali2:/opt/king-phisher# ./KingPhisherServer -f -L DEBUG server_config.yml
DEBUG king phisher version: 1.11.1 (rev: 0d6c0c1) python version: 3.6.5
INFO listening on 0.0.0.0:80
INFO serving files has been enabled
INFO initializing database connection with driver postgresql
DEBUG postgresql-setup was not found
DEBUG postgresql service is already running via systemctl
DEBUG current database schema version: 8 (latest)
DEBUG connected to postgresql database: king_phisher
INFO restored 0 valid sessions and skipped 0 expired sessions from the database
DEBUG use pam service 'sshd' for authentication
DEBUG forked an authenticating process with pid: 3338
INFO the job manager has been started
INFO adding new job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG web socket manager worker running in tid: 0x7f30d4cf4700
INFO including 4 custom http headers
INFO server running in process: 3308 main tid: 0x7f30e22be740
INFO dropped privileges to the nobody account
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f30c7fff700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f30c7fff700 running http request handler
DEBUG sent request with sequence number 0 and action 'authenticate'
DEBUG received request with sequence number 0 and action 'authenticate'
DEBUG pam returned code: 0 reason: 'Success' for user root after 0.01 seconds
DEBUG sent response with sequence number 0
DEBUG received response with sequence number 0
INFO user root has successfully authenticated
INFO successful login request from 127.0.0.1 for user root
INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 -
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f30c7fff700 running http request handler
DEBUG calling RPC method rpc_logout()
INFO successful logout request from 127.0.0.1 for user 1
INFO 127.0.0.1 "RPC /logout HTTP/1.1" 200 -
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG 127.0.0.1 tid: 0x7f30c7fff700 running http request handler
DEBUG calling RPC method rpc_version()
INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 -
DEBUG 127.0.0.1 tid: 0x7f30c7fff700 running http request handler
DEBUG checking authentication for user root with cached password hash
INFO successful login request from 127.0.0.1 for user root
INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 -
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all
DEBUG executing job with id: 855ee41c-63b4-4079-8494-c6469a905b66 and callback function: ping_all

=====================
Client login http SSL=OFF, http port = 80
Server=localhost:22

@chrisandjer949
Copy link
Author

Just got another Error... like earlier...
Error Type: advancedhttpserver.RPCError
Error Details: RPCError(message='Unauthorized', status=401, remote_exception=False)
Error UID: 2f253ba1-6c27-4a92-bea3-04a81ae0509b
RPC Error: N/A (Not a remote RPC error)
King Phisher Version: 1.11.1 (rev: 0d6c0c1)
Platform Version: Linux: Kali kali-rolling kali-rolling
Python Version: 3.6.5
Gtk Version: 3.22.29
Timezone: America/Los_Angeles

Thread Information:
=> MainThread (alive=True daemon=False)

Stack Trace:
Traceback (most recent call last):
File "/opt/king-phisher/king_phisher/client/client_rpc.py", line 421, in ping
return self.call('ping')
File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 601, in call
raise RPCError(resp.reason, resp.status)
advancedhttpserver.RPCError: the server responded with 401 'Unauthorized'

@zeroSteiner
Copy link
Collaborator

That makes sense and let me guess, there was about a 5 minute delay in between when the login failed and you got that exception right? So I'm 99% sure that what's happening is that the web socket (also referred to as the event socket) is failing to connect which is causing the login to be aborted.

@zeroSteiner
Copy link
Collaborator

I'm working on figuring out why the event socket isn't connecting which is why I asked about the connection details.

@chrisandjer949
Copy link
Author

Let me know if I can provide any additional logs... strange, this was running fine for 2 weeks and then this happened. Weird.

@zeroSteiner
Copy link
Collaborator

Ok I can not figure out what's causing the web socket to fail. I'm still pretty sure that's the problem but I can't reproduce it. I've pushed up a change to our development branch that add some more logging that was apparently missing in that area.

Can you please opt into beta testing and try again? Also when you run it can you add the --logger "" argument so it's ./KingPhisher --logger "" -L DEBUG when you run it?

This should hopefully include exception information that will help me diagnose why the websocket is failing.

@zeroSteiner zeroSteiner added bug Appears to be a technical project-related issue can't reproduce client Relating to the client component and removed help me Requests for support labels Apr 26, 2018
@chrisandjer949
Copy link
Author

Ok, I clicked on the "opt in beta testing" link above but I didn't see if I needed to fill in any additional info. Followed the instructions for installing dev branch. I did install pysimplesoap but not sure why it keeps thinking it's not installed. Notice the error at the end of the logs below.

============================
Skipping bdist_wheel for psycopg2, due to binaries being disabled for it.
python-debianbts 2.7.2 requires pysimplesoap, which is not installed.
Installing collected packages: advancedhttpserver, python-editor, SQLAlchemy, six, python-dateutil, markupsafe, Mako, alembic, blinker, boltons, idna, asn1crypto, pycparser, cffi, cryptography, dnspython, ecdsa, email-validator, chardet, urllib3, certifi, requests, maxminddb, geoip2, geojson, typing, promise, rx, graphql-core, graphql-relay, graphene, singledispatch, iso8601, graphene-sqlalchemy, pytz, icalendar, jsonschema, jinja2, setuptools, kiwisolver, numpy, pyparsing, cycler, matplotlib, msgpack-python, bcrypt, pyasn1, pynacl, paramiko, pluginbase, psycopg2, pyotp, python-pam, PyYAML, requests-file, smoke-zephyr, termcolor, tzlocal, websocket-client, XlsxWriter
Running setup.py install for psycopg2 ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-29_ovtnu/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-cykm7bgj/install-record.txt --single-version-externally-managed --compile:

----------------------------------------

./install.sh: line 426: 17671 Segmentation fault python3 -m pip install -I -r requirements.txt
ERROR: Failed to install python requirements with pip
root@kali2:/opt/king-phisher/tools#

@zeroSteiner
Copy link
Collaborator

As long as you ran the git commands you should be fine to just continue. It's not necessary or advisable to re-run the install script.

@chrisandjer949
Copy link
Author

root@kali2:/opt/king-phisher# ./KingPhisher --logger "" -L DEBUG
WARNING it is not necessary to run the king phisher client as root
DEBUG king phisher version: 1.12.0-beta (rev: 3abf876) python version: 3.6.5
DEBUG client running in process: 2378 main tid: 0x7f1d9718c740
DEBUG using ui data from glade file: /opt/king-phisher/data/client/king_phisher/king-phisher-client.ui
DEBUG gi.repository GLib version: 2.56.1
DEBUG gi.repository GObject version: 3.28.2
DEBUG gi.repository Gtk version: 3.22.29
DEBUG gi.repository VTE version: 2.91
DEBUG matplotlib version: 2.2.2
INFO loading the config from: /root/.config/king-phisher/config.json
INFO loading 1 plugins
DEBUG plugin 'check_for_updates' has been loaded
DEBUG client loaded in 0.01 seconds
DEBUG resetting the gtk-theme-name property to it's default value
DEBUG resetting the gtk-icon-theme-name property to it's default value
DEBUG loading style from css file: /opt/king-phisher/data/client/king_phisher/style/theme.v2.css
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_file_open
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_file_quit
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_tools_rpc_terminal
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_tools_sftp_client
DEBUG loading GTK builder object with id: MainMenuBar.menuitem_tools_create_graph
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.button_target_file_select
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.calendar_calendar_invite_date
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_calendar_invite_all_day
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_calendar_request_rsvp
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_message_uid_charset_digits
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_message_uid_charset_lower
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.checkbutton_message_uid_charset_upper
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.combobox_importance
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.combobox_sensitivity
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_webserver_url
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_calendar_invite_location
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_calendar_invite_summary
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_company_name
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_recipient_email_cc
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_recipient_email_to
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_source_email
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_source_email_smtp
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_source_email_alias
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_subject
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_reply_to_email
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_html_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_target_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_target_name
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_target_email_address
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.entry_attachment_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.expander_calendar_invite_settings
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.expander_email_settings
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.label_target_count
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_message_type_calendar_invite
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_message_type_email
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_field_bcc
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_field_cc
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_field_to
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_type_file
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.radiobutton_target_type_single
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.spinbutton_calendar_invite_duration
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.spinbutton_calendar_invite_start_hour
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.spinbutton_calendar_invite_start_minute
DEBUG loading GTK builder object with id: MailSenderConfigurationTab.viewport
DEBUG loading GTK builder object with id: MailSenderEditTab.toolbutton_save_as_html_file
DEBUG loading GTK builder object with id: MailSenderEditTab.toolbutton_save_html_file
DEBUG loading GTK builder object with id: MailSenderEditTab.view_html_file
DEBUG loading HTML completion data from: /opt/king-phisher/data/client/king_phisher/completion/html.json
DEBUG loading Jinja completion data from: /opt/king-phisher/data/client/king_phisher/completion/jinja.json
DEBUG loading GTK builder object with id: MailSenderSendTab.button_mail_sender_start
DEBUG loading GTK builder object with id: MailSenderSendTab.button_mail_sender_stop
DEBUG loading GTK builder object with id: MailSenderSendTab.textview_mail_sender_progress
DEBUG loading GTK builder object with id: MailSenderSendTab.togglebutton_mail_sender_pause
DEBUG loading GTK builder object with id: MailSenderSendTab.progressbar_mail_sender
DEBUG loading GTK builder object with id: MailSenderSendTab.scrolledwindow_mail_sender_progress
INFO matplotlib is installed, dashboard will be available
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.box_top_left
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.box_top_right
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.box_bottom
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.scrolledwindow_top_left
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.scrolledwindow_top_right
DEBUG loading GTK builder object with id: CampaignViewDashboardTab.scrolledwindow_bottom
WARNING /usr/local/lib/python3.6/dist-packages/matplotlib/cbook/deprecation.py:107: MatplotlibDeprecationWarning: Passing one of 'on', 'true', 'off', 'false' as a boolean is deprecated; use an actual boolean (True/False) instead.
warnings.warn(message, mplDeprecation, stacklevel=1)

DEBUG dashboard refresh frequency set to 300 seconds
DEBUG loading GTK builder object with id: CampaignViewMessagesTab.button_refresh
DEBUG loading GTK builder object with id: CampaignViewMessagesTab.treeview_campaign
DEBUG loading GTK builder object with id: CampaignViewVisitsTab.button_refresh
DEBUG loading GTK builder object with id: CampaignViewVisitsTab.treeview_campaign
DEBUG loading GTK builder object with id: CampaignViewCredentialsTab.button_refresh
DEBUG loading GTK builder object with id: CampaignViewCredentialsTab.treeview_campaign
DEBUG loading GTK builder object with id: LoginDialog.button_connect
DEBUG loading GTK builder object with id: LoginDialog.entry_server
DEBUG loading GTK builder object with id: LoginDialog.entry_server_username
DEBUG loading GTK builder object with id: LoginDialog.entry_server_password
DEBUG loading GTK builder object with id: LoginDialog.entry_server_one_time_password
DEBUG loading GTK builder object with id: LoginDialog.label_main
DEBUG loading GTK builder object with id: LoginDialog.label_server_one_time_password
DEBUG loading GTK builder object with id: LoginDialog.revealer_server_one_time_password
DEBUG loading GTK builder object with id: LoginDialog.spinbutton_server_remote_port
DEBUG loading GTK builder object with id: LoginDialog.switch_server_use_ssl
INFO connecting to local king phisher instance
DEBUG using serializer: application/json
DEBUG using serializer: binary/message-pack
DEBUG calling RPC method: version
INFO successfully connected to the king phisher server (version: 1.12.0-beta (rev: 3abf876) rpc api version: 6.1)
DEBUG calling RPC method: login
DEBUG successfully authenticated to the remote king phisher service
INFO connecting to the server event socket
DEBUG Connecting proxy...
ERROR encountered a web socket exception
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/websocket/_app.py", line 234, in run_forever
host=host, origin=origin)
File "/usr/local/lib/python3.6/dist-packages/websocket/_core.py", line 217, in connect
options.pop('socket', None))
File "/usr/local/lib/python3.6/dist-packages/websocket/_http.py", line 72, in connect
sock = _tunnel(sock, hostname, port, auth)
File "/usr/local/lib/python3.6/dist-packages/websocket/_http.py", line 224, in _tunnel
"failed CONNECT via proxy status: %r" % status)
websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 403
root@kali2:/opt/king-phisher/tools#

@zeroSteiner
Copy link
Collaborator

Now we're getting somewhere! Thanks for that info, it confirms my suspicion.

Do you have an http_proxy or https_proxy environment variable set? You can check with the env command. If you do can you remove it and see if that fixes the issue?

@chrisandjer949
Copy link
Author

Bingo! removing the http_proxy and https_proxy variables resolved the issue! Looks like KP is working again. Sorry to waste your time today on this. Maybe add notes to your wiki to warn others? I had to add the proxy variables to update other modules earlier.

@chrisandjer949
Copy link
Author

Thanks again for your help today!!!

@zeroSteiner
Copy link
Collaborator

Well since we open a port forward for the websocket it should never connect with a proxy, so this is really a bug. I'll get a patch pushed up to dev tomorrow that will explicitly disable proxy support for the websocket and that will address the issue.

@zeroSteiner
Copy link
Collaborator

Alright, bug has been fixed in commit 93431bc which is live in the dev branch. This change effectively makes the client's web socket connection ignore any http(s)_proxy environment variables that may be set.

Proxies won't be used but at least now setting them won't prevent you from logging in. Thanks for reporting this issue and being so responsive, it wasn't an easy one to troubleshoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Appears to be a technical project-related issue can't reproduce client Relating to the client component
Projects
None yet
Development

No branches or pull requests

2 participants