Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following program with format string vulnerability: fmt _ vuln.c #include #include #include int main ( int argc, char * argv [ ] )
Consider the following program with format string vulnerability:
fmtvuln.c
#include
#include
#include
int mainint argc, char argv
char text;
static int targetedval xaaaa;
ifargc
printfUsage: s
argv;
exit;
strcpytext argv;
printftext;
printf
;
printf targetedval @ xx d xx
&targetedval, targetedval, targetedval;
exit;
We have the following six commands execution results:
$ fmtvuln AAAAxxxx
AAAAffdbfcffbc
targetedval @ xcxaaaa
$ fmtvuln $printf xxcxxxxxs
ffbfcffcZZZZ
targetedval @ xcxaaaa
$ fmtvuln $printf xxcxxxxxn
ffabfcffbfc
targetedval @ xcxf
$ fmtvuln $printf xxcxxxxxn
ffaccfcffaac
targetedval @ xcxc
$ fmtvuln $printf xxcxxxxxn
ffdbdfc
targetedval @ xcxc
$ fmtvuln $printf xxcxxJUNKxxcxxJUNKxaxcxxJUNKxbxcxxxxxnxnxnxn
JUNKJUNKJUNKffbdfc
ffbaecc bea bea bea
targetedval @ xcxddccbbaa
Which of the followings isare true?
Group of answer choices
$ fmtvuln $printf xxcxxxxxn
ffabfcffbfc
targetedval @ xcxf
writes to address xc
Similarly,
$ fmtvuln $printf xxcxxxxxn
writes to address xc
$ fmtvuln $printf xxcxxxxxn
ffabfcffbfc
targetedval @ xcxf
writes to address xc
Similarly,
$ fmtvuln $printf xxcxxxxxn
writes to address xc
$ fmtvuln $printf xxcxxxxxn
ffdbdfc
targetedval @ xcxc
writes to address xc
Similarly,
$ fmtvuln $printf xxcxxxxxn
writes to address xc
$ fmtvuln $printf xxcxxxxxn
ffabfcffbfc
targetedval @ xcxf
writes to address xc
Similarly,
$ fmtvuln $printf xxcxxxxxn
writes to address xc
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started