In which order the following ‘arguments’ of the foo() function will be put on the stack (the left-most variable has the highest memory address and the right-most variable has the lowest memory address)?
void foo(int d, int s, string x, int e)
d, s, x, e. |
e, x, s, d. |
x, d, s, e. |
d, s, e, x. |
To execute an external command from inside a program, either of the ‘system()’ or ‘execve()’ functions can be used. Select ALL of the following statements that are TRUE.
The ‘execve’ function is more secure as it uses different channels for data and code. |
The ‘execve’ is less secure as it takes more arguments. |
The ‘system’ function is less secure because it removes the boundary between data and code. |
The ‘system’ function is more secure as it relies on the shell to execute the command. |
What will the following command will instruct the system to do?
sudo sysctl -w kernel.randomize_va_space=1
Torn on randomisation of both the heap and the stack. |
||
Turn off randomisation of address space. |
||
Turn on the heap randomisation only. |
||
Turn on stack randomisation only. |
Calculate the address of the ‘Return Address’ assuming that the offset between the buffer and ebp is 77 bytes, and ebp is pointing to the address 0xbffea120.
0xbffea0d3 (= ebp – 77). |
||
0xbffea171 (= ebp + 81). |
||
0xbffea16d (= ebp + 77) . |
||
0xbffea124 (= ebp + 4). |
What will be the consequence of overwriting the return address with the address of a valid instruction in the kernel area of the system?
The program will execute the instruction. |
||
The program will crash. |
||
The system will crash. |
||
The system will execute the next command. |
A vulnerable program allows the user to provide input that will be used directly as an argument for a printf() function. Which of the following will allow the attacker to reveal the value of a variable stored on the ‘heap’ if he knows that the distance between the address of the variable (on the stack) and va_list is 16 bytes?
%s%s%s%s%s |
||
%d%d%d%d%s |
||
%d%d%d%d |
||
%d%d%d%d%n |
||
%d%d%d%d%d |
||
%d%d%d%s |
A company purchases cyberinsurance to cover loss of revenue due to denial-of-service attacks. This illustrates which of the following options for addressing a risk.
Transfer. |
||
Mitigate. |
||
Eliminate. |
||
Accept. |
Chinese shipbuilders in the 12th century CE used watertight compartments to ensure that if one part of the ship was leaking, the ship itself would not sink. Which of the following security principles does this illustrate?
Secure the weakest link. |
||
Economy of mechanism. |
||
Minimize the attack surface. |
||
Establish trust boundaries. |
Which of the following format specifiers allows you to ‘write’ into memory?
%s |
||
%n |
||
%d |
||
%x |
A supermarket manager is concerned about a recent increased incidence of shoplifting. Which of the following mechanisms best illustrates the principle of psychological acceptability?
Customers must pass through an X-ray machine as they leave the store. |
||
Customers are monitored using hidden cameras as they shop. |
||
Customers are followed by security guards around the store as they shop. |
||
Customers cannot enter the store, they must ask staff to fetch the items for them. |
Which of the following threat modelling techniques is least likely to uncover a potential zero-day attack?
STRIDE. |
||
Persona non grate (PnG). |
||
Security cards. |
||
Misuse case. |
Stack frame is constructed implicitly for memory allocation during the function call. Explicitly, memory allocation can be effieciently handled by heap area using malloc(),calloc(),realloc(),new, free() and delete respectively. Coming to question, the function parameters are pushed on the stack before the function is called and the parameters are pushed from right to left. This means that the last parameter is pushed first and the first parameter is pushed last. As a result of this first parameter will naturally be closest to the top of the stack. So the order of the ‘arguments/parameters' for the function call void foo(int d, int s, string x, int e) will be:
e,x,s,d.
Get Answers For Free
Most questions answered within 1 hours.