This topic was presented by one of the groups and you probably remember the basi
ID: 3917461 • Letter: T
Question
This topic was presented by one of the groups and you probably remember the basic principles of stack overflow attack: Only compiled languages are subject of exploitation; Compiler can be instructed (default behavior) to inject special instructions preventing the attack; Operating system (if properly designed) can make post-exploitation very difficult in terms of not allowing to re-use the same memory addresses by its processes; . A vulnerable program is the one that has pre-defined memory allocation scheme, e.g. int a[10] and doesn't validate the length of memory buffer while copying; There are situations in which some (or all) of these principles have to be neglected in order to implement certain feature and/or improve performance Discuss on where and under what circumstenses some or all of the aforementioned principles can be safely violated. Justify your discussion by examples.Explanation / Answer
int a[10];
-int a[10] when we copying data it will not validate that you are dumping data going above 10th location.
-we need to bound it and we need to take care for that data should be fill up to 10 location.
-in "int a[10]" - manager is not taking care that data on location is cleaned it is garbage values.Here this type of mecanisam is becase of if we going for clean the data it will take more cycle so that we are safely violate this circumstens.
ex:
#include <stdio.h>
int main(void)
{
int a[10];
int i =0;
for(i=0; i<10; i++)
{
printf("%d ",a[i]); //print garbage data.
}
printf(" ");
}
- even we need to take care when we are putting data in array. if a[10] array is there. if we filling data like:
a[11] = 99;
It will allow if that location is assigned to another variable in program. so this is we need to take care.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.