Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix an error occurred while calling the function generate_404_by_shuffle #17964

Merged

Conversation

perfgao
Copy link

@perfgao perfgao commented Jun 26, 2019

Error Message:

A "TypeError" exception was found while running crawl.web_spider on "Method: GET | https://domain/". The exception was: "can only join an iterable" at None:None():None. The full traceback is:

Traceback (most recent call last):
  File "/root/tools/w3af/w3af/core/controllers/threads/threadpool.py", line 278, in __call__
    result = (True, func(*args, **kwds))
  File "/root/tools/w3af/w3af/core/controllers/threads/pool276.py", line 67, in mapstar
    return map(*args)
  File "/root/tools/w3af/w3af/core/controllers/threads/threadpool.py", line 55, in __call__
    return self.func_orig(*args)
  File "/root/tools/w3af/w3af/plugins/crawl/web_spider.py", line 374, in _verify_reference
    if not is_404(resp):
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/fingerprint_404.py", line 412, in is_404
    return fp_404_db.is_404(http_response)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/not_found/decorators.py", line 123, in __call__
    return self._function(*args, **kwargs)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/not_found/decorators.py", line 58, in __call__
    result = self._function(*args, **kwargs)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/fingerprint_404.py", line 99, in is_404
    if self._is_404_complex(http_response):
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/fingerprint_404.py", line 186, in _is_404_complex
    known_404 = self._get_404_response(http_response, query, debugging_id)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/fingerprint_404.py", line 393, in _get_404_response
    debugging_id)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/not_found/generate_404.py", line 261, in send_request_generate_404
    url_404 = get_url_for_404_request(http_response, seed=seed)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/not_found/generate_404.py", line 280, in get_url_for_404_request
    relative_url = generate_404_filename(filename, seed=seed)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/not_found/generate_404.py", line 240, in generate_404_filename
    return generate_404_by_shuffle(orig_filename, extension, seed=seed)
  File "/root/tools/w3af/w3af/core/controllers/core_helpers/not_found/generate_404.py", line 135, in generate_404_by_shuffle
    mod_filename = ''.join(mod_filename)
TypeError: can only join an iterable

Source Code:

    mod_filename = random.shuffle(filename)
    mod_filename = ''.join(mod_filename)

Like many list methods, random.shuffle() , acts in-place , and therefore returns None. so mod_filename is therefore None, hence the error.

@andresriancho
Copy link
Owner

giphy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants