hansmach1ne / LFImap

Local File Inclusion discovery and exploitation tool
Apache License 2.0
194 stars 29 forks source link

Circular dependency in code #58

Closed nrathaus closed 1 week ago

nrathaus commented 4 weeks ago

There seems to be a circular dependency in the code that makes it impossible to load a module directly without the "main.py" code

This makes writing tests (pytest) impossible and probably affects also the stability of the code (debugging fails to properly jump to the right place due to this), the circular dependency can bee seen in:

    from src.attacks.pwn import pwn
src/attacks/pwn.py:2: in <module>
    from src.attacks.bash import exploit_bash
src/attacks/bash.py:1: in <module>
    from src.httpreqs import request
src/httpreqs/request.py:5: in <module>
    from src.attacks.pwn import pwn
E   ImportError: cannot import name 'pwn' from partially initialized module 'src.attacks.pwn' (most likely due to a circular import) (src/LFImap/src/attacks/pwn.py)

Its not limited to the pwn module importing, rather to anything that imports pwn in some code flow

I think it is a good idea to preform code cleanup so that this doesn't happen

nrathaus commented 3 weeks ago

Any plan to do the lint and dependency loop fixes?

It is hard to fix the code and improve it without making the code look easier and more cleanly (i.e. not long lines, using fstring, etc)

hansmach1ne commented 3 weeks ago

@nrathaus Yes, I am in the middle of pushing the update to fix some issues in the reverse shell handling and make it better. Once this updates are pushed, I will look into cleaning the code. Thanks for your inputs and interest and taking care for the LFImap code. :)

hansmach1ne commented 1 week ago

https://github.com/hansmach1ne/LFImap/pull/98