intro to hardware firmware hacking

22
Intro to Hardware Firmware Hacking Andrew Freeborn 1

Upload: andrew-freeborn

Post on 12-Apr-2017

134 views

Category:

Technology


9 download

TRANSCRIPT

Page 1: Intro to Hardware Firmware Hacking

Intro to Hardware Firmware Hacking

Andrew Freeborn

1

Page 2: Intro to Hardware Firmware Hacking

• The Wild West

• What’s MIPS

• Let’s break it

• Pictures!

Agenda

2

Page 3: Intro to Hardware Firmware Hacking

Embedded Devices

3

Page 4: Intro to Hardware Firmware Hacking

• Cheap and everywhere

• Lots of options for home routers, modems, etc

• New models every year with new features

• No real regulation of the safety and strength of the security of the device (CyberUL to help?)

• Krebs attack / Ukraine power grid

Embedded Devices Are Awesome

4

Page 5: Intro to Hardware Firmware Hacking

We get it, they’re bad

5

Page 6: Intro to Hardware Firmware Hacking

TLC?

6

Page 7: Intro to Hardware Firmware Hacking

• Easy to get into surprisingly

• Easier if you stick to the rivers and lakes.... Software

• Like many problems, issues can be fixed when there is attention on them

They’re not bad, they just need TLC

7

Page 8: Intro to Hardware Firmware Hacking

• All software updated

• Kernel updates

• Kernel hardening

• Compiler protections

• Make updating easy and secure with little effort

• Scanned for vulnerabilities

Embedded Device Solutions

8

Page 9: Intro to Hardware Firmware Hacking

• DVRF

• MIPS CPU

• MIPS assembly >>

• ???

• Profit • MIPS binaries

When do we get to see dat MIPS

Page 10: Intro to Hardware Firmware Hacking

• hello.c • MIPS diassembly

What the MIPS?

https://www.onlinedisassembler.com/odaweb/GzjLonX7

Page 11: Intro to Hardware Firmware Hacking

•Anybody can do this search and find this information

• Source: https://www.shodan.io/search?query=netgear

What about security?

Page 12: Intro to Hardware Firmware Hacking

• Prologue

• Middle-logue?

• Epilogue

Show me that MIPS again

Page 13: Intro to Hardware Firmware Hacking

•Why do we care?

•Are there other buffer overflows?

• Source: https://en.wikipedia.org/wiki/Call_stack

What’s a stack buffer overflow?

13

Page 14: Intro to Hardware Firmware Hacking

• Why start here?

• How many challenges are there?

Stack buffer overflows in DVRF

Intro •stack_bof_01 •heap_overflow_01 •uaf_01

ShellCode_Required •stack_bof_02 •socket_bof •socket_cmd

14

Page 15: Intro to Hardware Firmware Hacking

• Let’s run it!

stack_bof_01

15

Page 16: Intro to Hardware Firmware Hacking

• Hulk smash!

stack_bof_01

Page 17: Intro to Hardware Firmware Hacking

• Static analysis with floss (the new strings!)

Smashed the stack, now what

Page 18: Intro to Hardware Firmware Hacking

• Lots of ways to do this

• IDA

• Online Disassembler >>

Graph me like one of your French binaries

www.onlinedisassembler.com/odaweb/OXabeNP7

Page 19: Intro to Hardware Firmware Hacking

• Functions

• main

• dat_shell

• other things we don’t care about

What’s on the menu?

Page 20: Intro to Hardware Firmware Hacking

• Debugger like GDB

• Plain GDB is not pretty

• pwndbg makes it nice >>

• Use gdb-multiarch

• This really is helpful >>

Dynamic analysis

Page 21: Intro to Hardware Firmware Hacking

• You just need the right amount of “As”

• Provide the memory address of dat_shell

Python to the rescue

21

Page 22: Intro to Hardware Firmware Hacking

[email protected]

• https://vivirytech.blogspot.com

• Twitter: @vivirytech

Thanks!

22