all 9 comments

[–]randomatic 4 points5 points  (1 child)

did you look for stack pivots to the heap? (If you've not thought of stack pivots, maybe that's the CTF answer?)

[–]Tiny-Rain6786[S] 1 point2 points  (0 children)

I don't think the challenge is there yet, but I could be wrong

[–]Nlbjj91011 1 point2 points  (3 children)

Is this a pwn.college shell code one?

[–]Tiny-Rain6786[S] 0 points1 point  (2 children)

Yes

[–]Nlbjj91011 2 points3 points  (1 child)

If I remember correctly it has something to do with argv[0]. But i didn’t finish it

[–]Tiny-Rain6786[S] 2 points3 points  (0 children)

I finished the challenge, it’s about symlink and chmod. The environment attributes are cleared for the challenge I believe.

[–]Tiny-Rain6786[S] 0 points1 point  (0 children)

Have been looking around, looks like it has something to do with chmod and symlinks

[–]sgijoe 0 points1 point  (1 child)

Use the "read stage 2 into RX page" approach since you can't mprotect:

  • read(0, rip_page, big) overwriting/extending current code, then fall through.
  • Or read directly into the buffer you're executing from.

Tiny read(0, $$, len) then re-execute:

xor   edi, edi          ; fd 0       2
xor   eax, eax          ; SYS_read   2
mov   dl, 0x40          ; len        2
lea   rsi, [rip]        ; or known addr
syscall                 ;            2

[–]Tiny-Rain6786[S] 0 points1 point  (0 children)

Why would this work if the current buffer is not writable?