Question: Here's the vulnerable C code snippet: #include void malicious _ function ( ) { printf ( Malicious function executed! ) ; } void
Here's the vulnerable C code snippet:
#include
void maliciousfunction
printfMalicious function executed!
;
void funcptr;
void vulnerablefunction
Vulnerability: Overwriting funcptr with maliciousfunction's address
funcptr maliciousfunction;
int main
Call vulnerable function
vulnerablefunction;
Indirect function call through funcptr
funcptr; Potential security risk if funcptr is pointing to maliciousfunction
Rest of the program
return ;
With CFI enabled, describe in detail how it prevents the attack and ensures the control flow integrity.
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
