QuestionQ716
Web Application Injection AttacksYou came across the following code snippet while investigating an incident involving a business-critical system. The code crashed immediately after a user supplied the following input:
%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
void main()
\{
char a[200];
scanf(`%s`, a);
printf(a);
\}
What caused the crash?
- A This is a buffer overflow attack that is caused by the stack address space being pushed to printf()
- B This is a format-string attack that could have referenced a reserved address space or the memory pointed by that number might not exist
- C The crash could have been due to mismatch in the address space that is being referenced in the code
Community Discussion