Security-Tools-Alliance / rengine-ng

reNgine-ng is an automated reconnaissance framework for web applications with a focus on highly configurable streamlined recon process via Engines, recon data correlation and organization, continuous monitoring, backed by a database, and simple yet intuitive User Interface.
GNU General Public License v3.0
19 stars 8 forks source link

bug: Directories & files fuzzFailed, Error: KeyError('subdomain_id') #17

Closed psyray closed 2 months ago

psyray commented 4 months ago

Is there an existing issue for this?

Current Behavior

Reported by @zinwelzl & @burper00

Whlle fuzzing dir this error could occurs.

@burper000 submit a solution below, it needs tests

I fix it maybe please check it for is it really stable code? Change rEngine /web/reNgine/tasks.py in

Get subdomain and add dirscan

        if ctx['subdomain_id'] > 0:
            subdomain = Subdomain.objects.get(id=ctx['subdomain_id'])
        else:
            subdomain_name = get_subdomain_from_url(endpoint.http_url)
            subdomain = Subdomain.objects.get(name=subdomain_name, scan_history=self.scan)
        subdomain.directories.add(dirscan)
        subdomain.save()

to:

Get subdomain and add dirscan

        subdomain_id = ctx.get('subdomain_id')  

        if subdomain_id:  

                subdomain = Subdomain.objects.get(id=subdomain_id)

        else:

                subdomain_name = get_subdomain_from_url(endpoint.http_url)

                subdomain = Subdomain.objects.get(name=subdomain_name, scan_history=self.scan)

        subdomain.directories.add(dirscan)

        subdomain.save()

Its looks all of the problem script cant get subdomain_id key

Please make it fully fix I wait for new version.

Expected Behavior

Fuzzing should not fail, error should be catched

Steps To Reproduce

Not clear on original post, there's not a real url to test and make the bug happens. Need tests

Environment

- reNgine: Rengine 2.0.3
- OS: Kali 2024.01 fully updated.
- Python: 
- Docker Engine: 
- Docker Compose: 
- Browser:

Anything else?

No response

zinwelzl commented 4 months ago

make logs give me this, even with clean new installation 2.0.5

During handling of the above exception, another exception occurred: rengine-celery-1 | rengine-celery-1 | Traceback (most recent call last): rengine-celery-1 | File "/usr/local/lib/python3.10/dist-packages/celery/bin/celery.py", line 58, in convert rengine-celery-1 | return find_app(value) rengine-celery-1 | File "/usr/local/lib/python3.10/dist-packages/celery/app/utils.py", line 386, in find_app rengine-celery-1 | sym = imp(app) rengine-celery-1 | File "/usr/local/lib/python3.10/dist-packages/celery/utils/imports.py", line 109, in import_from_cwd rengine-celery-1 | return imp(module, package=package) rengine-celery-1 | File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module rengine-celery-1 | return _bootstrap._gcd_import(name[level:], package, level) rengine-celery-1 | File "", line 1050, in _gcd_import rengine-celery-1 | File "", line 1027, in _find_and_load rengine-celery-1 | File "", line 1006, in _find_and_load_unlocked rengine-celery-1 | File "", line 688, in _load_unlocked rengine-celery-1 | File "", line 879, in exec_module rengine-celery-1 | File "", line 1017, in get_code rengine-celery-1 | File "", line 947, in source_to_code rengine-celery-1 | File "", line 241, in _call_with_frames_removed rengine-celery-1 | File "/usr/src/app/reNgine/tasks.py", line 1740 rengine-celery-1 | subdomain = Subdomain.objects.get(id=subdomain_id) rengine-celery-1 | ^ rengine-celery-1 | TabError: inconsistent use of tabs and spaces in indentation rengine-celery-1 | ^Ccanceled make: *** [Makefile:50: logs] Interrupt

On Sun, Apr 21, 2024 at 8:21 PM Psyray @.***> wrote:

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Reported by @zinwelzl https://github.com/zinwelzl & @burper00 https://github.com/burper00

Whlle fuzzing dir this error could occurs.

@burper000 submit a solution below, it needs tests

I fix it maybe please check it for is it really stable code? Change rEngine /web/reNgine/tasks.py in Get subdomain and add dirscan

  if ctx['subdomain_id'] > 0:
      subdomain = Subdomain.objects.get(id=ctx['subdomain_id'])
  else:
      subdomain_name = get_subdomain_from_url(endpoint.http_url)
      subdomain = Subdomain.objects.get(name=subdomain_name, scan_history=self.scan)
  subdomain.directories.add(dirscan)
  subdomain.save()

to: Get subdomain and add dirscan

  subdomain_id = ctx.get('subdomain_id')

  if subdomain_id:

          subdomain = Subdomain.objects.get(id=subdomain_id)

  else:

          subdomain_name = get_subdomain_from_url(endpoint.http_url)

          subdomain = Subdomain.objects.get(name=subdomain_name, scan_history=self.scan)

  subdomain.directories.add(dirscan)

  subdomain.save()

Its looks all of the problem script cant get subdomain_id key

Please make it fully fix I wait for new version. Expected Behavior

Fuzzing should not fail, error should be catched Steps To Reproduce

Not clear on original post, there's not a real url to test and make the bug happens. Need tests Environment

  • reNgine: Rengine 2.0.3- OS: Kali 2024.01 fully updated.- Python: - Docker Engine: - Docker Compose: - Browser:

Anything else?

No response

— Reply to this email directly, view it on GitHub https://github.com/Security-Tools-Alliance/rengine-ng/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/A26O5PHFEEMPAWC2M3Q2Y4LY6RJXPAVCNFSM6AAAAABGRZNW6KVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TKMZUHAYDGMA . You are receiving this because you were mentioned.Message ID: @.***>