Questionnaire

For this challenge, we are given test.c and a compiled executable test. On the other hand, we also have the endpoint provided by HTB.

If we connect to the given IP via netcat or similar software, we are prompted to answer a series of questions.


0x1. Is this a ‘32-bit’ or ‘64-bit’ ELF?

test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5a83587fbda6ad7b1aeee2d59f027a882bf2a429, for GNU/Linux 3.2.0, not stripped

0x2. What’s the linking of the binary?


0x3. Is the binary ‘stripped’ or ‘not stripped’?


0x4. Which protections are enabled (Canary, NX, PIE, Fortify)?

[*] '/HTB/challenges/pwn/pwn_questionnaire/test'
    Arch:       amd64-64-little
    RELRO:      Partial RELRO
    Stack:      No canary found
    NX:         NX enabled
    PIE:        No PIE (0x400000)
    SHSTK:      Enabled
    IBT:        Enabled
    Stripped:   No

0x5. What is the name of the custom function that gets called inside main()? (e.g. vulnerable_function())

void main(){
    vuln();
}

0x6. What is the size of the ‘buffer’ (in hex or decimal)?

char buffer[0x20] = {0};

0x7. Which custom function is never called? (e.g. vuln())


0x8. What is the name of the standard function that could trigger a Buffer Overflow? (e.g. fprintf())


0x9. After how many bytes does a Segmentation Fault occur (in hex or decimal)?

printf 'A%.0s' {1..n} | ./test

0xa. What is the address of gg() in hex? (e.g. 0x401337)

gdb test
info functions

Finally, the challenge is solved.

Home