WEBVTT

00:00:01.520 --> 00:00:04.520
[Autogenerated] in the last demo of this short course we're

00:00:04.520 --> 00:00:09.150
going to search for vulnerability using the API and we're going

00:00:09.150 --> 00:00:12.020
to access the API using the to curl.

00:00:13.000 --> 00:00:18.230
Let's go back to our console on this system.

00:00:18.230 --> 00:00:21.990
I have to to curl installed and curl is a tool which

00:00:21.990 --> 00:00:24.530
allows you to perform API queries.

00:00:24.950 --> 00:00:29.580
You can also use any other tool which performs just basic web requests.

00:00:31.260 --> 00:00:35.400
Let me check whether curls installed here using curl dash dash version.

00:00:35.880 --> 00:00:37.560
Great curls installed.

00:00:37.670 --> 00:00:42.530
Let's clear the screen and now let's request an api call and

00:00:42.530 --> 00:00:47.760
search for open ssl within the CV entries just as we did in the

00:00:47.760 --> 00:00:50.390
previous demo using the web interface.

00:00:50.880 --> 00:00:55.160
I'm going to use the command curl and then the URL endpoint which

00:00:55.160 --> 00:01:00.730
was open c v e ports 8000 and now we're going to use the API to

00:01:00.740 --> 00:01:05.910
search for a term and the API can be found on slash API We are

00:01:05.910 --> 00:01:10.910
searching for a specific CV entry and the syntax for that is slash

00:01:10.920 --> 00:01:12.840
cv and then the question mark,

00:01:12.850 --> 00:01:16.140
search and then the term we're searching for open

00:01:16.140 --> 00:01:19.320
ssl let's see whether this works.

00:01:21.360 --> 00:01:21.890
Huh?

00:01:22.440 --> 00:01:28.880
We get a message back authentication required So even though the weapon to face

00:01:28.890 --> 00:01:35.690
can be accessed without logging in the API can only be used using valid user

00:01:35.690 --> 00:01:41.410
accounts so what we can do is repeat the previous command but then specify the

00:01:41.410 --> 00:01:44.140
user account that we created previously.

00:01:44.150 --> 00:01:49.280
Let's copy the last command and now let's add the dash U parameter

00:01:49.290 --> 00:01:55.470
which specifies the username girl asked for our password and if we

00:01:55.470 --> 00:01:59.060
specify our password then we get results back.

00:01:59.760 --> 00:02:03.930
And as you can see this is Jason and this is exactly the same

00:02:03.930 --> 00:02:08.190
surgery sold as we saw previously using the weapons or face

00:02:09.090 --> 00:02:10.810
just for demonstration purposes.

00:02:10.820 --> 00:02:15.970
Let's beautify this by typing this output through JQ which

00:02:15.970 --> 00:02:18.680
is a tool which can beautify JSON output.

00:02:18.690 --> 00:02:23.200
You can really see what the answer is from the API So

00:02:23.200 --> 00:02:25.210
let's repeat the previous command.

00:02:25.710 --> 00:02:27.410
Let's pipe it through to J.

00:02:27.410 --> 00:02:33.510
Q which is also installed in the system with a dot as you want to beautify

00:02:33.510 --> 00:02:37.370
the whole JSON structure that specify your password.

00:02:38.900 --> 00:02:41.240
This makes it a little bit more legible.

00:02:41.250 --> 00:02:46.020
You can see the response from our API endpoint in other words,

00:02:46.060 --> 00:02:52.330
using a standard API coal by using the tool curl we can get JSON

00:02:52.330 --> 00:02:57.720
results back by searching for a specific term in this instance open

00:02:57.720 --> 00:03:06.410
ssl on the webpage dot opencv dot io slash API You can find much more

00:03:06.410 --> 00:03:12.060
information about how to use the API and as the page also says the

00:03:12.060 --> 00:03:13.850
API is currently in beta.

00:03:13.860 --> 00:03:17.570
Therefore some syntax may change over time.

00:03:19.100 --> 00:03:20.340
The API however,

00:03:20.340 --> 00:03:26.110
can be a great way how to use your local database containing cV entries to

00:03:26.110 --> 00:03:33.300
search for specific vulnerabilities for products or vendors in the next clip

00:03:33.430 --> 00:03:37.060
let's summarize what we've learned so far about opencVV
