使用 py2.7 和 py3.7 时都会出现此错误
Getting this error with py2.7 as well as with py3.7
使用 py2.7 和 py3.7 时出现此错误
在此处输入代码
Exception happened during processing of request from ('10.0.2.15', 41994)
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 "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/usr/share/set/src/webattack/harvester/harvester.py", line 334, in do_POST
filewrite.write(cgi.escape("PARAM: " + line + "\n"))
AttributeError: module 'cgi' has no attribute 'escape'
我觉得,你需要在import cgi
下面加上import html
,然后把cgi.escape
改成html.escape
。您需要在 /usr/share/set/src/webattack/harvester/harvester.py
中执行此操作(有关详细信息,您可以查看此 link - https://github.com/trustedsec/social-engineer-toolkit/issues/721)
import html
html.escape(string_).encode('ascii', 'xmlcharrefreplace')
使用 py2.7 和 py3.7 时出现此错误
在此处输入代码
Exception happened during processing of request from ('10.0.2.15', 41994)
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 "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "/usr/share/set/src/webattack/harvester/harvester.py", line 334, in do_POST
filewrite.write(cgi.escape("PARAM: " + line + "\n"))
AttributeError: module 'cgi' has no attribute 'escape'
我觉得,你需要在import cgi
下面加上import html
,然后把cgi.escape
改成html.escape
。您需要在 /usr/share/set/src/webattack/harvester/harvester.py
中执行此操作(有关详细信息,您可以查看此 link - https://github.com/trustedsec/social-engineer-toolkit/issues/721)
import html
html.escape(string_).encode('ascii', 'xmlcharrefreplace')