Video - NMap Scripting Engine (NSE)

18 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€93.59
List Price:  €131.03
You save:  €37.43
£80.45
List Price:  £112.64
You save:  £32.18
CA$136.81
List Price:  CA$191.54
You save:  CA$54.73
A$153.85
List Price:  A$215.39
You save:  A$61.54
S$136.10
List Price:  S$190.55
You save:  S$54.44
HK$783.19
List Price:  HK$1,096.50
You save:  HK$313.30
CHF 91.41
List Price:  CHF 127.98
You save:  CHF 36.57
NOK kr1,095.33
List Price:  NOK kr1,533.51
You save:  NOK kr438.17
DKK kr697.93
List Price:  DKK kr977.13
You save:  DKK kr279.20
NZ$168.49
List Price:  NZ$235.89
You save:  NZ$67.40
د.إ367.25
List Price:  د.إ514.16
You save:  د.إ146.91
৳10,960.96
List Price:  ৳15,345.79
You save:  ৳4,384.82
₹8,331.14
List Price:  ₹11,663.93
You save:  ₹3,332.78
RM477.70
List Price:  RM668.80
You save:  RM191.10
₦126,037.39
List Price:  ₦176,457.39
You save:  ₦50,420
₨27,728.08
List Price:  ₨38,820.43
You save:  ₨11,092.34
฿3,701.79
List Price:  ฿5,182.66
You save:  ฿1,480.86
₺3,251.67
List Price:  ₺4,552.47
You save:  ₺1,300.80
B$513.17
List Price:  B$718.47
You save:  B$205.29
R1,913.51
List Price:  R2,678.99
You save:  R765.48
Лв183.04
List Price:  Лв256.26
You save:  Лв73.22
₩137,500.16
List Price:  ₩192,505.72
You save:  ₩55,005.56
₪376.08
List Price:  ₪526.53
You save:  ₪150.44
₱5,758.67
List Price:  ₱8,062.37
You save:  ₱2,303.69
¥15,492.10
List Price:  ¥21,689.56
You save:  ¥6,197.46
MX$1,697.24
List Price:  MX$2,376.20
You save:  MX$678.96
QR362.79
List Price:  QR507.92
You save:  QR145.13
P1,387.12
List Price:  P1,942.02
You save:  P554.90
KSh13,448.65
List Price:  KSh18,828.65
You save:  KSh5,380
E£4,787.02
List Price:  E£6,702.02
You save:  E£1,915
ብር5,664.26
List Price:  ብር7,930.19
You save:  ብር2,265.93
Kz83,485.81
List Price:  Kz116,883.48
You save:  Kz33,397.66
CLP$95,360.46
List Price:  CLP$133,508.46
You save:  CLP$38,148
CN¥724.53
List Price:  CN¥1,014.38
You save:  CN¥289.84
RD$5,902.47
List Price:  RD$8,263.69
You save:  RD$2,361.22
DA13,439.62
List Price:  DA18,816
You save:  DA5,376.38
FJ$229.29
List Price:  FJ$321.01
You save:  FJ$91.72
Q776.47
List Price:  Q1,087.09
You save:  Q310.61
GY$20,894.43
List Price:  GY$29,253.04
You save:  GY$8,358.61
ISK kr14,065.59
List Price:  ISK kr19,692.39
You save:  ISK kr5,626.80
DH1,009.26
List Price:  DH1,413.01
You save:  DH403.74
L1,779.82
List Price:  L2,491.82
You save:  L712
ден5,758.50
List Price:  ден8,062.13
You save:  ден2,303.63
MOP$806.12
List Price:  MOP$1,128.60
You save:  MOP$322.48
N$1,913.23
List Price:  N$2,678.60
You save:  N$765.36
C$3,661.78
List Price:  C$5,126.64
You save:  C$1,464.86
रु13,321.12
List Price:  रु18,650.11
You save:  रु5,328.98
S/368.06
List Price:  S/515.29
You save:  S/147.23
K378.12
List Price:  K529.39
You save:  K151.26
SAR375.03
List Price:  SAR525.05
You save:  SAR150.02
ZK2,574.10
List Price:  ZK3,603.84
You save:  ZK1,029.74
L465.65
List Price:  L651.93
You save:  L186.28
Kč2,362.20
List Price:  Kč3,307.17
You save:  Kč944.97
Ft36,810.41
List Price:  Ft51,536.04
You save:  Ft14,725.63
SEK kr1,086.49
List Price:  SEK kr1,521.13
You save:  SEK kr434.64
ARS$87,266.68
List Price:  ARS$122,176.84
You save:  ARS$34,910.16
Bs687.45
List Price:  Bs962.46
You save:  Bs275.01
COP$390,268.69
List Price:  COP$546,391.78
You save:  COP$156,123.08
₡50,117.34
List Price:  ₡70,166.29
You save:  ₡20,048.94
L2,455.43
List Price:  L3,437.70
You save:  L982.27
₲738,156.27
List Price:  ₲1,033,448.32
You save:  ₲295,292.04
$U3,836.09
List Price:  $U5,370.68
You save:  $U1,534.59
zł404.46
List Price:  zł566.27
You save:  zł161.80
Already have an account? Log In

Transcript

Greetings, and in this short video presentation, we're going to get a good look at the Nmap scripting engine. One of the first things we need to do when we start working on any of these labs is to ensure that we have network connectivity between each of the devices in the lab. So we're going to start by looking at my Kali machine. My Kali machine is up and I have done an IP or an IF config. And I can see that I have an Ethernet zero adapter, and I have a loopback adapter. I'm not concerned with the loopback adapter at this point.

I'm only concerned with the Ethernet zero adapter. And I see that I have an IP address assigned to this adapter of 192 dot 168 dot one four or five dot 132 the 192 dot 168 that 145 portion of the IP address is the network portion. The 132 is the host IP assigned to my Cali. So that will remain unique. But the first three octets of the IP address will remain the same if I'm going to have any chance of network connectivity between Kali and my Windows XP, or any other host on the network, so I'm going to go on over to my Windows XP target, and we're going to check the IP address over here. Now you'll notice that the network IP assigned to my Windows XP machine is also 192 dot 168 dot 145.

And the host is unique and it is 129. So these two machines will be able to see each other We're going to confirm this by doing a ping from my Kali over to the Windows XP. So I typed in the ping command, and I followed that up with the IP address of my Windows XP machine. And I'm going to go ahead and just hit Enter. And we see that I have replies coming back from my Windows XP machine telling me that it is responsive. So I know that the Kali and the Windows XP XP machine can see each other.

Now I can break this ping by just doing a Ctrl C. I'm out. All right, so now that we've confirmed that we have connectivity, we can proceed on with the lab. Now I recommend that you do this each time that you're thinking about starting a lab or working with tally and the Windows XP machine or Medicine portable to whatever the other host might be. I would confirm that you have network connectivity before you get too far along into it and then you start having issues with the lab failing. If your primary host is a Mac or an apple and you do not see an Ethernet Adapter present and all you see is the loopback then you do not have network connectivity. You need to have an Ethernet adapter, either emulated or installed onto your Mac or your Apple machine so that this lab can work.

Now if you have only a wireless adapter, that is to say all you have is the apple arrow net wireless adapter that's not going to work because that is proprietary and what that means Is that Kali and VMware and VirtualBox and Windows XP are not going to recognize the adapter because they don't have a driver for it. There's not a driver for proprietary hardware that is produced by Apple that is universal. So to overcome this, what you should do is go out to your local PC parts store, go to Best Buy or wherever you buy your computer stuff and purchase a USB to a rj 45 adapter and make sure that you have a network cable. When you plug this in your Apple machine or your Mac box will recognize it and you'll be able to then have an onboard Nic adapter that you can use for the labs then just take the cable, plug it in here, plug the other cable into your wireless router or your modem.

And you'll be working like you should be. Anytime we get into Kali and we start to use any of the tools on a regular basis, we want to make sure that those tools are updated. And they are the latest packages that are available for us. So that makes no exception within that. In this case, I've typed in app dash get space install and map I'm going to go ahead and hit Enter. And now I'm going to just type in Y and I'm gonna hit ENTER again and now the package, the latest package for n map will download and install.

From the terminal we can locate the location for in map scripts just by typing in locate space asterik period and S e. I'm gonna go ahead and just type in, Enter. And now I can see all the scripts that are currently available within map and if you need More scripts, you can go out to Dan Matt site and you can download custom made scripts by and map users. And we see that in other labs as we go through the course. So among the most useful scripts are the vulnerable vulnerability scanning scripts. And we can locate these easily by just typing in locate space asterik, typing in Vu, fel an Asterix, period, ns, E, someone locate all my vulnerabilities get scripts at this time. And here they are.

These can be very useful. These can help me find scripts that I can use to look for a Pacific vulnerability that may be relevant to my pen test or to the victim that I'm trying to hack into. We can also locate a Pacific script by typing in locate and we want to look inside the end map and now we're going to pipe off the results using a grep Command, and I'm looking for the MS 08. And I'm going to go ahead and I'm going to hit Enter. And it's going to come back and it's going to show me that yes, there is a script up inside of an Nmap in the Scripts folder, and it is called SMB dash v u n, v Vu LN dash m s 08 dash 067 dot an S II. Now that I have found the location of this particular vulnerability script for Ms yearly dash 067, I can tell and map to run it from that very location just by typing in map space.

Dash script equals, now I've got the path to where the script is located, and I've told it the script that I want to run. And we'll go ahead and do this real quick. Now before I do this, I'm going to have to tell it The IP address of the machine or the network that I want to scan. So for this target for this script, I have told it that I want you to scan the entire network and look for any IP address that it belongs to 192 dot 168 dot 145 dot zero. And I'm telling it to look in the last octet with this slash 24. I'm saying the first three octets of this IP address are taken up for the network.

So I want you to scan the last octet for any available hosts. I'm gonna go ahead and hit hit hit enter. Give us a minute it'll come back with the results. Now we see from the results that my Windows XP is showing up here and it is vulnerable for the SMB vulnerability script and We see that that is the case, by looking right here we see that Port 445 is available. In this example, we're going to scan a single host. And all I've done is type in the IP address for the machine that was identified in the network scan that I used previously, for in math.

Now I'm going to go ahead and just hit Enter. And it's going to come back up in just a second, it's going to give me the results. Now I've just confirmed that the one to nine machine is vulnerable on port 445, which is the Microsoft SMB vulnerability that was scanning for. So now that we have identified a victim, it's time to get busy trying to exploit that vulnerability. And we're going to do this using the MSF console, or the meta squid console, and I've typed in mini sploit at the Cali prompt, I'm just going to go ahead and hit hit enter and this will start your service or the application My MF console. So as you can see, once you start the MSF console, you have to be patient and allow it to load.

There's a lot of information, there's a lot of things going on here in the background. And you can see that there's a lot of exploits a lot of payloads. There's just a lot of stuff going on. Alright, so what we want to do now is we want to find that exploit that we can use against our target machine. So in our previous scan, we identified that the host 129 was vulnerable for the MS zero a dash 067 exploit. So what I'm going to do now is I'm going to search meta sploit and I want to find that particular exploit and then we're going to use that against the target.

So I'm going to use the search command up inside of Metasploit and I'm going to search for any package Any payload, any exploit that comes up with Ms 08. In its title, I'm just going to go ahead and hit enter now. And it's going to slowly check the database. And when it does, we'll come back and we'll see if it's found. So the search has concluded, and we do see that we have an exploit called SMB forward slash ms 08, underscore 067 underscore net API. So what I'm going to do now is I'm just going to go ahead and highlight that as I've done here, and I'm going to right click, I'm going to copy that.

I'm going to go down here to my prompt, and I'm going to type in the word use, like that. Now I'm going to place my mouse right after that with the space and I'm going to go to paste and now I can use this particular exploit or this attack on to the Windows XP Target, I'm going to go ahead and hit Enter. And notice my prompt changes to let me know that the exploit has been loaded. So what you're looking for when you look and you search for an exploit is this back up and just kind of cover over the fundamentals just a little bit here one more time. First off, we're looking for a port, a port runs a service. So when we scan for a victim, we're trying to see what ports are open.

And then we want to see if we can identify a possible exploit to run against a specific port. In this case, we weren't we wanted to run an exploit against Port 445 because we know that that's a very vulnerable port for Windows XP. And we found the exploit was available up inside of medicine by just doing the search for Ms. 08. Now, we got that information from em map right? When we chose to run the script for Ms. 08067. That's what we were doing.

We were trying to see if there was an exploit available on the network. And we found it. And it was available using the Windows XP target. Now take a look. Where we see the exploit that we're using here, take a look at this is available starting in 2008. And it has a ranking of great and you get some more information over here about how the service is exploitable using this exploit.

Now, if you want more information about Ms 08, underscore 067 or dash 067, just go to Google and type it in. That's a Microsoft security update. And you can go out there and you can find out just exactly how This SMTP service is being exploited and what happens when we run this exploit. Now the next thing we have to do is type in the show options command, so that we see exactly what is needed for us to run this exploit. So we type this and let's go over this real quick. You see that the remote host is yes required.

That's the target IP address. And in this case, it will be the IP address for my Windows XP victim. It's second thing that we need to have up and running on the victim is Port 445 is required. Yes, that is the SMB service port. Okay, so now we're ready to start setting these parameters. So the first option that we want to set is the remote host.

So I'm going to type in set our host 192 dot 168 dot 145 dot one to nine, I'll hit Enter. And that option has been set. Now another option that we can set is the IP address for the local host. In this case, that's going to be the IP address from my Cali. So I've gone ahead and I type in set L host 192 dot 168 dot 145 dot 132. I'm going to go ahead, hit Enter, and that option has been set.

So we've set the exploit. Now we have to look at what payloads are available inside of the exploit. So to do this, I'm going to do the show payloads. And we're going to hit Enter. And then we're going to pick the correct payload for this particular attack. So the results are pretty intimidating.

And we have to scroll through them until we find exactly what it is we're going to use for a payload so that we can exploit the target and this case we want the windows for slash meta predator For slash reverse underscore TCP payload. So I've gone ahead and highlighted that. Now I'm going to right click on it, and I'm going to go ahead and copy. So I'm going to use the set command. And this time, we're going to set the payload. So I'll type in set space payload.

And now I'm going to right click and I'm going to paste the payload that I want to use. Once I've done that, I'm going to go ahead and hit enter. We're now ready to send the payload over to Windows XP, and see if we can actually gain a reverse shell. So I typed in the command that we need to execute which is exploit. So I'm going to go ahead and hit Enter. And in just a second, we're going to come back and we should get a positive response saying that the meta predator session opened and we see that we get the meta predator prompt.

Once you see the meta predator prompt, that means that you are established on to the remote victim in this case, my Windows XP machine Okay. So just as if I was sitting physically at the Windows XP machine and I typed it typed in CMD at the run line, I would get a command prompt. Well for me to do this from my meta prayer session, all I have to do is type in Shell. I'm typing in Shell, I'm gonna hit Enter, and I will be given access to the command prompt onto my Windows XP machine. Now I can do IP config, which is the windows command for show me the TCP IP stack on your current network adapter. And it pops up and it shows me so I'm actually on on the victim.

And anything I want to do here, I can do it through the metal printer. Now this is how we gain access. This is one way we gain access, but it's also how we take over the machine and we gain access into the administrative areas of the machine, whether it's Windows XP Windows seven 2003 server whatever it is, it makes no difference. So as we go through the course and we go through more of these labs we will be looking a lot more at meta printer and all of the wonderful commands and things that we can do using a reverse shell. Okay, that's all I got for this short video presentation. And if you have any questions don't hesitate to contact your instructor and I hope to see you in my next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.