Question: 5 Task 2 : Printing Out the Server Program s Memory The objective of this task is to get the server to print out some
Task : Printing Out the Server Programs Memory
The objective of this task is to get the server to print out some data from its memory we will continue to
use The data will be printed out on the server side, so the attacker cannot see it Therefore,
this is not a meaningful attack, but the technique used in this task will be essential for the subsequent tasks.
Task A: Stack Data. The goal is to print out the data on the stack. How many x format specifiers
do you need so you can get the server program to print out the first four bytes of your input? You
can put some unique numbers bytes there, so when they are printed out, you can immediately tell.
This number will be essential for most of the subsequent tasks, so make sure you get it right.
Task B: Heap Data There is a secret message a string stored in the heap area, and you can find the
address of this string from the server printout. Your job is to print out this secret message. To achieve
this goal, you need to place the address in the binary form of the secret message in the format string.
Most computers are smallendian machines, so to store an address xAABBCCDD four bytes on a
bit machine in memory, the least significant byte xDD is stored in the lower address, while the
most significant byte xAA is stored in the higher address. Therefore, when we store the address in a
buffer, we need to save it using this order: xDDxCCxBB and then xAA. In Python, you can
do the following:
number xAABBCCDD
content:numbertobytesbyteorderlittle
Task : Modifying the Server Programs Memory
The objective of this task is to modify the value of the target variable that is defined in the server program
we will continue to use The original value of target is x Assume that this
variable holds an important value, which can affect the control flow of the program. If remote attackers can
change its value, they can change the behavior of this program. We have three subtasks.
Task A: Change the value to a different value. In this subtask, we need to change the content of
the target variable to something else. Your task is considered as a success if you can change it to a
different value, regardless of what value it may be The address of the target variable can be found
from the server printout.
Task B: Change the value to x In this subtask, we need to change the content of the
target variable to a specific value x Your task is considered as a success only if the vari
ables value becomes x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
