Jump to content
against_modern_football

Exploit this

Recommended Posts

Posted (edited)

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>

void catcher(int a)
{
setresuid(geteuid(),geteuid(),geteuid());
printf("WIN!\n");
system("/bin/sh");
exit(0);
}

int main(int argc, char **argv)
{
puts("source code is available in level02.c\n");

if (argc != 3 || !atoi(argv[2]))
return 1;
signal(SIGFPE, catcher);
return abs(atoi(argv[1])) / atoi(argv[2]);
}

Codul trebuie sa sara din IF si sa ajunga la urmatoarea instructiune. ( nu merge divide by 0 din cauza la !atoi(argv[2]). Are careva vreo idee?

./level02 -2147483648 -1

Trebuie impartit cel mai mic integer negativ la -1 si primesc aceeasi exceptie

Edited by against_modern_football
ca nu mai e nevoie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...