stanislav-web / OpenDoor

OWASP WEB Directory Scanner
http://opendoor.readthedocs.io
GNU General Public License v3.0
883 stars 186 forks source link

Not working on Python 3.11 #57

Closed BlockyTheDev closed 1 year ago

BlockyTheDev commented 1 year ago

It ends in such a big Traceback:

Traceback (most recent call last):
  File "C:\Users\PC4-User\Downloads\OpenDoor\opendoor.py", line 35, in <module>
    bootstrap = Controller()
                ^^^^^^^^^^^^
  File "C:\Users\PC4-User\Downloads\OpenDoor\src\controller.py", line 54, in __init__
    self.ioargs = args().get_arguments()
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\Downloads\OpenDoor\src\lib\io\arguments.py", line 37, in get_arguments
    args = options().get_arg_values()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\Downloads\OpenDoor\src\core\options\options.py", line 387, in get_arg_values
    args = Filter.filter(args)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\Downloads\OpenDoor\src\core\options\filter.py", line 45, in filter
    filtered['host'] = Filter.host(value)
                       ^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\Downloads\OpenDoor\src\core\options\filter.py", line 95, in host
    regex = re.compile(r"" + Filter.URL_REGEX + "")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 227, in compile
    return _compile(pattern, flags)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\_compiler.py", line 743, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 980, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 863, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC4-User\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 841, in _parse
    raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 69
brustver commented 1 year ago

Can be fixed by changing URL_REGEX at the beginning of OpenDoor/src/core/options/filter.py: inside regex remove (?u) At line 95: regex = re.compile(r"" + Filter.URL_REGEX + "", re.Unicode). Ugly, but works. Or just wait for Python 3.11 maintainers to fix re module...