Hello and welcome to the Mainland
BASIX, this module will cover
Windows Net commands.
I'm Christopher Haler.
And let's begin.
So the learning objectives for this
module is we're going to learn the
capabilities of the net command
and users from the command line
create groups, start and stop
services.
And remote file shares
are precise.
Which command is used to mount a
remote share?
Is it a net remote?
Be net share, see
net use or D
net file?
The answer is C net
use.
So the net use command is going
to use a drive letter to
help mount a remote share.
And this is something that you will
see commonly inside of
from a sysadmin perspective for
a Windows network.
The net remote net
share and net file are all
different, different types of
purposes for the net command that we
can learn
aren't so interested in
the net command.
This is a very, very
strong command for the Windows
command line and has
all sorts of different functions.
We can add users at groups,
start or stop services and connect
to other computers.
And one that sounds very,
very useful.
It's very strong and
it's very helpful from a sysadmin
perspective where we can
create these computers and have them
running smoothly together and
talking to each other and be able to
utilize these functions.
But at the same time, it is also
a very soon after and
a very highly used command
for penetration testers,
hackers and nation
state actors as well.
So you will see
the net command is used pretty
heavily offensively as well,
where if a
Windows host is compromised,
a actor
can use the net use command
to mount a remote file share
to another workstation
and try to pivot into
a separate machine
to exploit a network further.
So that's why this command is very
important to understand.
And if you're
going into the ethical hacking side
of the House, that absolutely need
to know how to use this command to
pivot through a network.
All right. So adding users, we can
do net user space,
user name, space password.
And if you have a list of five
hundred users, this can be automated
as well.
So let me give you a quick
demonstration of that.
So just like any other comment,
we're going to do net
questionmark.
And we have all sorts of different
options we can do so
the net command has different
flavors inside of it.
So since we are looking
for that user,
let's say net user
slash, questionmark.
And this gives us more info about
the net user command and how we use
that.
So let's say net
user knew
and the password will be
passed
and my username could
not be found.
I need to do. And
that is why
ad
and access is denied.
I believe it is because I'm not on
a domain controller.
But regardless if you are in a
command control, that is how that
works.
All right. So adding groups
very similar to the users, we would
do net group and then a group
name you can do and
add user names or slash delete
to delete user names from a group
that's going to be very similar.
You can look through the help
documentation as well.
Starting and stopping services,
so this is something you'll see a
lot of, especially from the
penetration testing side where you
will start a service or stop a
service depending on
the different kind of attack you're
trying to begin
or service you're trying to exploit.
So this can
be used to list services as well.
I'll give you a quick demonstration
of that.
Let's say net start,
and this will give us a
big list of services
that are already started.
And like you were saying before, we
can pipe this into a more
that way we can read
through line by line before it goes
flying past our face.
So now let's
see, which service should we stop?
Let's say
I don't want to end the power
service right now, at least,
let's say Windows event logs.
So net stop.
And since there are spaces,
we're going to put this in quotes,
one news event
log
enter.
All right.
And stopping the one is
event log service will also stop
these services.
Well, yeah, sure.
Let's give that a shot.
Access is denied.
Oh, boy.
All right.
Well, that's how you would stop
the service.
And then the same way to start the
service as well.
All right.
And then net use.
We can use the net use command
to connect to a remote file share.
And like I was saying before, this
is a very common way to pivot
between use your computers
to exploit a network
as a penetration test or a hacker.
So one example would be the net
use and then you have to put in the
drive later you're going to use and
then the remote file share.
So let me show you
what I have
to share.
So this shows my current shares
on my computer right now.
So we have to see the
IPC print admin and
user's folders that are all shared
out. So I want to connect and
mount A to the D
drive so we and
do net use
slash question mark first so we can
always see how to use this command
net use and then we need
the device name.
I am going to do device
K.
All right. And then.
Restack laptop.
Thanks, D
All right, says Comen, completed
successfully.
Let's take a look and
check it out. I have a mapped
network drive that
is actually on my drive.
And to delete it,
it's going to be the same command,
except we'll just put a slash
delete, as you can see right here.
All right. So let's say net use,
and we don't need to put in the full
file path and just
say, OK, delete
and says K was deleted successfully.
Let's take a look.
And it is gone great.
So that is how we can attach
and remove remote files.
All right. Post assessment,
what actions can not be done within
that command?
Said a connect to other computers
be create admin accounts
C start or stop services
or shut down a computer.
The answer is D shut down a
computer. There is actually the
shut down command that can be used
to shut down the computer.
And like I was saying before, the
the net command can be used to
connect to other computers, create
new accounts and start or stop
services.
All right, so in this video, we
learned the capabilities of the net
command, how to add users from the
command line, create groups, share
local files and map remote
file shares.
And I hope to see you in the next
video.