Script does not function across symlinks
johnsaigle opened this issue · comments
John Saigle commented
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__)))