bocajspear1 / honeyhttpd

HoneyHTTPD is a Python-based web server honeypot/service imitation builder. Great for honeypots or faking HTTP services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: unhashable type: 'list'

x62smith opened this issue · comments

Tested on Ubuntu 16.04 with Python 2 and 3. Starts up just fine but when you visit the webpage there are errors. I've found two depending on the URI used. Above each error is a printout of self.responses[code].

('Upgrade Required', "The requested resource can only be retrieved\nusing SSL. The server is willing to upgrade the current\nconnection to SSL, but your client doesn't support it.\nEither upgrade your client, or try requesting the page\nusing https://\n")


Exception happened during processing of request from ('127.0.0.1', 41708)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/home/sigops/honeyhttpd/honeyhttpd/lib/server.py", line 131, in do_GET
res_headers, res_data = self.send_error(code, data)
File "/home/sigops/honeyhttpd/honeyhttpd/lib/server.py", line 56, in send_error
desc_template = Template(self.responses[code][0])
TypeError: unhashable type: 'list'

127.0.0.1 - - [22/May/2018 08:32:21] "GET /index.html HTTP/1.1" 200 -

Exception happened during processing of request from ('127.0.0.1', 41710)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/home/sigops/honeyhttpd/honeyhttpd/lib/server.py", line 135, in do_GET
self.on_complete(self.client_address, code, req_headers, res_headers, self.get_raw_request(), res_data)
File "/home/sigops/honeyhttpd/honeyhttpd/lib/server.py", line 409, in on_complete
raise NotImplementedError
NotImplementedError

Thanks for the bug report! The fixes should now be pushed up.

Had some arguments that were in the wrong order and a method was missing the ApacheServer class.