WEBVTT

00:00:00.540 --> 00:00:00.880
Okay,

00:00:00.880 --> 00:00:04.050
so now that we have a general idea of how the framework works

00:00:04.170 --> 00:00:06.750
now we want to actually start getting data.

00:00:07.140 --> 00:00:07.650
Now,

00:00:07.920 --> 00:00:13.450
Recon‑ng operates on this idea of transforming data into other kinds of data.

00:00:13.650 --> 00:00:18.740
So it may try to take a contact and transform it into a credential or take

00:00:18.790 --> 00:00:22.620
a domain and try to transform it into a list of hosts.

00:00:22.880 --> 00:00:23.690
But basically,

00:00:23.690 --> 00:00:25.990
what that requires is the implicit task here is that we

00:00:25.990 --> 00:00:27.890
need to have some data to start with.

00:00:28.240 --> 00:00:31.140
And so we have to provide the database with some seed data that it

00:00:31.140 --> 00:00:35.060
can then use as the starting point for some of these

00:00:35.060 --> 00:00:37.800
transformations that we're going to ask it to make.

00:00:38.780 --> 00:00:41.970
So what I think we'll do is we'll just start with a company.

00:00:42.330 --> 00:00:43.610
Let's just start with a company.

00:00:43.990 --> 00:00:46.780
And so the way that we add seed data is we're going to use a database command.

00:00:49.040 --> 00:00:50.880
And the database command has some options here.

00:00:50.880 --> 00:00:53.150
We can do a direct delete, a direct insert,

00:00:53.330 --> 00:00:55.620
we can add some notes to a particular row in the database,

00:00:55.620 --> 00:00:59.000
we can do a raw general query, or we can list out the schema.

00:00:59.000 --> 00:01:02.270
Now the schema command here will help us see what the database looks

00:01:02.270 --> 00:01:04.940
like so that we can better create raw queries.

00:01:05.090 --> 00:01:08.660
But the whole reason why the delete and insert commands exist here

00:01:09.060 --> 00:01:12.520
is to give you shortcuts for entering and removing data so you

00:01:12.520 --> 00:01:14.340
don't have to create raw SQL queries.

00:01:14.340 --> 00:01:15.260
So here, obviously,

00:01:15.340 --> 00:01:21.570
we're going to create data, so db insert. And it requires us to give it a table.

00:01:25.300 --> 00:01:26.040
And, by the way,

00:01:26.040 --> 00:01:29.240
there is also command completion here and the ability to do

00:01:29.240 --> 00:01:31.320
command history using the up arrow and down arrow.

00:01:31.320 --> 00:01:32.400
So those are nice features.

00:01:32.680 --> 00:01:34.790
And you may have noticed me doing some of that already.

00:01:35.300 --> 00:01:38.830
So we want a db insert and we're going to insert into companies table.

00:01:41.040 --> 00:01:44.480
And then it goes down line by line and will ask us what we want to

00:01:44.480 --> 00:01:46.790
put in each row in that particular database.

00:01:46.940 --> 00:01:49.490
So in this particular case I'm just going to put in the company text

00:01:50.910 --> 00:01:54.870
Pluralsight. Don't necessarily need a description.

00:01:55.890 --> 00:01:57.880
Don't necessarily need any notes at this point in time.

00:01:58.250 --> 00:02:00.400
And now we have a row of data.

00:02:00.520 --> 00:02:03.400
And if we want to see our data in the database we can use the show

00:02:03.400 --> 00:02:09.419
command to show us all of the companies. Now the show command is also a

00:02:09.419 --> 00:02:13.340
shortcut that gives us easy access to all of the different tables of

00:02:13.340 --> 00:02:16.180
data stored within Recon‑ng's database.

00:02:16.180 --> 00:02:16.810
So basically,

00:02:16.810 --> 00:02:19.130
it's just another macro that runs a select

00:02:19.130 --> 00:02:23.720
statement for all data within a table, and you just give it the table name.

00:02:24.310 --> 00:02:26.130
It does some other things as well,

00:02:26.260 --> 00:02:28.570
but that's beyond the scope of what we're talking about here.
