+ All Categories
Home > Documents > CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Date post: 18-Jan-2018
Category:
Upload: sydney-golden
View: 222 times
Download: 0 times
Share this document with a friend
Description:
OS Limitations OS uses top half User programs use lower half
31
CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook
Transcript
Page 1: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

CNIT 127: Exploit Development

Lecture 7: 64-bit Assembler

Not in textbook

Page 2: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

64-bit Registers

• rip = Instruction pointer• rsp = top of stack

Page 3: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

OS Limitations

• OS uses top half

• User programs use lower half

Page 4: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.
Page 5: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Windows Limitations

• Windows 2008 Server uses 44 bits– Max. 16 TB RAM

• Windows 8.1, 2015 revision, uses 48 bits– Max. 256 MB RAM

• Links Ch L7d, L7e

Page 6: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.
Page 7: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

System Calls

• syscall replaces INT 80

Page 8: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

L7h: Searchable Linux Syscall Table

Page 9: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

L7c: Introduction to x64 Assembly | Intel Developer Zone

• More details about registers

Page 10: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.
Page 11: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Syscall 1: Write

Page 12: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Simplest Program: ABC

Page 13: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Works, then Crashes

Page 14: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Exit

Page 15: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Works Without Crashing

Page 16: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Using a .data section

Page 17: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Objdump

Page 18: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Using gdb

• .data and .text sections appear the same

Page 19: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

.text and .data Sections

Page 20: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

info registers

Page 21: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Using read

Page 22: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

"echo" with a .data section

Page 23: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Works with Junk at End

Page 24: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Caesar Cipher

Page 25: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Works for 4 Bytes Only

Page 26: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Objdump Shows a 32-bit Value

Page 27: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Must use a Register

Page 28: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Now it Works

Page 29: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Challenge 1"Hello from YOURNAME"

Page 30: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Challenge 2Caesar (3 steps back)

Page 31: CNIT 127: Exploit Development Lecture 7: 64-bit Assembler Not in textbook.

Challenge 3: XOR Encryption


Recommended