Lecture 6 Flashcards

1
Q

What is Buffer Overflow?

A
  • A common attack mechanism
  • Caused by “BUFFER OVERUN /Storing beyond the limit of a fixed sized buffer

Writing data to a buffer overruns the buffer boundary and overwrites the memory.

Located in the stack, heap and data section of the process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Consequences of Buffer Overflow

A
  • Corruption of the program data
  • Unexpected transfer of control
  • Memory access violations
  • Execution code chosen by the attack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Exploiting Buffer Overflow attacks

A
  • A program that can be triggered using external source data under the attacker’s control
  • Stored in memory > potential corruption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Identify vulnerable programs

A
  • Inspection program source
  • Triggering execution of programs in large variables
  • Using tools ‘Fuzzing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Stack Buffer Overflow?

A
  • Known as Stack Smashing
  • Writes memory address on the stack OUTSIDE of the data structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Stack Frame?

A
  • One function calls another to its address
  • Passes parameters to save each register value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Shell code and Machine code

A
  • A small piece of code used as a payload in the exploitation of a software vulnerability

Machine code

  • A set of instructions executed directly by a CPU, performing a specific task: LOAD, JUMP or ALU operation on the memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Stack Overflow variants + the target programs

A
  • Launch a remote shell
  • Creates a reverse shell back to hacker
  • Use local exploits to establish hacker
  • Flush firewall to block hacker
  • Break out of chroot to enter the system

Target programs:

  • Trusted system utility
  • Network service daemon
  • Library code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Buffer Overflow Defence

A

Compile time: Hardens programs to resist attacks in new programs

Runtime: DETECT + ABORT attacks from **existing programs **

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Compile Time Defences: Programming Language

A
  • Uses High Level language
  • Enforces a range of checks and permissions on variables
  • Not vulnerable to buffer overflow attacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Compile Time Defences: Safe Coding Techniques

A
  • Needs to inspect code and rewrite an unsafe codes
  • Placing emphasis in efficacy and performance when _writing code than type safely _
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Compile Time Defences: Languages Extensions/Safe Library

A
  • Handling dynamically allocated memory is more problematic because the size information is not available at compile time
  • Requires extension on the library routines
  • Libraries and programs need to be **recompiled **
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Compile Time Defences: Stack Protection

A
  • Add function entry and exit code to check stack for signs of corruption
  • Used on different systems
  • Function entry writes a copy of the return address to a safe region of memory
  • Function exit code checks if the return address is in the stack frame against the saved copy
  • If change is found > aborts program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Run Time Defences: Executable Address Space Protection

A
  • Use virtual memory support regions of memory
  • Non-executable
  • Requires support from MMU

Issues:

  • Executable Stack code
  • Support provisions are needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Run Time Defences: Address Space Randomisation

A
  • Manipulate location of key data structures

Stack, heap and global data

  • Using random shift for each processes
  • Code needs to run for the shell code to open to the attacker
  • Randomise location of heap buffers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Run Time Defences: Guard Pages

A
  • Place guard pages between regions of memory
  • Exploits a process having more vital memory available than it typically needs
  • Flagged in MMU as illegal addresses

Any attempted access aborts process

17
Q

Replacement Stack Frame

A
  • Overwrites buffer and frame pointer address
  • Frame pointer becomes a dummy stack
18
Q

Off-by-one attacks

A
  • Coding error that allows one+ byte to be copied for more space
19
Q

Return to System call

A
  • Stack overflow variant replaces return address with standard library
  • Non-executable stack defences
  • Attacker constructs suitable parameters on stack above return address
20
Q

Global Data Overflow

A
  • Attack buffer can be located in the global data
  • Located above program code
  • Has function and vulnerable pointer

Defence:

  • Non-executable random global data region
  • Guard pages
21
Q

SQL Injection Attack

A
  • Used to inject malicious SQL statements to steal information from a database
  • Similar to command injection
22
Q

Command injection

A
  • Executing commands to gain control over a server
    • PHP remote code injection vulnerability
    • PHP file inclusion vulnerability
23
Q

Cross site scripting

A
  • Vulnerability found in Web Applications
  • Injects client-side script into Web pages viewed by other users
  • Browsers impose security checks and restricts data access to pages from the **original site **