[Autogenerated] in the last demo of this short course we're
going to search for vulnerability using the API and we're going
to access the API using the to curl.
Let's go back to our console on this system.
I have to to curl installed and curl is a tool which
allows you to perform API queries.
You can also use any other tool which performs just basic web requests.
Let me check whether curls installed here using curl dash dash version.
Great curls installed.
Let's clear the screen and now let's request an api call and
search for open ssl within the CV entries just as we did in the
previous demo using the web interface.
I'm going to use the command curl and then the URL endpoint which
was open c v e ports 8000 and now we're going to use the API to
search for a term and the API can be found on slash API We are
searching for a specific CV entry and the syntax for that is slash
cv and then the question mark,
search and then the term we're searching for open
ssl let's see whether this works.
Huh?
We get a message back authentication required So even though the weapon to face
can be accessed without logging in the API can only be used using valid user
accounts so what we can do is repeat the previous command but then specify the
user account that we created previously.
Let's copy the last command and now let's add the dash U parameter
which specifies the username girl asked for our password and if we
specify our password then we get results back.
And as you can see this is Jason and this is exactly the same
surgery sold as we saw previously using the weapons or face
just for demonstration purposes.
Let's beautify this by typing this output through JQ which
is a tool which can beautify JSON output.
You can really see what the answer is from the API So
let's repeat the previous command.
Let's pipe it through to J.
Q which is also installed in the system with a dot as you want to beautify
the whole JSON structure that specify your password.
This makes it a little bit more legible.
You can see the response from our API endpoint in other words,
using a standard API coal by using the tool curl we can get JSON
results back by searching for a specific term in this instance open
ssl on the webpage dot opencv dot io slash API You can find much more
information about how to use the API and as the page also says the
API is currently in beta.
Therefore some syntax may change over time.
The API however,
can be a great way how to use your local database containing cV entries to
search for specific vulnerabilities for products or vendors in the next clip
let's summarize what we've learned so far about opencVV