Linux Exploit Countermeasures & Bypasses Flashcards

1
Q

This tool can be used to examine an executable and display what mitigation it uses.

A

gitsec

https://github.com/slimm609/checksec.sh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

This tool/script can be use to examine an executable and display what exploit mitigation it uses

A

checksec

https://github.com/slimm609/checksec.sh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This is the most popular countermeasures that can be found in most modern software pieces. The idea is that data on the stack is not executable. Often referred as DEP - Data Execution Prevention

A

No eXecute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

If AMD make use of the No eXecute (NX) bit. What does Intel uses?

A

Execute Disable Bit (XD) both 32/64 arch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

If you try to execute any data that lies on the stack, for example after moving the execution flow back to the stack after buffer overflow, the program will crash with a??

A

SIGSEGV

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True / False

NX disallows the execution of data on the stack but having the function argument on the stack is perfectly fine

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

This command can be use to check if the target binary uses the Libc( standard C library in linux)

A

ldd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Using this command you can issue all functions provided by your system’s libc.

A

nm -D /lib/$(uname -m)-linux-gnu/libc-*.so | grep -vw U | grep -v “_” | cut -d “ “ -f3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Using this command you can issue all functions provided by your system’s libc.

A

nm -D /lib/$(uname -m)-linux-gnu/libc-*.so | grep -vw U | grep -v “_” | cut -d “ “ -f3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

This is the distance between the library’s base address and the target function address

A

offset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In order to execute a function that is in libc, we needed to do this 3 step (specified on XDS)

A
  • Find an interesting function that will provide us with a shell
  • Set up the stack properly
  • Overwrite the EIP with the abovementioned function’s address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

This is an exploit countermeasure introduced on the Operating System Level. When ASLR is turned on, upon launching a new process, its core memory areas will be loaded at different address each time.

A

ASLR (Address Space Layout Randomization)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What file is the ASLR setting is held.

A

randomize_va_space

/proc/sys/kernel/randomize_va_space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If the value of ASLR is 0, what does it means?

A

It means that ASLR if OFF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If the value of ASLR is 1, what does it mean?

A

It means that the ASLR is ON and the stack, virtual dynamic shared object page, shared memory regions are randomized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

If the value of ASLR is 2, what does it mean?

A

ASLR is ON and in addition to 1, the data segments are randomize too.

17
Q

To permanently set the value of ASLR which file and value you needed to append on it.

A

/etc/sysctl.conf

kernel.randomize_va_space=0

18
Q

This is another exploit mitigation that is employed on Linux systems. This is also known as stack canary, stack protector, stack guard or SSP

A

Stack Cookie

19
Q

This is a 4-byte value that is pushed onto the stack when a function is entered.

A

Stack Canary

20
Q

When the function ends its task, and the stack frame is cleared, the stack cookie value is checked against the previously pushed value. If it’s different, the program is terminated by calling this function. What is this function?

A

__stack_chk_fail function

21
Q

This one is a type of stack cookie. It is a 4-byte value generated by e.g. /dev/random

A

Random Canary

22
Q

This one is a type of stack cookie. The random canary is additionally XOR’ed with stored control data

A

Random XOR Canary

23
Q

This one is a type of stack cookie. The canary has value of 0x00000000; supposedly, it will be impossible to deliver zeroes to the stack as it’s a null terminator string

A

Null Canary

24
Q

This one is a type of stack cookie. The canary is set to a combination of string terminators like 0x00, 0xff, 0x0a and 0x0d

A

Terminator Canary

25
Q

What are the two signs to detect that stack canary is being used?

A
  • “Stack Smashing Detected”

- Call to __stack_chk_fail or similar function in the disassembly

26
Q

To compile a binary with a Stack Guard in GCC what flag should you use?

A

-fstack-protector-all

27
Q

Is a collection of python modules that commonly used in the CTF binary exploitation challenges.

A

Python Pwntools

28
Q

This flag in GCC instruct the compiler to create a 32-bit executable

A

-m32

**If you encounter an error make sure you install the gcc-multilib

29
Q

This flag in GCC turns off the Position Independent Executable mitigation.

A

-no-pie

30
Q

It’s an exploit mitigation that protects data section of a process from overwriting during an exploitation process

A

RELRO or RELocation Read Only

31
Q

There are two stages of RELRO, on this stage exploitation of arbitrary write is still possible. This can be forced during compilation using the below gcc arguments

-Wl, -z, relro

A

Partial RELRO

32
Q

In order to force full RELRO, what are the additional arguments to be supplied to gcc

A

-Wl, -z, -relro, -z, now

33
Q

If this protection is set, then it can specify a path from which a library can be included. The path is harcoded, and the libraries included do not drop the potential SUID privileges.

A

RPATH

34
Q

This protection is a stronger version of ASLR. Despite what ASLR does, this protection randomizes Code and GOT/PLT elements.

A

PIE (Position Independent Executable) also known as Position Independent Code.

35
Q

This protection utilizes the fact that shipping zero’s within an attacker buffer is often a problem

A

ASCII Armor