Why when I compile and run this there doesn't pop out an address?
Code:#include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { int i, jmps; char *ptr = (char *) 0xffffe000; jmps = 0; for (i = 0; i < 4095; i++) { if (ptr[i] == '\xff' && ptr[i+1] == '\xe4') { printf("* 0x%08x : jmp *%%esp\n", ptr+i); jmps++; } } if (!jmps) { printf("* No JMP %%ESP were found\n"); } return 1; }
Ok, it seems as if you're trying to find a vulnerability in linux-gate.so.1 DSO, probably as part of a buffer overflow tutorial?
I would guess your kernel was compiled in such a manner that JMP *%ESP can't be found in your linux-gate.so.1 (and therefore no such vulnerability).
"\x74\x68\x65\x70\x72\x65\x7a\x39\x38";
Well, that depends on the tutorial. If you're following this guide, then the same OS/kernel as the guide would be appropriate; OpenSuSE 10.2, kernel 2.6.18, gcc 4.1.2.
"\x74\x68\x65\x70\x72\x65\x7a\x39\x38";