Countermeasures Flashcards
How to prevent buffer overflows?
- Write decent programs
- Use language with boundary checking
- Perform an analysis before (static) or during (dynamic) execution
- Modify how programs are loaded and executed by kernel
What are the special and safe languages?
Interpreted languages
- Cyclone
- CCured
What are the tools for static analysis?
- Splint
- Cqual
- Metacompilation
- PREfix / PREfast
- BOON
- ITS4, Flawfinder, RATS
What are the tools for dynamic analysis?
- Purify
- Valgrind
- Information flow / taint analysis
What are the substitutes for libc ?
- LibSafe
- Contra Police
What is the goal of the containment approach?
To limit the damage that a hijacked application can cause
(policy enforcement and sandboxing)
What are the detection approaches?
System call analysis: signatures, sequences, control-flow-driven analysis, parameter modelling
Mimicry attacks
Compiler Modifications: boundary checking and integrity checking
What is StackGuard?
Canary-based solution: a terminator, random or XOR canary is written before return address on the stack.
This value is verified during epilogue before performing return instruction.
What is non-executable memory?
Use stack/heap for storing data not code so it does not need to be executable, if we try to execute code in these regions, it will cause a segmentation fault.
Can be bypassed by return-into-libc attack
What is return-into-libc?
Existing code in standard C library is used instead of injecting and executing shellcode on the stack. Return address over written with address of a libc function. Attacker can execute arbitrary commands by controlling arguments asked into function (e.g. system(“/bin/sh”))
What is ASLR?
Address space layout randomisation randomises the position of the heap, the stack, and the code
What is soundness?
If analysis says that X is true, then X is true
If the program is claimed to be error free, then it really is
No false alarms
What is completeness?
If X is true, then analysis says X is true
If the program is claimed to be erroneous, then it really is
May get false alarms