PWN day 15

Nick Mckenney
2 min readJun 9, 2024

--

A safe practice is passing pointers with a size. Often this leads to a control hijack

ASLR -> Protection against a control flow hijack by randomizing layout of address space

One new thing learned is every process a parent forks off will copy its canary to the child

As mentioned before, pages are always aligned by 0x1000

That means to overwrite a page offset could be done by 2 bytes

Uninitalized Data-> Basically uncleaned data from the stack

Deallocating a stack frame doesnt wipe data

I mention this because a challenge I am working on is storing a memory value I need to retrieve.

In this case it is the ABCDEG

In vararg I can see if I dump more of my addresses I can see the goal value

After looking a bit more, I can of course take advantage of the printf vulns and do just format strings

Moving on to the next challenge

The first thing I noticed is its creating a stack frame of size 0x90 bytes

Next there is a variable with size 0x60 bytes

I see this read takes in 0x1000 bytes

So basically all i have to do to solve this is write a simple bin/zsh shellcode to maintain priv of the file im executing, then redirect my ret address to the buffer of the shellcode.

Then I get root. This would not work with bin/sh. Only with zsh

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response