evyatarmeged / Raccoon

A high performance offensive security tool for reconnaissance and vulnerability scanning
MIT License
3.07k stars 396 forks source link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 21: invalid start byte #19

Closed emprise1976 closed 6 years ago

emprise1976 commented 6 years ago

Hello I'm,

getting the following error message:

Traceback (most recent call last): File "/usr/local/bin/raccoon", line 11, in sys.exit(main()) File "/usr/lib/python3/dist-packages/click/core.py", line 759, in call return self.main(args, kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 714, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 951, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 552, in invoke return callback(args, *kwargs) File "/usr/local/lib/python3.6/dist-packages/raccoon_src/main.py", line 236, in main main_loop.run_until_complete(fuzzer.fuzz_all()) File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete return future.result() File "/usr/local/lib/python3.6/dist-packages/raccoon_src/lib/fuzzer.py", line 143, in fuzz_all pool.map(partial(self._fetch, sub_domain=sub_domain), self.wordlist) File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(args, kwds)) File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "/usr/local/lib/python3.6/dist-packages/raccoon_src/lib/fuzzer.py", line 81, in _fetch res = self.request_handler.send("HEAD", url=url, allow_redirects=self.follow_redirects) File "/usr/local/lib/python3.6/dist-packages/raccoon_src/utils/request_handler.py", line 89, in send return request(method, proxies=proxies, headers=self.headers, cookies=self.cookies, args, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 508, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 653, in send r._next = next(self.resolve_redirects(r, request, yield_requests=True, **kwargs)) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 125, in resolve_redirects url = self.get_redirect_target(resp) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 116, in get_redirect_target return to_native_string(location, 'utf8') File "/usr/lib/python3/dist-packages/requests/_internal_utils.py", line 25, in to_native_string out = string.decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 21: invalid start byte

evyatarmeged commented 6 years ago

Can you please share the exact command you are using, including all flags ? Also if you can post the version (raccoon --version/python3 main.py --version) Lastly, if it is possible to share any custom wordlists if any are being used.

I'll look into it once I have the above. Thanks :)

emprise1976 commented 6 years ago

Hi,

raccoon, version 0.8.3 Python 3.6.6

The Call is "raccoon -t domain.xx --tor-routing" for example.

[#] Fuzzing URLs [#] Reading from list: /usr/local/lib/python3.6/dist-packages/raccoon_src/wordlists/fuzzlist

It crashs with or after [301] http://domain.xx/.domain redirects to https://domain.xx/.domain

I' am seeing the error only on one server, with other servers raccoon will work without any errors.

Thank you for your help.

evyatarmeged commented 6 years ago

One of the server's domains (probably a redirection destination) contains none utf-8 encoded data. I'll add add try/catch for this to continue if such error occurs. This is indeed a rare case but I'll handle it nonetheless. Thanks for the issue :+1: