Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you please identify two vulnerabilities and explain how they could be exploited by an attacker. Please use a diagram to explain the attack mechanism.

can you please identify two vulnerabilities and explain how they could be exploited by an attacker. Please use a diagram to explain the attack mechanism. I believe it is vulnerable to buffer overflow but im not 100% sure. Then can you please demonstrate code improvements that. could be used to prevent the attack, please include the source code that would be used to illustrate the improvements. Code is in C.

class employee{ public: char name[10]; char address[10]; ... void setName(char* nm){ strcpy(name, nm); } void getName(char** nm){ strcpy(*nm,name); } void setAddress(char* adr){ strcpy(address, adr); } void getAddress(char** adr){ strcpy(*adr,address); } }; int main() { employee emp; char p[10]; ... emp.setName(p); ... emp.getName((char**)&nm); return 0; }

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

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions