【问题标题】:Getting this error with py2.7 as well as with py3.7使用 py2.7 和 py3.7 出现此错误
【发布时间】:2020-10-09 17:33:24
【问题描述】:

在 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'

【问题讨论】:

    标签: html python-3.x linux cgi


    【解决方案1】:
    import html
    
    html.escape(string_).encode('ascii', 'xmlcharrefreplace')
    

    【讨论】:

    • 纯代码答案并不是特别有用。请添加一些关于此代码如何解决问题的描述。
    【解决方案2】:

    我认为,您需要在import cgi 下添加import html,然后将cgi.escape 更改为html.escape。您需要在/usr/share/set/src/webattack/harvester/harvester.py 中执行此操作(有关详细信息,您可以查看此链接-https://github.com/trustedsec/social-engineer-toolkit/issues/721

    【讨论】:

      猜你喜欢
      • 2016-12-11
      • 2021-08-17
      • 2017-02-08
      • 2019-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-13
      • 1970-01-01
      相关资源
      最近更新 更多