knock icon indicating copy to clipboard operation
knock copied to clipboard

Script does not function across symlinks

Open johnsaigle opened this issue 3 years ago • 0 comments

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__)))

johnsaigle avatar Mar 26 '21 14:03 johnsaigle