WEBVTT

00:00:00.000 --> 00:00:03.374 align:middle line:90%


00:00:03.374 --> 00:00:05.302 align:middle line:90%
[ELECTRONIC NOISES]

00:00:05.302 --> 00:00:10.140 align:middle line:90%


00:00:10.140 --> 00:00:14.130 align:middle line:84%
Creating and managing
workspaces with MSF console--

00:00:14.130 --> 00:00:17.070 align:middle line:84%
so what are workspaces,
and why are they

00:00:17.070 --> 00:00:20.340 align:middle line:84%
so important in relation
to the Metasploit framework

00:00:20.340 --> 00:00:24.760 align:middle line:84%
and furthermore in relation to
penetration testing as a whole?

00:00:24.760 --> 00:00:28.080 align:middle line:84%
Well, workspaces allow you to
keep track of all your hosts,

00:00:28.080 --> 00:00:31.410 align:middle line:84%
scans, and activities and
are extremely useful when

00:00:31.410 --> 00:00:33.600 align:middle line:84%
conducting penetration
tests as they

00:00:33.600 --> 00:00:36.450 align:middle line:84%
allow you to sort and organize
your data based on the target

00:00:36.450 --> 00:00:37.720 align:middle line:90%
or organization.

00:00:37.720 --> 00:00:40.770 align:middle line:84%
So with every framework
or with every tool

00:00:40.770 --> 00:00:43.980 align:middle line:84%
that you'll be utilizing
to perform penetration

00:00:43.980 --> 00:00:47.370 align:middle line:84%
testing in the context of
the Metasploit framework,

00:00:47.370 --> 00:00:50.460 align:middle line:84%
you will be performing
a lot of actions,

00:00:50.460 --> 00:00:52.980 align:middle line:84%
or you'll be performing
a lot of activity.

00:00:52.980 --> 00:00:55.230 align:middle line:84%
And when I speak of
activity, what I mean

00:00:55.230 --> 00:00:57.450 align:middle line:84%
is you will be running
various modules.

00:00:57.450 --> 00:00:59.820 align:middle line:84%
You'll be scanning
various targets.

00:00:59.820 --> 00:01:01.950 align:middle line:84%
You will be exploiting
multiple targets.

00:01:01.950 --> 00:01:04.830 align:middle line:84%
And all of this data
is, again, going

00:01:04.830 --> 00:01:07.680 align:middle line:84%
to be stored by the
Metasploit framework.

00:01:07.680 --> 00:01:12.600 align:middle line:84%
But it will be stored by default
within the default workspace.

00:01:12.600 --> 00:01:15.000 align:middle line:84%
And, again, this is
really not a good thing

00:01:15.000 --> 00:01:19.740 align:middle line:84%
because if you perform more than
one assessment for a company

00:01:19.740 --> 00:01:23.100 align:middle line:84%
or for a client,
all that data if you

00:01:23.100 --> 00:01:25.710 align:middle line:84%
use the default workspace
will be stored together.

00:01:25.710 --> 00:01:27.250 align:middle line:90%
And it's really not sorted out.

00:01:27.250 --> 00:01:30.150 align:middle line:84%
So for each engagement
or for every engagement,

00:01:30.150 --> 00:01:33.240 align:middle line:84%
I would recommend that
you create a new workspace

00:01:33.240 --> 00:01:36.360 align:middle line:84%
so that that data is separated
from your previous engagements

00:01:36.360 --> 00:01:37.350 align:middle line:90%
or assessments.

00:01:37.350 --> 00:01:39.990 align:middle line:84%
That's very, very important
even in penetration testing.

00:01:39.990 --> 00:01:42.450 align:middle line:84%
You never want to mix
results or you never

00:01:42.450 --> 00:01:46.450 align:middle line:84%
want to mix data with from
one company with another.

00:01:46.450 --> 00:01:48.150 align:middle line:84%
So, again, that's
very, very important,

00:01:48.150 --> 00:01:50.730 align:middle line:84%
and that's where
workspaces come into play.

00:01:50.730 --> 00:01:53.670 align:middle line:84%
Now, the Metasploit framework
console, or MSF console,

00:01:53.670 --> 00:01:56.320 align:middle line:84%
provides you with the
ability to create, manage,

00:01:56.320 --> 00:01:58.470 align:middle line:84%
and switch between
multiple workspaces

00:01:58.470 --> 00:01:59.940 align:middle line:90%
depending on your requirements.

00:01:59.940 --> 00:02:02.910 align:middle line:84%
And we are going to take
a look at how to, again,

00:02:02.910 --> 00:02:04.440 align:middle line:90%
do what I've just said.

00:02:04.440 --> 00:02:06.900 align:middle line:84%
So we'll take a look at how
to create a new workspace,

00:02:06.900 --> 00:02:08.940 align:middle line:84%
how to switch
between workspaces,

00:02:08.940 --> 00:02:10.770 align:middle line:90%
and how to delete workspaces.

00:02:10.770 --> 00:02:13.710 align:middle line:84%
Now, the second question that
you may be asking yourself

00:02:13.710 --> 00:02:16.530 align:middle line:84%
is, where is all of
this data stored?

00:02:16.530 --> 00:02:19.860 align:middle line:84%
And as I've mentioned
within the previous videos,

00:02:19.860 --> 00:02:23.220 align:middle line:84%
all the data pertinent to
the Metasploit framework

00:02:23.220 --> 00:02:25.890 align:middle line:84%
and the MSF console
is going to be

00:02:25.890 --> 00:02:29.980 align:middle line:84%
stored within the MSF DB, the
Metasploit framework database.

00:02:29.980 --> 00:02:36.390 align:middle line:84%
So, again, in order for you
to create workspaces and store

00:02:36.390 --> 00:02:38.280 align:middle line:84%
data within each
of these workspaces

00:02:38.280 --> 00:02:41.160 align:middle line:84%
and have that data
persistent across restarts,

00:02:41.160 --> 00:02:43.530 align:middle line:84%
you need to make sure that
the Metasploit framework

00:02:43.530 --> 00:02:47.340 align:middle line:84%
console is connected to the
Metasploit framework database.

00:02:47.340 --> 00:02:50.370 align:middle line:84%
And we've already covered
that particular section

00:02:50.370 --> 00:02:53.770 align:middle line:84%
within the Metasploit
framework installation video.

00:02:53.770 --> 00:02:57.090 align:middle line:84%
So make sure to check that
out if you haven't connected

00:02:57.090 --> 00:02:59.610 align:middle line:84%
your Metasploit framework
database to the Metasploit

00:02:59.610 --> 00:03:00.750 align:middle line:90%
framework console.

00:03:00.750 --> 00:03:02.970 align:middle line:84%
So we will be
utilizing workspaces

00:03:02.970 --> 00:03:04.687 align:middle line:84%
to organize our
assessments as we

00:03:04.687 --> 00:03:05.895 align:middle line:90%
progress through this course.

00:03:05.895 --> 00:03:09.180 align:middle line:84%
So for every exploitation
or for every new target

00:03:09.180 --> 00:03:11.160 align:middle line:84%
that we are going to
be taking a look at,

00:03:11.160 --> 00:03:13.290 align:middle line:84%
we will be sorting
them or performing

00:03:13.290 --> 00:03:16.320 align:middle line:84%
all of the operations
within its own workspace.

00:03:16.320 --> 00:03:18.210 align:middle line:84%
So without further
ado, let's actually

00:03:18.210 --> 00:03:20.850 align:middle line:84%
take a look at how this
is done practically.

00:03:20.850 --> 00:03:24.980 align:middle line:90%
I'll see you back on my Kali VM.

00:03:24.980 --> 00:03:29.208 align:middle line:84%
So I'm back on my VM, and let
me just switch to a full screen.

00:03:29.208 --> 00:03:29.750 align:middle line:90%
There we are.

00:03:29.750 --> 00:03:32.990 align:middle line:84%
So I have already initiated the
Metasploit framework console,

00:03:32.990 --> 00:03:34.290 align:middle line:90%
and we can begin.

00:03:34.290 --> 00:03:36.380 align:middle line:84%
So the first thing, as I
said, that you want to do

00:03:36.380 --> 00:03:38.930 align:middle line:84%
is to check the status
of the database.

00:03:38.930 --> 00:03:42.140 align:middle line:84%
And that can be done
by typing in db_status.

00:03:42.140 --> 00:03:44.360 align:middle line:84%
And it should tell
us, "Connected to msf.

00:03:44.360 --> 00:03:45.950 align:middle line:90%
Connection type, postgresql."

00:03:45.950 --> 00:03:47.930 align:middle line:90%
So everything's good there.

00:03:47.930 --> 00:03:49.700 align:middle line:90%
So let's talk about workspaces.

00:03:49.700 --> 00:03:52.700 align:middle line:84%
Now, in order for us to
interact with workspaces,

00:03:52.700 --> 00:03:55.940 align:middle line:84%
we can simply type the
workspace command, so workspace.

00:03:55.940 --> 00:03:58.190 align:middle line:84%
And we can use
Tab+Alt completion.

00:03:58.190 --> 00:04:00.330 align:middle line:84%
And if you want to
open up the Help menu,

00:04:00.330 --> 00:04:03.350 align:middle line:84%
you can use the -h option,
and that will tell you

00:04:03.350 --> 00:04:05.930 align:middle line:84%
how to go about switching
between a workspace,

00:04:05.930 --> 00:04:07.670 align:middle line:90%
listing workspaces, et cetera.

00:04:07.670 --> 00:04:11.900 align:middle line:84%
So in this case, if we type
in workspace and we hit Enter,

00:04:11.900 --> 00:04:14.630 align:middle line:84%
you can see that we have
the default workspace.

00:04:14.630 --> 00:04:17.510 align:middle line:84%
And it's currently
selected and highlighted

00:04:17.510 --> 00:04:20.579 align:middle line:84%
by the little asterisk
option right over here.

00:04:20.579 --> 00:04:22.280 align:middle line:84%
So that's how you
tell what workspace

00:04:22.280 --> 00:04:23.610 align:middle line:90%
you're currently working in.

00:04:23.610 --> 00:04:26.220 align:middle line:84%
So that is the default
workspace that we're currently

00:04:26.220 --> 00:04:26.720 align:middle line:90%
working in.

00:04:26.720 --> 00:04:30.470 align:middle line:84%
And as an example, we already
have data within this workspace

00:04:30.470 --> 00:04:33.950 align:middle line:84%
as we essentially took
a look at a few modules

00:04:33.950 --> 00:04:35.060 align:middle line:90%
in the previous video.

00:04:35.060 --> 00:04:37.430 align:middle line:84%
If I say hosts
and hit Enter, you

00:04:37.430 --> 00:04:39.830 align:middle line:84%
can see that my
router IP address

00:04:39.830 --> 00:04:41.180 align:middle line:90%
has been added as a host.

00:04:41.180 --> 00:04:44.300 align:middle line:84%
And that's really the fantastic
thing about the Metasploit

00:04:44.300 --> 00:04:46.860 align:middle line:84%
framework is it tracks
all of your data

00:04:46.860 --> 00:04:49.640 align:middle line:84%
so that if you ever
want to go back in time

00:04:49.640 --> 00:04:52.520 align:middle line:84%
or actually check out your
history in regards to the hosts

00:04:52.520 --> 00:04:54.740 align:middle line:84%
that you did scan or
that you did exploit,

00:04:54.740 --> 00:04:56.630 align:middle line:90%
you can always do that.

00:04:56.630 --> 00:05:00.078 align:middle line:84%
So this is the data that's being
stored in my current workspace,

00:05:00.078 --> 00:05:01.370 align:middle line:90%
which is the default workspace.

00:05:01.370 --> 00:05:03.350 align:middle line:84%
If I want to create
a new workspace,

00:05:03.350 --> 00:05:07.810 align:middle line:84%
I can essentially say
workspace a, so workspace

00:05:07.810 --> 00:05:10.880 align:middle line:84%
and then I say -a and then
provide it with a name.

00:05:10.880 --> 00:05:13.970 align:middle line:84%
So let's say I
provide a name like--

00:05:13.970 --> 00:05:14.470 align:middle line:90%
let's see.

00:05:14.470 --> 00:05:16.510 align:middle line:90%
We are testing for--

00:05:16.510 --> 00:05:18.400 align:middle line:84%
we can just call it
test for the time being.

00:05:18.400 --> 00:05:19.810 align:middle line:90%
So I create a new workspace.

00:05:19.810 --> 00:05:20.410 align:middle line:90%
There we are.

00:05:20.410 --> 00:05:24.640 align:middle line:84%
We added a workspace, test, and
the workspace we're currently

00:05:24.640 --> 00:05:25.420 align:middle line:90%
in is test.

00:05:25.420 --> 00:05:28.120 align:middle line:84%
So if we say workspace
and hit Enter,

00:05:28.120 --> 00:05:30.940 align:middle line:84%
you can see we are currently
within the test workspace.

00:05:30.940 --> 00:05:32.440 align:middle line:84%
It's going to be
highlighted red,

00:05:32.440 --> 00:05:36.370 align:middle line:84%
and the asterisk should be right
beside the currently active

00:05:36.370 --> 00:05:37.210 align:middle line:90%
workspace.

00:05:37.210 --> 00:05:40.030 align:middle line:84%
So now if we say
hosts and hit Enter,

00:05:40.030 --> 00:05:41.980 align:middle line:84%
you can see we
don't have any data.

00:05:41.980 --> 00:05:44.500 align:middle line:84%
This is a fresh
workspace with no data.

00:05:44.500 --> 00:05:46.720 align:middle line:84%
And we can, again,
go ahead and start

00:05:46.720 --> 00:05:48.490 align:middle line:90%
working within this workspace.

00:05:48.490 --> 00:05:51.970 align:middle line:84%
What if we want to switch
back to the default workspace?

00:05:51.970 --> 00:05:55.390 align:middle line:84%
So we can do that really simply
by saying workspace and then

00:05:55.390 --> 00:05:57.880 align:middle line:84%
providing the name of the
workspace, which in this case

00:05:57.880 --> 00:05:59.680 align:middle line:90%
is default. Hit Enter.

00:05:59.680 --> 00:06:02.950 align:middle line:84%
If we now say hosts, you can
see that I have the IP address

00:06:02.950 --> 00:06:07.070 align:middle line:84%
that I scanned right over here
within the default workspace.

00:06:07.070 --> 00:06:09.250 align:middle line:84%
So you can see how
useful this is.

00:06:09.250 --> 00:06:12.070 align:middle line:84%
Now, in the context of
a penetration test, what

00:06:12.070 --> 00:06:15.190 align:middle line:84%
would make sense is if we
said workspace and then

00:06:15.190 --> 00:06:18.430 align:middle line:84%
create a new workspace and then
maybe provide the company name.

00:06:18.430 --> 00:06:23.710 align:middle line:84%
So for example, we can provide
a simple company name maybe

00:06:23.710 --> 00:06:24.580 align:middle line:90%
like INE.

00:06:24.580 --> 00:06:25.420 align:middle line:90%
We hit Enter.

00:06:25.420 --> 00:06:28.300 align:middle line:84%
That's going to create
the workspace called INE.

00:06:28.300 --> 00:06:30.790 align:middle line:84%
And then of course, we
can simply say workspace.

00:06:30.790 --> 00:06:33.100 align:middle line:84%
And we're currently
within the INE workspace.

00:06:33.100 --> 00:06:35.830 align:middle line:84%
And we can switch between
all the other workspaces

00:06:35.830 --> 00:06:37.900 align:middle line:90%
by simply providing their name.

00:06:37.900 --> 00:06:40.210 align:middle line:90%
So we say workspace test.

00:06:40.210 --> 00:06:40.795 align:middle line:90%
There we are.

00:06:40.795 --> 00:06:44.470 align:middle line:84%
We can then change again
to workspace default.

00:06:44.470 --> 00:06:47.810 align:middle line:84%
There we are, back to default.
So it really is very simple.

00:06:47.810 --> 00:06:49.720 align:middle line:84%
If we want to delete
a workspace which

00:06:49.720 --> 00:06:52.160 align:middle line:90%
is, again, very, very useful--

00:06:52.160 --> 00:06:55.030 align:middle line:84%
let's say we want to delete the
test workspace because, again,

00:06:55.030 --> 00:06:56.680 align:middle line:90%
we just created it for a test.

00:06:56.680 --> 00:07:00.790 align:middle line:84%
We can go ahead and say
workspace -d and then

00:07:00.790 --> 00:07:04.060 align:middle line:84%
provide the name, which in this
case is test, and hit Enter.

00:07:04.060 --> 00:07:05.950 align:middle line:90%
There we are, deleted workspace.

00:07:05.950 --> 00:07:09.100 align:middle line:84%
And if we, again, list
out our workspaces,

00:07:09.100 --> 00:07:12.410 align:middle line:84%
you can see that the test
workspace has been deleted.

00:07:12.410 --> 00:07:15.970 align:middle line:84%
So, again, creating
and managing workspaces

00:07:15.970 --> 00:07:18.700 align:middle line:84%
is fairly simple, but
really, really important.

00:07:18.700 --> 00:07:21.040 align:middle line:84%
As I said, we are going
to be creating workspaces

00:07:21.040 --> 00:07:24.190 align:middle line:84%
for every assessment that we
do so that the results are

00:07:24.190 --> 00:07:28.190 align:middle line:84%
differentiated and are kept
aside or apart from each other.

00:07:28.190 --> 00:07:31.400 align:middle line:84%
So, again, this is very,
very useful and very,

00:07:31.400 --> 00:07:32.120 align:middle line:90%
very important.

00:07:32.120 --> 00:07:36.747 align:middle line:84%
So, again, as I said, it's very,
very simple to do all of this.

00:07:36.747 --> 00:07:38.330 align:middle line:84%
And, again, if you
want to learn more,

00:07:38.330 --> 00:07:40.450 align:middle line:84%
you can always check
the documentation

00:07:40.450 --> 00:07:41.830 align:middle line:90%
for the workspace command.

00:07:41.830 --> 00:07:45.550 align:middle line:84%
And you can see we've
pretty much done, again,

00:07:45.550 --> 00:07:48.130 align:middle line:84%
what we were supposed to
do apart from a fact--

00:07:48.130 --> 00:07:51.640 align:middle line:84%
apart from the option to
rename the workspace, which

00:07:51.640 --> 00:07:52.690 align:middle line:90%
we can actually do now.

00:07:52.690 --> 00:07:55.420 align:middle line:84%
So for example, if we want
to rename a workspace,

00:07:55.420 --> 00:08:01.120 align:middle line:84%
we can say rename INE to
maybe something like INE.

00:08:01.120 --> 00:08:03.440 align:middle line:84%
Or rather, we can
say PTA, for example.

00:08:03.440 --> 00:08:04.990 align:middle line:90%
So rename that to PTA.

00:08:04.990 --> 00:08:07.000 align:middle line:84%
And then if we say
workspaces, you

00:08:07.000 --> 00:08:08.530 align:middle line:90%
can see it's renamed to PTA.

00:08:08.530 --> 00:08:11.260 align:middle line:90%
So that's very, very useful.

00:08:11.260 --> 00:08:13.870 align:middle line:84%
So that is going
to be it in regards

00:08:13.870 --> 00:08:15.800 align:middle line:90%
to this practical demonstration.

00:08:15.800 --> 00:08:18.940 align:middle line:84%
I'm just going to switch
back to the slides.

00:08:18.940 --> 00:08:22.660 align:middle line:84%
So that was essentially how to
create and manage workspaces.

00:08:22.660 --> 00:08:24.500 align:middle line:84%
As I said, they're are
very, very important.

00:08:24.500 --> 00:08:28.660 align:middle line:84%
They help you sort and organize
your data and your assessments.

00:08:28.660 --> 00:08:31.630 align:middle line:84%
And in the next video,
we'll begin the process

00:08:31.630 --> 00:08:34.600 align:middle line:84%
of essentially performing
information gathering

00:08:34.600 --> 00:08:37.000 align:middle line:84%
and enumeration with the
Metasploit framework.

00:08:37.000 --> 00:08:40.299 align:middle line:84%
And we'll also be exploring
the various modules

00:08:40.299 --> 00:08:42.520 align:middle line:84%
that are utilized for
information gathering

00:08:42.520 --> 00:08:45.310 align:middle line:84%
and how we can import data
from third-party tools

00:08:45.310 --> 00:08:46.750 align:middle line:90%
into the Metasploit framework.

00:08:46.750 --> 00:08:50.160 align:middle line:84%
So I'll be seeing you
in the next video.