Kernel Exploit

IT Security Gumbo: Exploitation of Kali Exploiting Privlege Escalation
12 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€48.02
List Price:  €67.23
You save:  €19.21
£39.14
List Price:  £54.79
You save:  £15.65
CA$71.63
List Price:  CA$100.29
You save:  CA$28.65
A$80.06
List Price:  A$112.09
You save:  A$32.03
S$67.51
List Price:  S$94.52
You save:  S$27.01
HK$388.46
List Price:  HK$543.88
You save:  HK$155.41
CHF 44.24
List Price:  CHF 61.94
You save:  CHF 17.70
NOK kr563.34
List Price:  NOK kr788.73
You save:  NOK kr225.38
DKK kr358.57
List Price:  DKK kr502.03
You save:  DKK kr143.46
NZ$88.43
List Price:  NZ$123.81
You save:  NZ$35.37
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.45
৳5,964.32
List Price:  ৳8,350.53
You save:  ৳2,386.20
₹4,269.04
List Price:  ₹5,977
You save:  ₹1,707.95
RM224.30
List Price:  RM314.04
You save:  RM89.74
₦77,264.53
List Price:  ₦108,176.53
You save:  ₦30,911.99
₨13,894.99
List Price:  ₨19,454.09
You save:  ₨5,559.10
฿1,708.15
List Price:  ฿2,391.55
You save:  ฿683.40
₺1,759.41
List Price:  ₺2,463.31
You save:  ₺703.90
B$318.75
List Price:  B$446.27
You save:  B$127.52
R937.33
List Price:  R1,312.34
You save:  R375
Лв93.99
List Price:  Лв131.59
You save:  Лв37.60
₩72,848.40
List Price:  ₩101,993.60
You save:  ₩29,145.19
₪182.43
List Price:  ₪255.42
You save:  ₪72.98
₱2,932.41
List Price:  ₱4,105.61
You save:  ₱1,173.20
¥7,857.17
List Price:  ¥11,000.67
You save:  ¥3,143.49
MX$1,008
List Price:  MX$1,411.29
You save:  MX$403.28
QR181.52
List Price:  QR254.14
You save:  QR72.62
P693.18
List Price:  P970.50
You save:  P277.32
KSh6,450.70
List Price:  KSh9,031.50
You save:  KSh2,580.80
E£2,541.20
List Price:  E£3,557.88
You save:  E£1,016.68
ብር6,354.82
List Price:  ብር8,897.26
You save:  ብር2,542.43
Kz45,590.88
List Price:  Kz63,830.88
You save:  Kz18,240
CLP$49,454.60
List Price:  CLP$69,240.40
You save:  CLP$19,785.80
CN¥364.87
List Price:  CN¥510.85
You save:  CN¥145.98
RD$3,040.26
List Price:  RD$4,256.60
You save:  RD$1,216.34
DA6,753.71
List Price:  DA9,455.74
You save:  DA2,702.02
FJ$115.90
List Price:  FJ$162.28
You save:  FJ$46.37
Q384.44
List Price:  Q538.26
You save:  Q153.81
GY$10,442.13
List Price:  GY$14,619.81
You save:  GY$4,177.68
ISK kr6,976.10
List Price:  ISK kr9,767.10
You save:  ISK kr2,791
DH503.31
List Price:  DH704.68
You save:  DH201.36
L920.86
List Price:  L1,289.28
You save:  L368.41
ден2,954.07
List Price:  ден4,135.94
You save:  ден1,181.86
MOP$399.27
List Price:  MOP$559.01
You save:  MOP$159.74
N$928.04
List Price:  N$1,299.34
You save:  N$371.29
C$1,836.54
List Price:  C$2,571.30
You save:  C$734.76
रु6,797.51
List Price:  रु9,517.06
You save:  रु2,719.54
S/185.85
List Price:  S/260.20
You save:  S/74.35
K202.57
List Price:  K283.61
You save:  K81.04
SAR187.71
List Price:  SAR262.82
You save:  SAR75.10
ZK1,381.27
List Price:  ZK1,933.89
You save:  ZK552.61
L239.16
List Price:  L334.85
You save:  L95.68
Kč1,208.85
List Price:  Kč1,692.49
You save:  Kč483.63
Ft19,737.39
List Price:  Ft27,633.93
You save:  Ft7,896.53
SEK kr544
List Price:  SEK kr761.65
You save:  SEK kr217.64
ARS$51,344.11
List Price:  ARS$71,885.87
You save:  ARS$20,541.75
Bs344.88
List Price:  Bs482.86
You save:  Bs137.98
COP$220,596.26
List Price:  COP$308,852.42
You save:  COP$88,256.15
₡25,341.90
List Price:  ₡35,480.70
You save:  ₡10,138.79
L1,268.10
List Price:  L1,775.44
You save:  L507.34
₲389,249.85
List Price:  ₲544,980.94
You save:  ₲155,731.08
$U2,221.61
List Price:  $U3,110.44
You save:  $U888.82
zł204.67
List Price:  zł286.56
You save:  zł81.88
Already have an account? Log In

Transcript

Hey guys. So in the previous video we saw how we can use bad bash tool to exploit shellshock vulnerability. But we were only able to get to just a normal commercial. That's just the shell right here, which is just a normal commercial. It has low level shell. So it's not roadshow means you can run all to some level commands.

But to run system level commands or wherever, you must escalate all the privileges and get into root. escalating privileges basically means adding more rights or permissions to the user account. So in this video, I'm going to show you guys how you can do Linux privilege escalation by exploiting kernel vulnerability. A privilege escalation attack is as a type of network intrusion that takes advantage of programming errors or design flaws to grant the attacker, more access, elevated access to the network and it's dedicated apps or got on and stuff like that. Since we already have Shell install regular shell up and running. Let's look for the origin ID.

So you can just type your name in a dash a, we have 2624 kernel version running. So that's a pretty old one. Because current versions, it's like about 4.0. So we, we can find a lot of exploits in that particular machine. You can also type LSB. Release Date to see more data about the distribution.

There you go, we got more information. And well, I want to do something like a remote exploit on this particular version. And to get to find exploits for a version you can do in multiple ways. We can do like how we have been doing using source boy, which is an inbuilt tool in Kali or you can use an external database like a website, there's a cool website called exploit dash db.com that'll give you more exploits for versions that you're looking for. Or you can just type in Google for whatever, exploit that you're looking for that particular version, either way, but I'm going to go with the source point since since its inbuilt, I'm just going to use search boy. And I'm sure and I'm actually going to look for privilege because I want to see if there are any privilege exploits, privilege escalation ones.

I want to grep for this leanness because I don't only care about other other machines right now because we're we know that our target machines meta splittable to which is a Unix mission, and also want to grep for kernel just kernel exploits. And what else? Oh, and the last thing that I want to do, I wanted to prefer the version six. Let's see. Awesome. So one of the best ones is an 857 to exploit.

Let's see if we have it here. can use. We can use our for Linux privilege escalation, if you have it looks like Oh, actually we do awesome. There you go. Just copy it. And actually, you know what made it so that I can get the top of it.

That's a pad and let's look for it and see before the patients always get to look at the code before you execute it just so that you can analyze it and see what it exactly does. Enter. Looks like it's a C code, most exploits are unseen. So you got to use like a GCC compiler to do it. And just give it privileges give it like, executable privileges, stuff like that. In this one, it looks like it's just an exploit that leverage is that you functionality that is meant to run arbitrary commands when a device is removed.

So that's kind of what we're looking for right here. So it's a perfect one. And let's look for Well, we already, we already got it. So we're just gonna execute it now. Well actually, before it be executed, we need to make sure that our Apache server is running. So let's, let's do that real quick service, Apache to restart, and service, Apache to status to see if it's actually working or not perfect, so it's running.

Now, now what I want to do is, I want to create like a symbolic link between the directory where the exploit is located and the directory that serves files on the server. So I'm going to try to download it in future. I can just direct download an exploit directly from the server. That's what I'm gonna do. So to make a link, you can just type lm dat As. And the path which in this case it was, let's see, that was that it was to Linux.

So just copy that. And we want to we want to copy that to our local, our server. Sorry. So that would be www HTML. Enter. Also the file already so already tried this before, that's why it's giving me followed.

But if you're trying for the first time, you should not be getting that error. Okay, well, that's perfect. Because we already have it installed. Actually, hold on. I think that's because, oh, I know why. I didn't type local either.

I don't have an insult. so and so. Okay, that's fine. We have the exact exploits Linux local. That's right, WW. It only exists okay.

So our next step is to create an exploit that'll run from the temp folder from directory on the target. So first we need to create the father execute. So on Kali right here, let's go. Let's create a file in our server. So www HTML and just name it something like run. Since it's a bash script, I'm going to solve it that and run in bash.

And now I want to create a listener here because we want to come back so I call it an X IP address, which is 176. So let's go to that. Oh, wait. But this one shows one. So I'm going to restart that real quick, but type 192 1680 That's it. You don't really need to do anything after that.

I can just save it. Oh wait, this is meant bash. So let's type in ash. And yes that is it and W just save it. And now let's go back to our show and I need to repopulate it since the IPS change. Let me go to my Metasploit if it's still say more, that's change.

Okay, so now I'm going to see it. Let me just start my bad bash real quick again. This right here will be bash and cancer So let's wait till we get this in without that awesome. So now since I got the this particular file, I want to get it in here. So let's go to first temp folder because we want to get that exploited here. And just remove whatever is in here.

Ls it and now I want to say so w get HTTP 1921680176, which is my Kali Linux IP, and then run, which is a file which is exploited I want to download and then ls it and see Yep, we got it. Awesome. Now, the next thing is to get us the W gate function again, but this time, we need to get the a 572 script. So for that w http 1921680 176. Again, and that was just local video. Getting it from local and then a five, seven to party inter see if it is download it.

Awesome. We got a download. So since it's just so c file c script, we're just going to compile it using a normal command normal compiler. So GCC dash o exclude just a five out press exploit and a 500 dot c. ls. didn't get it. I wonder why they didn't get though.

Oh, that's because so it's because it's not able to. It's not finding the Id like a dynamic linker. So we need to define the ID command path with a dash B attribute. So all you got to do is just type gcc dash P, and then user the path then and output it as exploit 8572 dot c. There you go. So we got that up. executable as exploit, now all you got to do is you gotta run that, but you will need to run it on the process ID because this particular script, the documentation of this 8572 dot c file, it said that we need to find the P ID which is a process identifier of the Netflix net link socket, which is usually the P ID of the UDF process minus one.

So we can do that easily by looking for Yeah, the process in the process and net and that link should give you all the processes and whichever is like the only one which is not zero. That is our PA. That's the one we need to work mainly to exploit on. You can also check it by typing process and then just ox and then grep only. Yuda. This will give you like the number but plus one. As you can see 229493.

Awesome. So all you got to do now is exploited on that particular number. Before you do this, make sure you open the Netcat listener so that you can get a shell and 444321. Enter. Now go back and type enter. There you go.

We got the host, you got the show on it, just type ID, there you go. We got it. So that's one simple way to do it. It's some it's really efficient if you want to try doing it this way because you actually got past escalations. And when you do that, you can like you can literally see if you're, if you're just a local user or root type, who am I there you see, you got root privileges, so you can literally delete Do where all the executable level functions by this particular exploitation. Well, I hope you enjoyed this video.

We'll see you in the next one.

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.