hiding depth
play

Hiding @ Depth: Exploring & Subverting NAND Flash memory Josh - PowerPoint PPT Presentation

Hiding @ Depth: Exploring & Subverting NAND Flash memory Josh m0nk Thomas (A DARPA CFT Project by MonkWorks, LLC) RIP 4.1.13 - Long Live CFT Thx Mudge Saturday, June 22, 13 My Path, And You Can Too! Saturday, June 22, 13 My Path,


  1. Hiding @ Depth: Exploring & Subverting NAND Flash memory Josh ‘m0nk’ Thomas (A DARPA CFT Project by MonkWorks, LLC) RIP 4.1.13 - Long Live CFT Thx Mudge Saturday, June 22, 13

  2. My Path, And You Can Too! Saturday, June 22, 13

  3. My Path, And You Can Too! • Kernel Modules: Side Loading Fun! • Sure, I’ll be a “test” case Saturday, June 22, 13

  4. My Path, And You Can Too! • Almost everything I do is simply calling the API in the wrong order • The 1 exception is the OOB write • Path to Winning? • Pick a block and wipe it • Cover the entire block in 0xDEADBEEF • Mark the Block as “Bad” • 0x00 out the OOB in the case of Sony • Watch the reboot from collision! Saturday, June 22, 13

  5. nandx_hide.c Saturday, June 22, 13

  6. nandx_hide.c Saturday, June 22, 13

  7. nandx_hide.c Saturday, June 22, 13

  8. BadUSB ¡— ¡On ¡accessories ¡that ¡turn ¡evil ¡ Karsten ¡Nohl ¡<nohl@srlabs.de> ¡ ¡ Sascha ¡Krißler ¡<sascha@srlabs.de> ¡ Jakob ¡Lell ¡<jakob@srlabs.de> ¡ SRLabs ¡Template ¡v12 ¡

  9. USB ¡devices ¡include ¡a ¡micro-­‑controller, ¡hidden ¡from ¡the ¡user ¡ USB ¡controller ¡ Flash ¡ 8051 ¡CPU ¡ Controller ¡ Mass ¡storage ¡ firmware ¡ Bootloader ¡ The ¡only ¡part ¡ ¡ visible ¡to ¡the ¡user ¡ 4 ¡

  10. USB ¡devices ¡are ¡iden[fied ¡ ¡ USB ¡devices ¡ Connectors ¡+ ¡hubs ¡ Host ¡ Root ¡ hub ¡ Examples ¡ Iden&fier ¡ USB ¡thumb ¡drive ¡ Webcam ¡ Interface ¡class ¡ 8 ¡– ¡Mass ¡Storage ¡ a. 1 ¡ ¡ ¡– ¡Audio ¡ b. 14 ¡– ¡Video ¡ End ¡points ¡ 0 ¡– ¡Control ¡ 0 ¡– ¡Control ¡ 1 ¡– ¡Data ¡transfers ¡ 1 ¡– ¡Video ¡transfers ¡ 6 ¡– ¡Audio ¡transfers ¡ 7 ¡– ¡Video ¡interrupts ¡ Serial ¡number ¡ AA627090820000000702 ¡ 0258A350 ¡ 5 ¡

  11. USB ¡devices ¡are ¡ini[alized ¡in ¡several ¡steps ¡ USB ¡device ¡ Devices ¡can ¡have ¡ USB ¡plug-­‑and-­‑play ¡ several ¡iden&&es ¡ § A ¡device ¡indicates ¡ its ¡capabili[es ¡ Register ¡ through ¡a ¡ Set ¡address ¡ descriptor ¡ ¡ Power-­‑on ¡+ ¡ Firmware ¡init ¡ § A ¡device ¡can ¡have ¡ Send ¡descriptor ¡ several ¡ Load ¡driver ¡ Set ¡configura[on ¡ descriptors ¡if ¡it ¡ supports ¡mul[ple ¡ Normal ¡opera[on ¡ device ¡classes; ¡like ¡ webcam ¡+ ¡ Op[onal: ¡deregister ¡ microphone ¡ Register ¡again ¡… ¡ § Device ¡can ¡ Load ¡another ¡ deregister ¡and ¡ driver ¡ register ¡again ¡as ¡a ¡ different ¡device ¡ 6 ¡

  12. Agenda ¡ § USB ¡background ¡ § Reprogramming ¡peripherals ¡ § USB ¡aLack ¡scenarios ¡ § Defenses ¡and ¡next ¡steps ¡ 7 ¡

  13. Reversing ¡and ¡patching ¡USB ¡firmware ¡took ¡less ¡than ¡2 ¡months ¡ ¡ A ¡ B ¡ C ¡ Document ¡firmware ¡ ¡ Reverse-­‑engineer ¡firmware ¡ Patch ¡firmware ¡ update ¡process ¡ 1. Find ¡leaked ¡firmware ¡and ¡ 1. Load ¡into ¡disassembler ¡ 1. Add ¡hooks ¡to ¡firmware ¡to ¡ flash ¡tool ¡on ¡the ¡net ¡ (complica[on: ¡MMU-­‑like ¡ add/change ¡func[onality ¡ memory ¡banking) ¡ 2. Sniff ¡update ¡ 2. Custom ¡linker ¡script ¡compiles ¡ communica[on ¡using ¡ 2. Apply ¡heuris[cs ¡ C ¡and ¡assembly ¡code ¡and ¡ Wireshark ¡ injects ¡it ¡into ¡unused ¡areas ¡of ¡ – Count ¡matches ¡between ¡ original ¡firmware ¡ 3. Replay ¡custom ¡SCSI ¡ func[on ¡start ¡and ¡call ¡ commands ¡used ¡for ¡ instruc[ons ¡for ¡different ¡ Other ¡possible ¡targets ¡ updates ¡ memory ¡loca[ons ¡ We ¡focused ¡on ¡USB ¡s[cks, ¡ 4. (Reset ¡bricked ¡devices ¡ – Find ¡known ¡USB ¡bit ¡ but ¡the ¡same ¡approach ¡ through ¡short-­‑circui[ng ¡ fields ¡such ¡as ¡descriptors ¡ should ¡work ¡for: ¡ Flash ¡pins) ¡ 3. Apply ¡standard ¡solware ¡ § External ¡HDDs ¡ reversing ¡to ¡find ¡hooking ¡ points ¡ § Webcams, ¡keyboards ¡ § Probably ¡many ¡more ¡… ¡ 8 ¡

  14. Agenda ¡ § USB ¡background ¡ § Reprogramming ¡peripherals ¡ § USB ¡aLack ¡scenarios ¡ § Defenses ¡and ¡next ¡steps ¡ 9 ¡

  15. Keyboard ¡emula[on ¡is ¡enough ¡for ¡infec[on ¡and ¡privilege ¡escala[on ¡ ¡ (w/o ¡need ¡for ¡solware ¡vulnerability) ¡ Challenge ¡– ¡ Linux ¡malware ¡runs ¡with ¡limited ¡user ¡privileges, ¡but ¡needs ¡ ¡ root ¡privileges ¡to ¡infect ¡further ¡s[cks ¡ Approach ¡– ¡ Steal ¡ sudo ¡password ¡in ¡screensaver ¡ Restart ¡screensaver ¡ § User ¡enters ¡password ¡to ¡ (or ¡ policykit ) ¡with ¡ unlock ¡screen ¡ password ¡stealer ¡ § Malware ¡intercepts ¡ added ¡via ¡an ¡ password ¡and ¡gains ¡root ¡ LD_PRELOAD ¡library ¡ ¡ privileges ¡using ¡ sudo ¡ Privilege ¡escala[on ¡ module ¡will ¡be ¡ submiLed ¡to ¡Metasploit ¡ 11 ¡

  16. Network ¡traffic ¡can ¡be ¡diverted ¡by ¡“DHCP ¡on ¡USB” ¡ DNS ¡assignment ¡ in ¡ All ¡DNS ¡ DHCP ¡over ¡spoofed ¡ queries ¡go ¡to ¡ USB-­‑Ethernet ¡ aLacker’s ¡DNS ¡ adapter ¡ server ¡ ALack ¡steps ¡ Result ¡ 1. USB ¡s[ck ¡spoofs ¡ 3. Internet ¡traffic ¡is ¡s[ll ¡routed ¡ Ethernet ¡adapter ¡ through ¡the ¡normal ¡Wi-­‑Fi ¡ connec[on ¡ 2. Replies ¡to ¡DHCP ¡query ¡ with ¡DNS ¡server ¡on ¡the ¡ 4. However, ¡DNS ¡queries ¡are ¡sent ¡to ¡ Internet, ¡but ¡without ¡ the ¡USB-­‑supplied ¡server, ¡enabling ¡ default ¡gateway ¡ redirec[on ¡aLacks ¡ 13 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend