12-19-2017 08:10 AM
Hello,
I tried to launch openVulnQuery from GIT clone and I have following error:
(venv) root@kali:/opt/openVulnAPI/openVulnQuery/openVulnQuery# python main.py --config /opt/openVulnAPI/credentials.json --cvrf --all Traceback (most recent call last):
File "main.py", line 4, in <module>
main()
File "/opt/openVulnAPI/openVulnQuery/openVulnQuery/_library/main.py", line 45, in main
args = cli_api.process_command_line(string_list)
File "/opt/openVulnAPI/openVulnQuery/openVulnQuery/_library/cli_api.py", line 304, in process_command_line
parsed_config = json.load(open(args.json_config_path))
File "/usr/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 2 column 2 (char 3)
My credential file:
{
CLIENT_ID='dflsdkfmsdfkmsdfksmfk'
SECRET_ID='dsflmksdfmlskdfml'
}
From PIP, openVulnQuery does not include --config parameter.
Any idea ?
Regards
Solved! Go to Solution.
04-07-2018 08:20 PM
Hi Andrei,
If you installed the client using pip, please enter your client credentials in the config.py file, as shown below:
STEP 1: Locate the installation directory using the pip show openVulnQuery command. as shown below:
$ pip show openVulnQuery
Name: OpenVulnQuery
Version: 1.25
Summary: A python-based module(s) to query the Cisco PSIRT openVuln API.
...
Location: /usr/local/lib/python2.7/dist-packages
STEP 2: Change to the installation directory. In the example below, the library was installed under /usr/local/lib/python2.7/dist-packages. The openVulnQuery sub-directory should reside there:
$ cd /usr/local/lib/python2.7/dist-packages/openVulnQuery/
STEP 3: Edit the config.py file with your favorite editor.
$ vi config.py
The contents of the config.py file should be:
CLIENT_ID = " <enter your client ID here> "
CLIENT_SECRET = "<enter your client secret here>"
REQUEST_TOKEN_URL = "https://cloudsso.cisco.com/as/token.oauth2"
API_URL = "https://api.cisco.com/security/advisories"
STEP 4: Save the config.py file. You should be able to make queries now.
Hope this helps...
- Omar
04-07-2018 09:53 AM
Same question here. Did pip install openVulnQuery. Cannot figure out how to pass my credentials. As per https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery: "OpenVulnQuery --config PathToCredentialsFile
" However I get: openVulnQuery: error: unrecognized arguments: --config...
When trying to run it without the --config argument, I get: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://cloudsso.cisco.com/as/token.oauth2?client_secret=&client_id=
Could anyone please look into this issue?
04-07-2018 08:20 PM
Hi Andrei,
If you installed the client using pip, please enter your client credentials in the config.py file, as shown below:
STEP 1: Locate the installation directory using the pip show openVulnQuery command. as shown below:
$ pip show openVulnQuery
Name: OpenVulnQuery
Version: 1.25
Summary: A python-based module(s) to query the Cisco PSIRT openVuln API.
...
Location: /usr/local/lib/python2.7/dist-packages
STEP 2: Change to the installation directory. In the example below, the library was installed under /usr/local/lib/python2.7/dist-packages. The openVulnQuery sub-directory should reside there:
$ cd /usr/local/lib/python2.7/dist-packages/openVulnQuery/
STEP 3: Edit the config.py file with your favorite editor.
$ vi config.py
The contents of the config.py file should be:
CLIENT_ID = " <enter your client ID here> "
CLIENT_SECRET = "<enter your client secret here>"
REQUEST_TOKEN_URL = "https://cloudsso.cisco.com/as/token.oauth2"
API_URL = "https://api.cisco.com/security/advisories"
STEP 4: Save the config.py file. You should be able to make queries now.
Hope this helps...
- Omar
04-08-2018 01:15 AM
Hi Omar,
Thank you very much!
Kind regards,
Andrei
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide