Time
5 hours 21 minutes
Difficulty
Beginner
CEU/CPE
6

Video Transcription

00:00
right. Hello and welcome to command line Basics. This module will cover one knows Net commands. I'm Christopher Hyler and this begin.
00:09
So the learning objectives for this module is we're gonna learn the capabilities of the Net command. Add users from the command line, create groups, start and stop Service's and mount remote file shares
00:22
aren't pre assessment. Which command is used to mount a remote share? Is it a net remote?
00:28
Be net share C net use or D Net file.
00:34
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 Assist agnan Perspective Free one. There's nowhere
00:50
The net remote net share and that file are all different. Different types of purposes for the next command that we can learn
01:00
aren't so enter to the Net command. This is a very, very strong command for the Windows Command line.
01:08
It has all sorts of different functions. We can add users at groups, starter stop service's and connect other computers, and, well, that sounds very. It's very useful. It's very strong and you know, it's very helpful for missus admin perspective where you know we can
01:26
create these computers and have them running smoothly together and talking to each other and be able Thio utilize thes functions.
01:33
But at the same time, it is also a very sought after in a very highly used command for penetration testers, hackers and the nation state actors as well.
01:45
So you will see the neck command is used pretty heavily offensively as well. Where if a Windows host is compromised, a, uh, actor can use the net use command to mount remote file, share to another workstation
02:04
and try to pivot, you know, into a separate
02:07
machine to exploit a network further. So that's why this command is very important to understand. And ah, you know, if you're going into the ethical hacking side of the house that absolutely need to know how to use this command. Thio pivot through a network.
02:23
All right, so adding users, we could do net user space, user name, space password.
02:29
And if you have a list of 500 users, this could be automated as well.
02:34
So let me give you a quick demonstration of that.
02:38
So just like any other comments were going to do. Net
02:42
slash question Mark
02:45
and we have all sorts of different options. Weaken. Do so The Net command has like different flavors inside of it. So since we are looking forward, that user,
02:55
it's a net user slash question mark.
03:00
And this gives us more info about the Net user command and how we use that.
03:05
So it's a Net user
03:08
new, and the password will be
03:12
pass,
03:14
and my user name could not be found.
03:17
Oh, you know, I need to do add
03:21
That is why slash ed
03:24
and asked. This is denied. I believe it is because I am not on a dumb in controller.
03:30
But regardless, if you weren't a command, control it. That's how that works
03:36
aren't so adding groups very similar to the users. We'll do Net Group and then a group name. You do slash ad to add user names or slashed elite that delete user names from a group
03:46
that's gonna be very similar. You can look through the help documentation as well.
03:53
Starting and stopping service is so. This is something you'll see a lot, especially from the penetration testing side where you will start a service or stop a service, depending on you know, the different kind of attack you're trying, Thio begin or service you're trying to exploit. So, uh,
04:12
this could be used to list service is as well. I'll give you a quick demonstration of that.
04:16
Let's say Net start
04:20
and this will give us a big list of service is that are already started
04:27
and like you received before, we can pipe this into a more that way we can read through it line by line before it goes flying past our face.
04:36
So,
04:38
no, let's see which service should we stop?
04:46
Let's say I don't want to end the power surface right now. At least,
04:51
um,
04:55
let's say Windows event logs do net stop.
05:00
And since there are spaces were in and put this in, quote
05:04
windows, event
05:06
log,
05:10
enter all right and stopping the winners event. Log Service will also stop thes service's
05:16
occasion. Where Liz Yeah, sure. Let's give that a shot. Access is denied. Oh, boy. All right, Well, that's how you would stop service.
05:28
And then the same way to start the service is well
05:31
aren't and then net used. 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 user computers to exploited network a za penetration tester or a hacker.
05:46
So one example would be net use, and then you have to put in the drive later you're going to use and then, uh, the remote file share.
05:56
So let me show you what I have
06:00
Net share. So this shows my current shares on my computer right now. So we have the C d
06:08
ah i p c print admin and users folders that are always shared out. So I want to connect in the Mount A to the d Dr.
06:16
So we're gonna do net use slash question mark first. So we can always see how to use this command
06:25
net use. And then we need the device name. I am going to do device. Kay.
06:33
All right, and then
06:39
Frist Tech laptop.
06:42
Thanks slash D dollar sign.
06:45
All right, says command completed successfully. Let's take a look and check it out. I have a map network drive
06:54
that is actually my d dr.
06:58
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.
07:06
All right, so it's a net use and we don't need to put in the full file path. Just say K slashed elite
07:16
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 file shares.
07:29
All right, post assessment. When actions cannot be done with the Net Command, said a connect. Other computers
07:35
be create admin accounts.
07:38
See Starter Stop Service's or D shut down a computer.
07:43
The answer is D shut down a computer. There is actually the shutdown command that could be used to shut down the computer. And, like I was saying, before the Net Command can be used to connect to other computers, create new accounts and started stop service is
08:01
all right. So in this video, we learned the capabilities of the neck Command had add users from the command line, create groups, share local files and mount remote file shares, and I hope to see you in the next video

Up Next

Command Line Basics

In this course you will learn the fundamentals of Command Line, a fundamental tool for any user of Windows and Linux machines. Command line allows developers to manipulate files easily and quickly. Learning command line saves developers time and resources.

Instructed By

Instructor Profile Image
Christopher Haller
Senior Intelligence Operations Analyst at Centripetal
Instructor