This is the first post from a long series on vulnerability research and techniques for exploit dev
out target todat:3x17 from pwntable.tw
ahamahamaham this blog is based on v1cky's blog(https://v1ckydxp.github.io/2019/04/26/pwnable-tw-3x17-writeup/)
Now withdouth further a do,ladies and gentalmen let's get started
First things this
Binary information gathering
One of the first things when investigating a CTF task and more even if it's a pwn one,we need to check for some mitigations.This can be achived by using checksec util.
Upon runnning checksec we get back that the binary is stack protected(NX bit set) and the fact that ther are no other mitigations. NX bit will not be a problem,cause we can bypass it using ROP(return oriented programming)Reverse Engineering the binary
Upon inspecting main function we see there is no vulnerability,just a "feature" we can write any address anything we want.So we have a write-what-where primitive.But now how can we get RCE?
RCE
Now this is similar to some challenge from hitcon.The author of this challenged wanted this challenge to be solved in a specific way.Now the way we are supposed to solve this challenge is by overwriting call.fini.array array. call.fini.array array is an array which holds the function executed after the execution of the program ends.Now if we can overwrite it when the binary finishes normal execution,we can get RCE.One more thing to note is that.fini.array the functions saved in the array are executed in reverse order, first first.fini.array[1] and then execute fini.array[0].We can change value of array[1] to the address of the main function than the.fini.array[0] to 0x402960,so that after the execution of main execution ends to continue to execute the function that calls the main function(0x402960).This allows the formation of a loop has been arbitrary address overwrite.From there we just crash a /bin/sh ROP chain.
here is the exploit:
Hi
ReplyDeleteAs we have discussed during the class, we should have at least 10 posts before the approaching deadline of continuous assessment
•Introduction Post - 3
1. Welcome
2. Introduction
3. Current skills
•Initial Ideas on Major Project - 2
1. Initial Idea One
2. Initial Idea Two
•Chosen Project Theme and Further Research Posts -2/3
1. Project Theme
2. Computer Ethics (1/2 posts on this)
•Project Plan - 2
1. Project plan
2. Gantt-chart
•Research Essay - 3
1. Introduction
2. Main Body
3. Conclusion (including reference list as Harvard style of referencing)
Many thanks
Chirag