commixproject / commix

Automated All-in-One OS Command Injection Exploitation Tool.
https://commixproject.com
Other
4.62k stars 818 forks source link

Bug Report: Unhandled exception "UnicodeEncodeError: 'ascii' codec can't encode character '\u2018' in position 63: ordinal not in range(128)" (#d49fc107) #947

Closed commixreporter closed 4 months ago

commixreporter commented 4 months ago
Commix version: 3.9-stable
Python version: 3.11.9
Operating system: posix
Command line: commix.py -u ************************************************************ 
Traceback (most recent call last):
  File "commix.py", line 35, in <module>
    main()
  File "commix.py", line 30, in main
    import src.core.main
  File "main.py", line 842, in <module>
    main(filename, url)
  File "main.py", line 529, in main
    controller.do_check(url, http_request_method, filename)
  File "controller.py", line 760, in do_check
    perform_checks(url, http_request_method, filename)
  File "controller.py", line 690, in perform_checks
    get_request(url, http_request_method, filename, timesec)
  File "controller.py", line 575, in get_request
    injection_proccess(url, check_parameter, http_request_method, filename, timesec)
  File "controller.py", line 365, in injection_proccess
    classic_command_injection_technique(url, timesec, filename, http_request_method)
  File "controller.py", line 209, in classic_command_injection_technique
    if cb_handler.exploitation(url, timesec, filename, http_request_method, injection_type, technique) != False:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cb_handler.py", line 425, in exploitation
    if cb_injection_handler(url, timesec, filename, http_request_method, injection_type, technique) == False:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cb_handler.py", line 363, in cb_injection_handler
    response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cb_injector.py", line 243, in injection
    response = check_injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cb_injector.py", line 212, in check_injection
    response = requests.get_request_response(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "requests.py", line 406, in get_request_response
    headers.check_http_traffic(request)
  File "headers.py", line 204, in check_http_traffic
    response = _urllib.request.urlopen(request, timeout=settings.TIMEOUT)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "client.py", line 1303, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "client.py", line 1314, in _send_request
    self.putrequest(method, url, **skips)
  File "client.py", line 1152, in putrequest
    self._output(self._encode_request(request))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "client.py", line 1232, in _encode_request
    return request.encode('ascii')
           ^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\u2018' in position 63: ordinal not in range(128)
stasinopoulos commented 4 months ago

Update to the latest (dev) version.

github-actions[bot] commented 2 months ago

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.