Time
14 hours 43 minutes
Difficulty
Advanced
CEU/CPE
15

Video Transcription

00:01
Hello, everybody. Welcome to the upset number two of the SCP cars.
00:06
Ah, the basically next comments. My name is Alejandro Ginia, and I'll be your instructor for today's session.
00:13
Ah, the learning operatives of these laugh is t understand the basics at the Lenox Kamins be able to identify and use commands to search files and be able to identify and use commands to take action over those files.
00:31
So let's get down to business, shall we? Um,
00:35
first, uh, well, uh, Lennox has some kind of database where all the files are located. I mean, um, baths and names and extensions. I said we first have to use the update Devi command
00:53
and these command will again go to all the paths and files and locations of the Lennox.
01:03
But the file system and they will update on location, the names, the extension. So you can later Ah, search those files
01:12
in that matter. This will take a while. I mean, if it's the first time you use the command, don't freak out if it takes a long time, because it is again going through the tire file system and looking for all the names and you know, put it in a kind of database.
01:32
So you can later searching that
01:34
So I will not execute a command. But that's a simple is that you can,
01:40
you know, get
01:42
more
01:45
commands on and, you know, options that you can use with this command. For example, may dash f dash And that she, you know, everything you can use is actually in demand page, which is you know, man, it's just assured for manual. So, um,
02:04
there
02:05
you can search for all that. Um, so let's say that you execute that command, and then you're good to go. Uh, then we can We will use that lucky eight command, which is basically used to locate some files. You know, for example, locate, uh
02:22
and, ah, word
02:25
dot t x t as I don't have, You know,
02:30
it gets gifts minutes. It's actually has the world war and has a t t x t. As you can see, it will go to everything, and you can yell out wire cars and everything. You can just put it here and it will search for all the extensions. But
02:49
let's get, you know, a little bit more specific. For example,
02:53
um, you want to example, let me just give you examples of the of the options you can use. For example, you can locate and print the number or count off match it interests in there. But for example, let's use the same word that the X t,
03:13
for example, okay, minus C which is, you know,
03:16
on. And that's a ward that t x t,
03:22
for example. It says that it contains what file with one hit, and it's because it actually it's one hit,
03:30
as you can see there, um,
03:34
this is there will be much more usefully. For example, we
03:42
ah, we can see that we have a several entries with a D X T exchange in, but for example, maybe you want to, um, search with pages that you have.
03:54
So as you can see, we have several documents hitting that criteria that could be special, especially useful when you're trying to see how many pie tin commands fightin
04:10
scripts. You have, for example, sorry about that.
04:14
Ah, we have several python commands and, you know, as you, uh, need to find any other I mean, just taking my using the wild card here. But for example, I want to see you won't find any command any any Piketon containing award. You know, work
04:31
who have, um,
04:35
seven hits. I'm sorry. 27 hits
04:40
for something, for example, Past sword dot Pai Tun.
04:45
So that's a really useful man. Another one is. You know, maybe, um, you want to ignore the case Distinctions? Because a dan, maybe you want to, um maybe search for this with
05:00
with the P. You know, you don't You don't care if the P is in upper cases on lower cases,
05:05
so you can use that dash e, um,
05:11
option
05:12
again.
05:14
War the pi ton. And you know
05:18
it will locate whether he has
05:23
ah later capital letter or upper upper case. Later,
05:28
it will learn about her. So
05:30
how to be with information about the look a database, for example, locate
05:36
Dash s
05:40
and you can see how May directories has how many files? Um,
05:46
it's a huge database again.
05:48
And, you know, other useful. How to search for an exact final ing east and locate, for example, remember that we even put locate ward that
06:00
t x t. It says that it contains one because at the end it has the word the 60 right here. But what happens if I actually
06:09
minus art? Um,
06:15
word that t X t entry. I forgot about this.
06:21
It actually doesn't. It doesn't I don't have any foul, uh, being named specifically Ward that t x t. Because at the end again, I don't have one. But what happens if I pick? Um
06:35
actually
06:38
password that t X t. And he actually returns the fire
06:45
so we can have several others, for example. Remember when we want to count How many files we have? Name Word that heightened. I'm sorry
06:59
with the minus c for count and says 27 for example. What happens? He fight,
07:06
but
07:08
I have several files. But what happens if I want to leave me That, um What? The search actually returns to require number to avoid redundancy and to search results. You know, more specifically, you can use that minus AM, for example. Again,
07:26
let's stay away to sea.
07:28
Um,
07:30
wins and 20
07:31
and I just get the 1st 20 results for the for everything that is, you know, with a pipe and extension that's really useful when you're actually trying to actually get to the first files or the first you know, hits where you can imbue If you combine this with maybe, um there
07:54
the minus. I'm sorry. The miners are to search for specific files. Maybe that that will be helpful for you to look for any specific filed 21
08:03
Ah, let's switch to our more. You know, I don't want to say useful, but you can use more capabilities with the witch command. Um, the, you know, limits Which man is used for to find the location off a program? Um, theory off problems she'll run from that. You know,
08:24
us are being
08:24
folder, but in reality, this is not the case. But, you know, let's get into the for example. I just can't put here burps, right? For example, Worse. We'll set it for him later in the cars is really helpful approx program.
08:41
So, as you can see is actually in the US are being embarks. It,
08:46
um, location.
08:48
Ah,
08:50
you know, you can even add moment for Temple Hydro. She said I really help buzzword tool. Um,
09:01
you can run several. You know another clan, Jon, For possible cracking everything. As you can see, some of them run from the U S are being and some of them from the ears are s been, um,
09:16
forks
09:18
You can get you know, the wish for him to show all the places that program is install using the following commands
09:26
which dash a ah, which, um,
09:31
it will again print everything. Every location off off where the program miss. As you can see, we have ah, has been years are as being John and has been John,
09:45
um, for example, wine. It's just do the exercise was wine, which is just ah problem to execute Lennox executed bols in the in the Kali environment. Um, that doesn't mean that John or wine is willing stall into places.
10:03
No, actually, no.
10:05
Um, for example, this just run this command to show what I'm talking about.
10:18
As you can see, this little iro right here, um,
10:24
is you know, this is a symbolic link on in reality. Just points to the location of the real program. You can have a late using the worries command instead of that which this can be used for, you know, looking at buying Aries of the program, the source code and the problem in the manual pages of the program, if you can simply, you know,
10:43
type. Word is John, for example.
10:46
Um,
10:48
you will see more information about it.
10:50
Eso basically which in worries you can use a combination of both files or both. Command some. Sorry to actually locate any
11:01
filed. You may 1.
11:03
Ah, but you know the crowned. I guess a crown program of this look look, to locate files is the fine command. Um,
11:15
this file. You know, this command we find, um, well, list and find out the fire with the current directory as well as any other subdirectories in the current directory. I know it sounds a little bit like the same, but let me just give you an example. For example,
11:33
Fine.
11:35
Um
11:37
uh, for example, how about, um,
11:48
documents and, I don't know,
11:50
starting Caesar's some files in there, but, you know, you know, you can search fast by their name. You can use fine,
12:03
you know, find from the root directory minus name.
12:07
And for example, start that Pai Tun.
12:11
And you know, it will take a while ago. I actually put it in the entire directory, but you can see it actually gives me two results. So this is way more complete that the other, um,
12:24
commands that I showed you. For example, I don't wanna
12:28
This will take a lot of results, but let's see what happens.
12:35
Oh, my God. Says you can see defined and help Hope helpful thing about this is that you can actually, uh, limit you several for something. Let me just
12:48
give you
12:52
He contains several options you can use. Weigh more than which and locate you can use for. Actually find for a search for files and programs as well. Let me just give you an example of a really interesting
13:09
example. Fine. Um,
13:13
from the root.
13:13
Um, and I want to go on Lee to directories in depth. So maxed that
13:22
up to minus name and everything. It's actually I'm sorry. Everything that contains pi times crippled. You know what? It's shame. Well,
13:33
it doesn't have anything.
13:35
Offices. What happens if I put four? Okay, so in Ford, as you see one too
13:41
tree
13:43
now in fort on directors depth, I can actually locate some HTML files. So it is a really powerful tool for simple you can use to find files with specific permissions using the purring option with, You know, let me just type the client right here for some fine
14:01
from the root
14:03
menace Mines type
14:05
file, whatever. And term,
14:09
um 0664
14:13
This is especially useful, and we'll see it later in in the pen testing course this especially useful to exploit avalanche ability, recall sticky bit. Some miss configurations over the permissions on the files can lead you to escalate privileges. So this is just
14:33
another I
14:35
really useful way to find files to, you know, get this ticket, for example.
14:41
You can and you can do way more than that. For example, fine files that have been access it in the last 10 days. For example, the last 50 days? I don't know. So would pi Phi type. Fine.
14:56
Um, minus eight. Time.
15:01
50.
15:01
And this will print files that again has been access it in the last 50 days.
15:07
Says you can see, for example, you can find files by sides. Um, just
15:13
size on, I don't know. 50.
15:18
I'm sorry,
15:20
home,
15:24
and it will print all the files that you know,
15:28
you get the idea,
15:28
um, you can find files in ranges and everything,
15:33
but the point is that you can use this commands to actually find any type files you won.
15:41
So just to finish, um,
15:48
this, um
15:50
you know, pass assessment questions. What tasks is performed by the locate command? Well, you know, look, a command. It will find any. Ah, file
16:00
that us, specify or, you know, extensions and everything.
16:04
What is performed by the other day become in it, will, you know, go through the entire file system and see where are the promise programs located and updated the database for those files. What task is performed by the, which minus Aikman. I will give you some time to think about it.
16:23
What do we say? That that minus a did
16:27
minus eight options did to day. Which command? What? Uh, this command is to show all the place is a pro or missing cell again. Uses the minus eight man.
16:41
Uh, in this life we discuss what is the update Devi command used for? What is the luck it command use for was the witch command used for and finally, what is defined command use for,
16:52
Ah, supplemental materials. I
16:56
recommend you to go to this web page over the wire wargames. These guys have really cool platform where you can practice all the commands are the bash commands you can use in linens way more than these four commands that I just showed you
17:12
looking forward in the next video we'll cover The basic service is you can use ink, Ali. Well, that's it for today, folks. Thank you for watching, and I hope to see you soon.

Up Next

Offensive Penetration Testing

This is a deep course about penetration testing. In this course, you’ll learn from basic to the most advanced and modern techniques to find vulnerabilities through information gathering, create and/or use exploits and be able to escalate privileges in order to test your information systems defenses.

Instructed By

Instructor Profile Image
Alejandro Guinea
CERT Regional Director
Instructor