Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong relative file open #56

Closed
noraj opened this issue Nov 23, 2022 · 0 comments · Fixed by #57
Closed

Wrong relative file open #56

noraj opened this issue Nov 23, 2022 · 0 comments · Fixed by #57

Comments

@noraj
Copy link
Contributor

noraj commented Nov 23, 2022

Description

It seems clairvoyance is unable to detect its install dir and load the wordlist from here, instead it tries to load it from the working/current directory.

$ clairvoyance -o /tmp/dvga-schema.json http://noraj.test:5013/graphql
Traceback (most recent call last):
  File "/usr/bin/clairvoyance", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.10/site-packages/clairvoyance/cli.py", line 109, in cli
    asyncio.run(
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/lib/python3.10/site-packages/clairvoyance/cli.py", line 47, in blind_introspection
    wordlist = wordlist or load_default_wordlist()
  File "/usr/lib/python3.10/site-packages/clairvoyance/cli.py", line 33, in load_default_wordlist
    with open('clairvoyance/wordlist.txt', 'r', encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'clairvoyance/wordlist.txt'

So one has to use the -w option even to run the default wordlist.

$ clairvoyance -o /tmp/dvga-schema.json http://noraj.test:5013/graphql -w /usr/lib/python3.10/site-packages/clairvoyance/wordlist.txt 
2022-11-23 15:30:18     INFO    | Starting blind introspection on http://noraj.test:5013/graphql...

Troubleshooting

def load_default_wordlist() -> List[str]:
with open('clairvoyance/wordlist.txt', 'r', encoding='utf-8') as f:
return [w.strip() for w in f.readlines() if w.strip()]

I think is could be replaced by something like:

import os
os.path.join(os.path.dirname(__file__), 'wordlist.txt')

I'll PR.

noraj added a commit to noraj/clairvoyance that referenced this issue Nov 23, 2022
nikitastupin pushed a commit that referenced this issue Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant