Quiz (NIX Access Control) Flashcards

1
Q

Linux (Unix) is a single-user OS. T/F

A

False. Its multiuser. Android is based on Linux.

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

Goals for main security mechanisms? (2 points)

A
  • Enable user separation
  • Enable protection of system code from user code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Special users running specific processes and root. T/F

A

True. For system process, root can do everything.

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

To perform system-level operations, a process invokes kernel code by using system calls. T/F

A

True.

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

Every running process has a ____ and ____.

A

Real user ID and effective user ID

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

What is the Real User ID? (2 points)

A
  • The User ID of the user who opened the program
  • Formally, the Real User ID of the parent process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Effective user ID? (3 points)

A
  • The User ID actually used to determine what a process can do
  • Typically, User ID == Real User ID
  • Formally, the Effective User ID of the parent process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

User ID is a numeric value and it has an associated user name. T/F

A

True

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

The user root can do “everything”, its User ID is 1. T/F

A

False. The User ID is 0.

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

Every file has an associated owner user and an associated owner group. T/F

A

True.

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

Which command to use to list files and their owners?

A

ls -la

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

What is the command chown used for?

A

Change owner user/group

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

What is the command chmod used for?

A

Chmod changes file permissions.

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

When you interact with a CLI in a Linux machine you are actually interacting with a dedicated program. T/F

A

True

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

Bash creates child opens processes to run the program you specify on the command lines. T/F

A

True

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

What is setuid() used for?

A

When a program is executed (./program) the real UID and the effective UID of the corresponding process is the current user (displayed by id).

17
Q

If a program is stored in a setuid file, the owner of the corresponding process will be the ___. This allows users to ____.

A

The owner of the file program; perform privileged operations, by opening setuid programs

18
Q

When a process creates a new process, the child process ____.

A

keeps the same real user ID and effective user ID of its parent process

19
Q

New processes are normally created with the ___ system calls.

A

fork/execv

20
Q

Bash runs with _______.

A

real/effective user ID of the logged in user

21
Q

If a program is stored in a setuid file, when run, the effective user ID of the executed program is equal to ___.

A

the owner of the file. The real user ID is unchanged.

22
Q

Setuid programs must check that the calling user is ____.

A

supposed to execute the requested operation

23
Q

Sudo allows to execute any command as the root user, but only if ___.

A

the correct user’s password is inserted

24
Q

Supply a value of -1 for either the real or effective user ID forces ___.

A

the system to leave that ID unchanged

25
Q

Unprivileged processes may only set ___ to the ___.

A

effective user ID; real user ID/effective user ID

26
Q

Unprivileged processes may only set ___ to the ___.

A

real user ID; the real user ID/effective user ID

27
Q

The setuid bit may be ignored in some folders if ___.

A

the filesystem is mounted with the nosuid option.

28
Q

Debugging tools use the syscall ___.

A

ptrace

29
Q

ptrace allows ___.

A

an external process to read/modify code and data of another process.

30
Q

If a program is started using ptrace, the setuid bit is ignored. T/F

A

True

31
Q

If a program passes unsanitized user input to printf, we can cause it to utilize values from the stack that were not intended as parameters printf. T/F

A

True. This allows us to leak data from the program.

32
Q

If there is a buffer on the stack that can be overflown, the control flow of the program can be hijacked. T/F

A

True

33
Q

If there is an interesting function that we want to call, we can overwrite the return address with its address. T/F

A

True

34
Q

“-z execstack” what does this do?

A

makes the stack data executable, normally it is not

35
Q

“-fno-stack-protector” what does this do?

A

disable stack canaries. Stack canaries are used to detect buffer overflows corrupting the saved return address.

36
Q

“-no-pie” what does this mean?

A

makes the location where the main program is loaded fixed. In modern systems, this location is randomized making exploitation harder

37
Q

How can “-no-pie” be bypassed?

A

It can be bypassed by using an additional exploit to leak the location of the main program.