maurosoria / dirsearch

Web path scanner
11.85k stars 2.3k forks source link

TypeError: 'str' does not support the buffer interface #75

Closed himanshudas closed 6 years ago

himanshudas commented 6 years ago

Error:

Traceback (most recent call last):
  File "./dirsearch.py", line 38, in <module>
    main = Program()
  File "./dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "/root/dirsearch/lib/controller/Controller.py", line 135, in __init__
    self.wait()
  File "/root/dirsearch/lib/controller/Controller.py", line 334, in wait
    self.fuzzer.start()
  File "/root/dirsearch/lib/core/Fuzzer.py", line 80, in start
    self.setupScanners()
  File "/root/dirsearch/lib/core/Fuzzer.py", line 59, in setupScanners
    self.scanners[extension] = Scanner(self.requester, self.testFailPath, "." + extension)
  File "/root/dirsearch/lib/core/Scanner.py", line 44, in __init__
    self.setup()
  File "/root/dirsearch/lib/core/Scanner.py", line 61, in setup
    self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
  File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 14, in __init__
    self.generateDynamicMarks(firstPage, secondPage)
  File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 31, in generateDynamicMarks
    self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
  File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 94, in removeDynamicContent
    page = re.sub(r'(?s){0}.+{1}'.format(re.escape(prefix), re.escape(suffix)), "{0}{1}".format(prefix.replace('\\', r'\\'), suffix.replace('\\', r'\\')), page)
TypeError: 'str' does not support the buffer interface
strayge commented 6 years ago

error looks like introduced by fix

Traceback (most recent call last):
  File "dirsearch.py", line 38, in <module>
    main = Program()
  File "dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "dirsearch-master\lib\controller\Controller.py", line 135, in __init__
    self.wait()
  File "dirsearch-master\lib\controller\Controller.py", line 334, in wait
    self.fuzzer.start()
  File "dirsearch-master\lib\core\Fuzzer.py", line 80, in start
    self.setupScanners()
  File "dirsearch-master\lib\core\Fuzzer.py", line 59, in setupScanners
    self.scanners[extension] = Scanner(self.requester, self.testFailPath, "." + extension)
  File "dirsearch-master\lib\core\Scanner.py", line 44, in __init__
    self.setup()
  File "dirsearch-master\lib\core\Scanner.py", line 61, in setup
    self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
  File "dirsearch-master\thirdparty\sqlmap\DynamicContentParser.py", line 16, in __init__
    self.generateDynamicMarks(firstPage, secondPage)
  File "dirsearch-master\thirdparty\sqlmap\DynamicContentParser.py", line 33, in generateDynamicMarks
    self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
  File "dirsearch-master\thirdparty\sqlmap\DynamicContentParser.py", line 94, in removeDynamicContent
    page = re.sub(r'(?s)^.+{0}'.format(re.escape(suffix)), suffix.replace('\\', r'\\'), page)
TypeError: a bytes-like object is required, not 'str'

suffix & prefix should be also converted to str

maurosoria commented 6 years ago

I pushed a possible fix. Try fix_75 branch. I need feedback to fixing this problem

git clone https://github.com/maurosoria/dirsearch -b fix_75

Thanks

yuriyv commented 6 years ago

very strange, works with -e php but shows this error with -e php,aspx

maurosoria commented 6 years ago

?????

strayge commented 6 years ago

I couldn't reproduce error.