Time
7 hours 47 minutes
Difficulty
Advanced
CEU/CPE
10

Video Description

This lessons covers port specification and scan techniques and discusses the following examples:

  • -p : only scan specific ports
  • -F: fast mode. Scan fewer ports than the default scan.
  • -r: scan ports consecutively. Don't randomize.
  • Top ports : scan most common ports
  • Port ratio : scan ports more common than

Participants also learn about service/version detection: - sV: probe open ports to determine service/version info

  • version intensity : set from 0 (light) to 9 (ty all probes)
  • version light: limit to most likely probes (intensity 2)
  • version all: try every single probe (intensity 9)
  • version trace: showed detailed version scan activity (for debugging)

This lesson also discusses P0f is passive OS fingerprinting and listens to traffic with the intention of identifying operation systems and does not generate its own traffic as well as Tcpdump which prints out a description of the contents of packets on a network to match the Boolean expression.

Video Transcription

00:04
nicest port specification and skin techniques. Obviously, this was scanned techniques. This is a little bit more in the way of scan techniques, but it's a little bit war
00:12
abstract in general. Rather than being so specific about blacks. Not sure thing. Support specification is very easy.
00:18
We could do tech P.
00:20
Obviously we see examples here like tech. P 22 will only as I mentioned earlier I described you could just check in S H port. See if S H is open.
00:28
You can also do it like this, which is 13 65 5 35
00:32
I'm only do this if you're a mass kissed or if you have tons and tons of time.
00:36
This meant that this method right here will scan every single port on a machine. TCP and UDP just run through everything it is going to take awhile. My general advice is get a cup of coffee cause you're in for a stake out. This is the more common when you're going to see.
00:54
This is well, not necessarily more common, but the better version. At least
00:58
this is specifying the exact ports. It may be that you have an exploit that you can throw against SM beer that you have an expert. You can throw in some specific strange service that some of their computer's gonna be running. But you also want to know if you know
01:15
this is the machine that has D. N s on it. You want to know if this is a server when identify who's serving up what?
01:21
Which is kind of what this is geared to do. This particular set that it gave here,
01:25
I'm it's designed to look at
01:26
commonly used, sir reports
01:30
and send the trying connect to each of those ports or syntax each of those sports.
01:34
By doing it in this man in this manner, you can identify pretty much every server on a network with a single port list just by saying, you know,
01:42
trying connect to 53 which is D. N s. You know, try and connect the 80 and 80 80 which are http
01:49
trying connected various sir reports. And if it replies, whatever replies to I know that it is a server for that protocol. That's, ah, well formatted handy list to use. It's one that I highly recommend. It kind of gets the best of both worlds between efficacy and efficiency.
02:06
Um, there's also the fast mode option. The default scan is the top 1000 ports. That isn't
02:15
exactly the 1st 1000 ports because there are some random highs or, theoretically randomized like 80 80 which are actually very, very well known and extremely common. So it has the 1000 most common ports by defaulter scan with fast mode, it scans fewer than that.
02:30
Um, I don't know the exact number off the top of my head. I want to say it's one of the range about 200 ports, but it skins few reports that scans only, you know, the very, very most common ports,
02:40
um, are
02:42
turns off the random ization,
02:44
which is typically bad. Random ization is nice because it doesn't look like you're just standing ports. If you've got our active and you're scanning slowly, it might look like normal trafficker might look like we're traffic, but it's not happening fast enough. Rented, yes, to catch
03:00
Tak are takes that away. It stopped for an imitation. It just runs, you know, if you're doing one through 65 5 35 it's can support one minutes can support two skins for three
03:10
all the way up. Um, that's very noticeable.
03:14
Ah, only in very specific use cases are you gonna want to turn off random ization. I have never had cause to do so,
03:21
but it isn't impossible. So it's worth knowing that option.
03:25
Um,
03:27
this is a good one, which is, you know, top ports. So if fast scan doesn't work for you or fast mode doesn't work for you, most common is over for you. Whatever. You can scan a specific number. You know, the top blink most common ports. So if you've got time, you can scan the top 10,000 most common ports,
03:44
which consists of almost 100% of Ulster reports.
03:49
Um, I mean, you're looking like 98. 99% of the common of the actually used ports will be in the top 10,000 in terms of servers.
03:58
Um, if, on the other hand, you only want, you know, the top 10 or 15 which is gonna be things like http Ah UDP the really, really common ports. You could do it that way.
04:08
Generally speaking, if you're looking for a number of top ports less than about 20 or 30. It's better to just write the specific ports. It's just more efficient. You have more control and you know for sure. But
04:20
if you just want to say, I want to see the most you know the top five ports and I don't want to specify this works for you port ratio.
04:29
Now I'll be completely honest. This is an option I've never used. It's kind of a cool option, and it's concept, but I've never really had a use case for it.
04:36
I'm a scan sports that are more common again. I've never had used for it,
04:42
but it's worth trying out. You may want to if you do, by all means. You know, Post a comment. Send me a message. Go to cyber. Very intelli ruin Port ratio. Blah is the greatest scan I've ever done. Whatever whatever works for you. Next series of options service inversion detection.
04:57
Um,
04:59
don't worry. You know, we see the light at the end of tunnel. We're almost done with that map options, I promise. But service inversion detection
05:04
is used, as I mentioned, to determine
05:08
actual versions of
05:11
or what kind of service or version is running so could be used to say is that I'm just saying, Oh, this is running as S. H says it's running S h B two s s h B one if you're very lucky.
05:20
Um, and you want an easy, you know, serves to target. But I can tell you about specific service Is so it's useful. Ah, lot of a lot of lot of lot of exploits don't work against every version of a service. They will work against you. Version 13.9
05:35
as released on Tuesday.
05:39
Um, you know, you've got a you got to tell you that one specifically, So you can do obviously
05:44
just probe of importance to the German new version. Intensity of a specific level. So it will try really hard or not hard at all, depending version light.
05:54
It's only the most likely probes version all. Try every probe again. That's just ah,
05:59
a pneumonic for intensity nine inversion trace.
06:02
It's for debugging.
06:04
All right. I made it out of n map. Out of the trees ran smack dive into the next forest. This will be much, much, much shorter.
06:13
So prof is also for OS fingerprinting, and it typically will fall under the heading of scanning,
06:18
which isn't exactly correct. It's more of a sniffer than it is a scanner, but it's sort of used in conjunction with scanners, and it functions to accomplish a lot of the same goals as scanners do, which is why it tends to fall under that heading.
06:31
Prof is passive OS fingerprinting. We use zero because we're really act source. As I say, not to be confused with P. O. F. Puff is not a thing. So far as I'm aware,
06:43
it listens to traffic intending to identify operating systems. It doesn't generate any traffic of its own, so you can leave it running on a machine overnight.
06:51
Um, and as long as you're you know, it's not generating too much data on its file on the local machine, very unlikely someone's gonna catch it.
07:00
You see, it watches. It tells you I ps import numbers. So you see there's another I P.
07:05
Or there's an active. I pee in the network. We see it's connecting to an external I p. Of 23 60 to 96 1 94
07:13
It's hitting
07:15
for 43 which is https.
07:16
Ah, this unknown here means hasn't yet identified the operating system of the source machine.
07:23
So this data here, which is what it uses, has been inconclusive. So so far,
07:28
um,
07:29
you can set it to be more aggressive in trying to term. You can set it to guess harder. Basically, um, aggressiveness and end map says send more data. I don't care if you get caught. Aggressiveness in peace arrive is really just saying, you know, I permit you to use more guesswork,
07:45
but it uses various fields that are inside of a packet. It analyzes packets, it says. Okay, well, this has a window size of blah combined with, you know,
07:54
uh, this field over here,
07:57
it tells me it's probably a Windows machine. You know, the TT Ellis 64. Probably a Lennix. That's kind of tricky,
08:05
because T t l obviously goes down with each successive machine. So if you have, if you receive a TPL and it's less than 64
08:13
on a modern Internet, the other extremely good at some sort of UNIX variant. But it's not positive. You could just have really weird luck. But yes, oh uses lots and lots of different sources from each packet again. It doesn't generate back in, but he uses lots of sources from back. It's that sees, Um, and if you leave it running for,
08:30
you know, a period of time, it will almost always successfully identify and operating sister. If you leave it running for long,
08:37
next thing is gonna be sniffing. Sniffing is different from scanning and the scanning other than obviously with weird hybrid case of prof scanning attempts to identify information by
08:46
generating traffic and looking at responses and looking at that information. Ah, sniffing, on the other hand, has done with T C, B, D O T. Shark and various things like that. Ah, sniffing doesn't generate traffic. It just opens traffic that that machine receives
09:01
and just prints out description. If you've used wire shark, you'll be familiar with this sort of thing. Just read the raw hex. If your massive mystic or
09:09
you know like me, you're used to implementing weird protocols and you know wire Shark's gonna freak out. I do a lot of raw soccer programming, so I see a lot of strange things on wire short.
09:18
So a lot of times you just print the raw hex and you'll learn more that way. But
09:22
it's also less fun to read. So if you're using normal protocols, it's better to let it do some of the analysis for you.
09:30
Um, so from the man Paige, we see TCP dump prints out a description of the contents of packets on a network interface that matched the Boolean expression.
09:37
Blair
09:39
Human version. TCB dump is a Pakistani, for it spits out easy to read information. That's all it does. It opens a packet and it tells you about it.
09:46
Nice and straight forward the output from TCP dump as we see right here. We've got a little bit of sample output for you,
09:52
so there's a time stamp for each packet.
09:54
Um, this one was obviously collected around 9 30 uses a 24 hour clock. So you used military time. The I p was the dot to
10:03
and it was going to the 1 28 It's you know, it's specifically targeting this port.
10:07
It's kind of an ugly output with this,
10:11
Um, but we see an ex domain,
10:13
so we know it's coming from domain,
10:16
which is D. N s. It's going from name, server and name exchange domain port s
10:22
and it's going to ran to my,
10:24
which means that there was a D. N s request and this is a reply to it. So you know that whether or not dot to is actually a D. N s or whether or not about two is just,
10:33
you know, the go to between the two. If you want to screw with the N s, you're gonna want to get on that dot to machine because that's where Deanna's information is coming from. So if you wanna, you know, control someone's DNA or you want to edit it or whatever, that's the machine you want to go after on this next one is a little bit more informative again. We have a time stamp right here.
10:52
We see it's an I P packet.
10:54
You see, the I pee again is 1 to 8.
10:56
This random high port, so 1 to 8 is probably the client,
11:00
and it's going out to this weird
11:01
name here that was resolved by D. N s. It's occupied technologies com dot https.
11:07
If you're unfamiliar with occupy technologies, you have almost certainly used their service is to some extent, they are a cloud server cloud storage cloud server company. The most common or the biggest client, Probably that I have this Facebook. So if you have a Facebook account, you've been to a knock on my website
11:26
because where it's hosted,
11:28
you see there's a knack. There's an act number. It's got flag. It's gotta flags. Field
11:33
of the window sizes 46 7 20
11:37
So again, if you're a savant and you know all the window sizes and the common window sizes for every operating system that could be used more commonly, you can plug this into analyzers that will tell you Hey, with window size of 46 7 20 it's probably going at a UNIX server. We see this is just a backpack. It was It's got the length of zero, so there's no actual data.
11:54
So this is a knack. It saying, I got whatever you just sent me.
11:58
We're good to go, All right. That was T C media. This is T Shark was very similar to TCB dump, but it's a little bit more fully fledged. Um, T Shark is the command line version of wire short when I was describing earlier, it's for boasts. It tells you a lot
12:11
for the programmers in my audience. It's built around limpy cap dot c Uh, which is,
12:18
you know, just Lennox or not necessarily Lennox. Usually a Lennox implementation. I mean, it's got all of the packet information built in. So there's something you'd like to know about packets. You can go through limpy caps, documentation. You could learn a lot.
12:33
It deciphers packets in real time.
12:35
Um, and it's I mean, it's very near real time. It's hard to tell the difference between this and a normal application. In some cases, this will be faster because it's not actually processing all of the data. Just the headers, really, And then it's giving you the data in Raw Hex. Most of the time,
12:50
it's got a decent Reg. It regulates sparser, so regular expressions in terms of identifying the I P and that sort of thing. They're not traditional regular expressions they don't have, you know, the engine like you would normally see, but it's capable of using fairly complicated logic. Siri's to only show you specific packets.
13:09
So you see here some sample output from it.
13:11
We see,
13:13
and it's got a packet number.
13:16
It's got
13:16
timestamp.
13:18
The time stamp is relative. It's not actual actually a hard time stamp late. The other was, This is the time stamp from whenever this communication started.
13:28
That's coming from this I, p right here, which is 66 to 49 89 1 72
13:33
And it's going to a 1921681 dot Wanna Wait. This is just a random chunk that I took off the Internet. So this isn't actually correspondent the other packets we've been showing
13:41
eso don't get confused that this I p is slightly different. It's not a big deal. I would see that today. It's http,
13:50
so it's an Internet connection of some sort. Specifically, we see it's http version 1.1,
13:54
um,
13:56
which can be useful, lots of exploit to get exist that go against that sort of thing. We're checking out
14:01
check sums. Okay, so it you know it's a valid packet.
14:05
It's going after a gift for a Jiff. I'll leave it to you guys to fight it to the death of the comments as to whether or not it should be a gift for Egypt.
14:13
All I'm gonna say is that an animated picture is not peanut butter, and I'm going to go from there.
14:18
Content type is again an image or
14:20
this sort of
14:22
moving animated image file. I'm not going to say specifically
14:28
pronunciation again, and he's got a content length of 35. There's not a lot of data there. I'm obviously we see here there's 4 77 There's a lot more data on that one on a 5 35 again.
14:37
So when you see the same length occur a few times, it's worth checking on that lengthened scene. That's a standard.
14:43
It could mean 35 is the cheque. Value could mean 35 has just got the or l could mean lots of things. Either way, it's worth examining and checking out. This is T shirts out, but obviously it's a little bit easier to read a little bit more indicative than what we saw from TCP dump.
14:58
It doesn't have the flags right now. You can change settings and make the flags available,
15:03
but I decided not to dig into every option for T shirt and DCP dumb after kind of beating you over the head with all the end my options. So with ease, as with everything else, I recommend exploring exploring exploring, exploring. Check out what they can do, play with them yourself, get very familiar scanning and sniffing or two of the most important parts of gathering information.
15:22
And obviously they're among the most important things because you're gathering information on the network itself. Next video, when we come back is gonna be kind of going back to doing the current machine. But it's gonna be using Windows. You'll see there are some galleries, some similarities between doing so on Windows and Lennox, and there are also some massive, massive differences.
15:41
But that will be when we get back. Until then. Like I said, familiarize yourself with the tools you saw here or on cement. Maps can scan the Internet, get a call from the FBI. Whatever. Learn about the tools. Have some fun. You've learned a lot of hope. You enjoyed the current very long,
15:56
admittedly somewhat dry lecture until next time. My name is Joseph Perry. I'm a resident post exploitations me and you're watching this on the side buried that IittIe website

Up Next

Post Exploitation Hacking

In this self-paced online training course, you will cover three main topics: Information Gathering, Backdooring and Covering Steps, how to use system specific tools to get general information, listener shells, metasploit and meterpreter scripting.

Instructed By

Instructor Profile Image
Joe Perry
Senior Technical Instructor at FireEye, Inc
Instructor