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
€47.98
List Price:  €67.18
You save:  €19.19
£39.89
List Price:  £55.86
You save:  £15.96
CA$69.90
List Price:  CA$97.87
You save:  CA$27.96
A$76.87
List Price:  A$107.62
You save:  A$30.75
S$67.31
List Price:  S$94.24
You save:  S$26.93
HK$389.14
List Price:  HK$544.83
You save:  HK$155.68
CHF 44.67
List Price:  CHF 62.54
You save:  CHF 17.87
NOK kr553.51
List Price:  NOK kr774.97
You save:  NOK kr221.45
DKK kr357.84
List Price:  DKK kr501
You save:  DKK kr143.16
NZ$85.68
List Price:  NZ$119.95
You save:  NZ$34.27
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.46
৳5,972.22
List Price:  ৳8,361.58
You save:  ৳2,389.36
₹4,221.07
List Price:  ₹5,909.84
You save:  ₹1,688.76
RM223.35
List Price:  RM312.71
You save:  RM89.36
₦84,627.22
List Price:  ₦118,484.88
You save:  ₦33,857.66
₨13,887.22
List Price:  ₨19,443.22
You save:  ₨5,556
฿1,722.96
List Price:  ฿2,412.28
You save:  ฿689.32
₺1,727.27
List Price:  ₺2,418.32
You save:  ₺691.05
B$289.99
List Price:  B$406.01
You save:  B$116.02
R905.58
List Price:  R1,267.89
You save:  R362.30
Лв93.83
List Price:  Лв131.37
You save:  Лв37.54
₩70,211.45
List Price:  ₩98,301.65
You save:  ₩28,090.20
₪185.06
List Price:  ₪259.10
You save:  ₪74.04
₱2,946.36
List Price:  ₱4,125.14
You save:  ₱1,178.78
¥7,736.95
List Price:  ¥10,832.35
You save:  ¥3,095.40
MX$1,021.22
List Price:  MX$1,429.79
You save:  MX$408.57
QR182.26
List Price:  QR255.18
You save:  QR72.92
P683.46
List Price:  P956.90
You save:  P273.44
KSh6,472.14
List Price:  KSh9,061.51
You save:  KSh2,589.37
E£2,482.01
List Price:  E£3,475.01
You save:  E£993
ብር6,118.22
List Price:  ብር8,566
You save:  ብር2,447.77
Kz45,640.87
List Price:  Kz63,900.87
You save:  Kz18,260
CLP$49,324.13
List Price:  CLP$69,057.73
You save:  CLP$19,733.60
CN¥362.07
List Price:  CN¥506.93
You save:  CN¥144.86
RD$3,012.01
List Price:  RD$4,217.06
You save:  RD$1,205.04
DA6,712.40
List Price:  DA9,397.90
You save:  DA2,685.50
FJ$113.77
List Price:  FJ$159.29
You save:  FJ$45.51
Q385.78
List Price:  Q540.13
You save:  Q154.34
GY$10,455.70
List Price:  GY$14,638.82
You save:  GY$4,183.11
ISK kr6,982.60
List Price:  ISK kr9,776.20
You save:  ISK kr2,793.60
DH502.76
List Price:  DH703.91
You save:  DH201.14
L910.90
List Price:  L1,275.33
You save:  L364.43
ден2,951.80
List Price:  ден4,132.76
You save:  ден1,180.95
MOP$400.70
List Price:  MOP$561.01
You save:  MOP$160.31
N$906.31
List Price:  N$1,268.91
You save:  N$362.60
C$1,838.97
List Price:  C$2,574.70
You save:  C$735.73
रु6,749.45
List Price:  रु9,449.77
You save:  रु2,700.32
S/189.51
List Price:  S/265.32
You save:  S/75.81
K201.21
List Price:  K281.71
You save:  K80.50
SAR187.68
List Price:  SAR262.77
You save:  SAR75.08
ZK1,382
List Price:  ZK1,934.92
You save:  ZK552.91
L238.86
List Price:  L334.42
You save:  L95.56
Kč1,216.06
List Price:  Kč1,702.59
You save:  Kč486.52
Ft19,746.05
List Price:  Ft27,646.05
You save:  Ft7,900
SEK kr551.69
List Price:  SEK kr772.42
You save:  SEK kr220.72
ARS$50,182.44
List Price:  ARS$70,259.44
You save:  ARS$20,076.99
Bs345.34
List Price:  Bs483.50
You save:  Bs138.16
COP$219,443.60
List Price:  COP$307,238.59
You save:  COP$87,794.99
₡25,456.77
List Price:  ₡35,641.51
You save:  ₡10,184.74
L1,262.95
List Price:  L1,768.23
You save:  L505.28
₲390,155.46
List Price:  ₲546,248.87
You save:  ₲156,093.40
$U2,130.69
List Price:  $U2,983.14
You save:  $U852.45
zł208.13
List Price:  zł291.40
You save:  zł83.27
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.