i need an explanation about below side headings these are un

i need an explanation about below side headings these are under from buffer over flow attack

5. Defensive countermeasures

5.1 Use of safe libraries

5.2 Writing Correct Code

5.3 Non-Executable Buffers

5.4 Array Bounds Checking

5.4.1 Compaq C Compiler

5.4.2 Array Bounds Checking for C

5.4.3 Purify: Memory Access Checking

5.4.4 Type-Safe Languages

5.5 Pointer protection

5.5.1 Code Pointer Integrity Checking

5.5.2 Hand-coded Stack Introspection

5.5.3 Stack Guard: Compiler-generated Activation Record Integrity Checking

5.5.4 Point Guard: Compiler-generated Code Pointer Integrity Checking

5.6 Deep packet inspection

5.7 Address space layout randomization

5.8 Compatibility and Performance Considerations

Solution

Buffer Overflow occurs when cpoying data from one buffer to another buffer without first checking that the data fits within the destination buffer or not.

5.1 Use of safe libraries: The problem of buffer overflow is common in c and c++ because they use low level representational details of buffers as containers for data types. Buffer overflow must be avoided by maintaining a high degree of correctness in code which perform buffer management. It has also been recommended to avoid standard library functions which are not bounds checked, such as gets,scanf and strcpy. Well written and tested abstract data type libraries which centralize and automatically perform buffer management, including bounds checking, can reduce the impact of buffer overflow. Buffer overflows usually occurs in strings and arrays, Since failure of using safe libraries correctly can resuke buffer oveflow and ther vulnerabilities( bug in the library itself is a vulnerability).\"safe\" library implementation include \"the Better String Library\". The openBSD operating system\'s C library provides the strlcpy and atrlcat functions, but these are more limited than full safe library implementations.

5.2) Writing correct code: In the following example, a program has two data which are adjacent to memory: an 8-bye-long string buffer A,and a 2-byre big-endian integer B.

char A [ 8 ] = \" \";

unsigned short B = 1989;

here A contains nothing bue B contains the number 1989.

Suppose if we want to store a Butterfly in A with 9 characters but A can take only * bytes. By failing to check the length of the string, buffer overflow occured.

5.4.1) when run time checking is enabled the COMPAQ C compiler emits a bad chech in certain cases. These cases arise when an array is accessed using pointer arithmetic and run time array bounds checking is enabled. In such a case, the compiler can output only the checking code for the first pointer arithmetic operation performed on the array.this can result in an incorrect check if the resulting pointer value isagain operated on by pointer arithmetic.

5.4.2) most languages prevent the programmer from going past the end of an array. This process, performed at runtime by the language implementation, is frequently called Bounds checking. In c there is no way for the programmer to determine the size of an array at runtime so the programmer has to track the length of the array. In other languages one can declare an array and then at runtime get the length of that array. For example in java programmer can declare the length of the array using array length property.

for (var i=0; i<arrary.length; i++)

{

   //do something with a[i]

}

In C the programmer has to declare thearray length. If the programmer doesn\'t have the exact knowledge about the information which has to store in the array then it may cause array overflow.

Eg: #define ARRAY_LENGTH (20)

for(size_t i=0; i<ARRAY_LENGTH; i++) {

//do something with a[i]

}

5.4.4) Type safety is used to avod type errors. Type safety is sometimes alternatively considered to be a property of a computer program rather than the language in which that program is written. Type safe code accesses only the memory locations it is authorized to access. Type safe code cannot read values from another objects private fields. well typed programs cannot go wrong.

5.5.1) Code pointer intigrity is a property of C program that guarantees absence of control flow hijack attacks by requiring intigrity of all direct and indirect pointers to code. Code pointer separation is a simplified version of Cpi that provides strong protection against such attacks. SAFESTACK is a component of CPI which ca be used independently and protects against stack based control flow hijacks.

5.5.3) StackGuard is a compiler extension that enhances the executable code produced by the compiler so that it detects and thwarts buffer-overflow attacks against the Stack. The effect is transparent to the normal function of programs.

5.5.4) Most Buffer OverFlow defense provide only partial coverage, and the attacks have adapted to exploit problems that are not well defended such as heap overflow. PointGuard is a compiler technique to defend against most kinds of buffer overflows by encrypting pointers when stored in memory, and decrypting them only when loaded into CPU register.

5.6) Deep packet inspection is a form of computer network packet filtering that examines the data part of a packet asit passes an inspection point, DPI is an advanced method of packet filtering that functions at the application layer of the OSI reference model.

5.7) Address space layout randomization is a memory protection process for operating systems that guard against buffer overflow attacks by randomizing the lacation wher system executable are loaded into memory.

i need an explanation about below side headings these are under from buffer over flow attack 5. Defensive countermeasures 5.1 Use of safe libraries 5.2 Writing
i need an explanation about below side headings these are under from buffer over flow attack 5. Defensive countermeasures 5.1 Use of safe libraries 5.2 Writing

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site