Web page: ERR_EMPTY_RESPONSE
See original GitHub issueOS: Ubuntu Server 18.04 and Ubuntu 20.04
Python Version: Python 3.8.2
King Phisher Commit: 9b0c5bc7663dc2c22c1a50f75684be3a8a115edc
When using Python3.8
and vhosts
set to true
, navigating to any site will return an empty response.
To reproduce: On ubuntu 18.04 you will need to install python 3.8 and set it to default for python3. Ubuntu 20.04 python 3.8 will be installed by default and already set to python3.
Git clone down King Phisher. Then update Pipefile to have package pyproj==2.6.1 or pipenv install pyproj==2.6.1
the other version that would get auto selected by pipenv during the pipenv
installation process will fail, due to incompatable wheel.
tools/install.sh
edit server config to set vhosts to true.
stop and start server, and try to navigate to IP address/domain of the server. Recieve the empty response (image above) and the stack trace below.
----------------------------------------
DEBUG 192.168.146.1:46510 tid: 0x7f819486b700 running http request handler
----------------------------------------
Exception happened during processing of request from ('192.168.146.1', 46510)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/opt/king-phisher/.venv/lib/python3.8/site-packages/advancedhttpserver.py", line 763, in finish_request
super(ServerNonThreaded, self).finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/opt/king-phisher/king_phisher/server/server.py", line 103, in __init__
super(KingPhisherRequestHandler, self).__init__(request, client_address, server, **kwargs)
File "/opt/king-phisher/.venv/lib/python3.8/site-packages/advancedhttpserver.py", line 856, in __init__
self.on_init()
File "/opt/king-phisher/king_phisher/server/server.py", line 110, in on_init
for path, handler in self.handler_map.items():
RuntimeError: dictionary keys changed during iteration
----------------------------------------
DEBUG 192.168.146.1:46512 tid: 0x7f819486b700 running http request handler
----------------------------------------
Exception happened during processing of request from ('192.168.146.1', 46512)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/opt/king-phisher/.venv/lib/python3.8/site-packages/advancedhttpserver.py", line 763, in finish_request
super(ServerNonThreaded, self).finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/opt/king-phisher/king_phisher/server/server.py", line 103, in __init__
super(KingPhisherRequestHandler, self).__init__(request, client_address, server, **kwargs)
File "/opt/king-phisher/.venv/lib/python3.8/site-packages/advancedhttpserver.py", line 856, in __init__
self.on_init()
File "/opt/king-phisher/king_phisher/server/server.py", line 110, in on_init
for path, handler in self.handler_map.items():
RuntimeError: dictionary keys changed during iteration
----------------------------------------
From the minimal research into this. Dictionary .keys()
or .items()
return an iterator instead of a list so removing a key during the loop used with one of those functions will cause the iterator to failure to number of keys available, and loose its place.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Pretty confident I got this fixed in 2181ba508d5fa3fc2517cbedc459e536ecc7b22e. Let me know if you’re still running into the issue.
I can confirm this corrected the issue. You Rock @zeroSteiner