Hello, everybody. Welcome to the episode number 36 of the Privilege Escalation series. Lennox Files. My name is Alejandro Gonna and I'll be instructor for today's session.
The Learning operatives of this session is to understand the concepts behind this technique and applying the next kid commands to gather information so we can actually escalated privileges.
So let's get a starter, shall we?
First again, let me connect to back to their victims machine,
and I will follow the same structure as we have done so far, which is just me type of the commands and explaining to you what the commands are. Well, first limb, you should ask us questions like which configuration files can be written
in the E T C directory.
Are they able? Are you able to reconfigure a service? Perhaps, You know, the 80 see folder usually contains the configuration files for all the program, the run on your leanings or UNIX operating system. So they are checking this out. You will yield
some useful information like, for example, let me copy paid this command.
I will be copping based on mother the comments because they have way too many options for me to type it out. Like, for example, in this case, we're fighting again. If there's a configuration file that can be written by anyone in this case,
Oh, are at least readable by anyone
see what they are. And, you know, maybe we can find something here. Rick, for example, the open SSL configuration that's, you know, really dangerous to live it like that. Uh, and by the way, I would like to live. Clarify. We're gathering as much information as possible.
So when you're actually going to exploit that vulnerability
here, you can you know, you have all the information. There's always there's always more than one way to actually escalate privileges. It could be by exploiting a vulnerability in an existence of word or tool or program that is running on the operating system.
But you can also take advantage of Ms Configuration or something like that. So
yeah, well, we have we're we're doing in this series is to gather as much information as possible. So you can, you know,
take a look off all information you have gathered so far it and decide what's the best way to escalate privileges because you don't want to go down the rabbit hole trying todo no exploit a liability in a in a searching version off an application. And you can if you can just easily,
like get, for example the sticky bit, which we will see later in this video.
Uh, just just a couple of you know,
let me give you another command to achieve the exact same thing.
hopes didn't go back fine. Again. It's evil, Max. Depth.
just type it out and we'll see more information about this at the end. You can also type this other command to again find configuration files that can be written. Or at least you can read rhythm with permission because they have permission for anyone
again, another command to achieve the exact same thing.
Ah, it could be as juicy. Uh, you can read your way. At least we can read it this week. Ing read and execute this one. Uh, did you get the idea?
Maybe for a specific owner?
copy. Paste it this one out.
If you want to actually see that the files for a specific owner. Ah, here. Maybe for the specific group
O R. Can be written by right by your group Berjaya Group. I'm sorry
Or maybe it could be. You know,
that's the point. You can find files configuration file that can be access it or written or executed, or at least read it by anyone by a specific owner of a specific group. You get the idea,
Uh, and we can also go to the bar directory. Bark Azul, Reno. The bar contains files to which the system writes that data during the curse of the operation. You know, the bar or the beautiful data such as logs, news, male spool
which is constantly being modified by the programs of the tools running on your system and by the way, bar specific for its computer. I see. No, it cannot be shared in the network with other computers in concerts to other directors that, you know, you can actually shared them.
copy base. A couple of command sing here is if we can actually find walking, we find in the bar directory,
Ah, we can see, for example, Apache. Maybe we can take a look at some specific low locks for example, if we have mail, This is really dangerous because I have seen cases where the mail he saved in there and you can actually see conversations between a,
the user in memory, their boss or something like that.
So, yeah, we can actually get all this command. I'm just copy facing them because I don't want to waste any time, actually type in it. But, you know, you can just stop the BDO and, you know, copied it commands. But again, what I'm trying to do uh, guys right here is to actually give you ideas,
what to look or how to look it out
and not just commands. And, you know, I don't want you to exactly repeat what I'm what I'm typing or when copy pasting three more precise. I want you to give you I want to give you a D s so you can actually search for for commands for You know, Thio, you can cover face the commands, of course, but I want you to
And once you get the idea, you can search for more commands or maybe specific flax for that Commander. Specific options for Decca manned so you can give you the information you're looking for. For example, are there Do we have any sevens or files hidden
in a website? Maybe. You know, sometimes I have seen that once I'm in the system,
I I saw the one where I was scanning that the web service or they were server. I'm sorry. I saw that there were more files, but, you know, they're not presented in, you know, the directory. So we can actually check this out like
sound. Let me this copy. Paste it right here.
We have any hidden file that we might meet. The check, for example. Key that PNG. That might be useful.
let's go that directly
for example. This one right here
again, I'm just copy facing the command after I, you know, used there. They were the course of my penetration testing career. But, you know, some some files, some some commands will work in some commands, will not, because at the end, just not not everything is saved or created on the same directory. So, for example,
on that's the *** such file directory
barred, for example. We can see that everything is in here at mean. For example, That sounds interesting. Ah, harker dot PNG Robbie that j b d b
j uh, you know, and maybe
some of this is interested, but you get idea. Uh, maybe those were hidden files so we can search for everything in that directory. Another question is that Is there anything in the locked files? You know, remember that we saw the remote filing collision
and local file inclusion
attack. Well, we can actually write to any specific file. Or maybe we can see that there's some PHP code being executed in those files. Or maybe expecting some input we can actually take a look at and see. We can perform local final inclusion. So,
these are simple command. You guys, I just want you to get the idea of what to look for. Access locks on such file directory. Let me just
finding here. What? Oh, no. No one.
So this out. Maybe locks
box Wouldn't have any locks here. Apache, maybe
botching locks. Have anything called logs in here. Nope.
Apache dot com for a sample or me. Any kind of loves you can think off, maybe
long and Apache, for example. Hopes
how much? Oh, my gosh.
Something got wrong with my keyboard. You guys that judge me,
we can actually take a look of everything. He hopes
Ox is denied anyway. Uh, yeah, you can. Oh, my God. Again. That bar.
You can actually take a look at any different logs that you might be. It could be interesting. For example, Bar
Www. Maybe we have something for logs in here. No, we don't.
Ah, maybe you know, the admin could contain something useful. Anything that it's actually locks. You could you know anything that I can actually generate data or save data or anything that you can think off for each service. Maybe you found Ah, my SQL service wine.
And you can take a look at the logs and see we can actually,
right Or maybe read from those logs and maybe credentials. Or, you know, you can include informations that you can actually perform local file inclusion or a remote. Finally collusion.
Another question you should ask yourself is ah, maybe I ever seen cases work. You get a reversal, but it's kind of a limited shell. It is not running a full bash or a full shell, like you know
you can. This attack is known as break out of the Yale Shell. Um, so you can Maybe it's pawn. Ah, pipe and shell. I really know this doesn't contain fight on pie turn.
No, we'll locate. It's not even there, but yeah, I ever recall not not saying fighting in this operating system.
Yeah, it doesn't invite him, but, you know, let me just cover basic a man. But this is just a commander you can actually find in every possible source soup. I turn on the command and import No pipe,
Petey. Why, That's pawn and being bashed. And that's it, right? Maybe
you can echo your way out off the Yale Shell, for example. Something like the echo s
and are just a simple B m s h Dash E.
Yeah, And we already have a shell when my I'm still user, cause at the end, I haven't changed or escalated privileges at all. Um, how are you know? Are the file system mounted?
You can just type the word mt
and get more information? Um, the FDs dash h
more information for death. Um,
there's on our mounted file system, like we can just cut this file
right? And maybe we can, uh we can escalate privileges by exploiting something not necessarily related to the operator system. But, you know, to how the operation system was configured or maybe something was amounted.
You can mountain and, you know, see, it has more information, more more files or something like that.
Ah, we can actually also search for the famous and well known sticky bits as you I D or D u I d. You know, And this kind of the question is what advance limits file permissions are used, for example,
we can let me just copy pays the commanding here,
and I was planning to you right away,
so ah, stick a bit. This is the famous stick a bit on Lee, the owner of the directory or the owner of the file can delete rename here, but, you know, we basically need to know what files are executed with root, but it could be Could be, you know, modified by you know, anyone
or or, you know, for trouble on a normal use or something like that. We could see temp. This was kind of expected, but, you know, there are other files that might not be as expected at a temp,
You see the group in here? Not necessarily the user.
And we can see more files in here. Um, no. Uh, for example, this Let me just copy paste. This Ford is four loop,
and I was lying to you
right away. Uh, this will look in the common places like being has been years. Are being a user s been years local being, you know, another the god of the common places to see, uh uh if we can find something with the sticky bit, are you know, s u I D.
it will be with you will help us like, Oh, I didn't put something correctly in this, but this is the command. That's a point.
Ah, Another question you should ask yourself is where king I write or execute from, You know, the common places again, the temp.
It's a common place, but, you know, sometimes you find yourself not being able to maybe already fine. What exploit to use to actually escalate privileges? Because you already, you know, performed other techniques we have seen so far. And you find out that there's an application running within specific version that is actually vulnerable
to Berlitz escalation.
Ah, are you find out, um, exploit for that specific colonel version or that specific operating system version. So you just want to find our files or location where you can write so we can see that And we can ride up to all of these locations
again. The temp is the most common one. But, you know,
maybe you can find world. What we found right now is the world readable folders. There's a bunch in command you can actually use for that. Uh, for example, you don't want to use the word riddle used one to use
the numbers. You can just,
uh, execute this command
against you guys. I'm going on a real little a little bit quicker in HPD. It is.
I want you guys thio understand the concepts and nonsense. Charlie, cut the commands. You can always pause the video and check all the man's.
for example, let me just were give you another commands were agreeable
and, you know, permission that I and everything. But you get the point. You can write to these files and everything, so yeah, this could, you know, dis commands are just show you how not how to. But you know what question? You should ask yourself, too, when you're actually escalated. Pretty religious
in this video. Well, first, let me ask you a couple of questions about the video. What is achieved by the command PS dash ox.
I think I didn't execute the correct
script right now. So my apologies for that, guys. What's the chief of the command? Fine. And that combat. I mean, I don't want to say to you out loud, because it's kind of difficult set. Um, what's the cheap by DI command, you can You can always cheat and go back in time to see the video
and that that that will be fine,
because I understand that those commands are really long, a real NT and, you know, trained for memory. It might be difficult. So this is no. The IT easy folder usually contains the configuration file for the programs and what we're doing with the first command is Thio. Fine. Try to find
which files can be written
or at least access it or reading from the PC folder in this case by anyone in this specific man. What is the chief of the commander in the second command? You guys that judge me? I don't wanna read all that. Uh, where's Chief? But I command, actually, that's one of the late that the
the command with Saudi. At the very end,
this command would point, you know, were readable files that you can actually see. Maybe the file is executed with privileges were permissions, but it can be written by your user, and I will give you a good advantage seeking escalated privileges
in this video. We'll learn the concepts behind this technique,
and we implemented on executed some comments to help us escalate privileges.
Ah, some material you can check again the book master and colonics for advance penetration Testing. Good. Read on. Basically Nick's privilege escalation from the got milk post
Looking forward in the next video we'll cover Lin. It's networking. All that's it for today, folks, I hope in your day video and tactician