guelfoweb / knock

Knock Subdomain Scan
GNU General Public License v3.0
3.76k stars 848 forks source link

Script does not function across symlinks #100

Open johnsaigle opened 3 years ago

johnsaigle commented 3 years ago

Hi! Thanks for putting in the time to update the script to use python3. I appreciate it.

Issue

I've installed 5.0.0 and I tried to create a symlink to the script. However, the script doesn't resolve the "real path" on the filesystem which means that it's not possible run the script via a symlink.

Solution

Wherever the script reads files (config.json, default wordlists, etc.), update the code to use os.path.realpath().

e,g. this line from knockpy.py could be changed from

    _ROOT = os.path.abspath(os.path.dirname(__file__))

to

    _ROOT = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))