HITCON
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Breaking Samsung's Root of Trust: Exploiting Samsung S10 Secure Boot - Cheng-Yu Chao {%hackmd @HITCON/r1z4zylVv %} > 從這開始 > Knox - Trusted Boot hardware PBL verify secure boot ... Knox bit(warranty bit) one time fuse cant restore blow the .. sensitive data protection the storage(sensitive data) is encrypted when the device is locked encrypted keys are stored in trustzone sensitive data protectin cont some critical information can only be decrypted .. ARM Tructzone Related Work BH17 - Defeating Samsung KNOX with zero privilege by returnsme BH17 EU - How Samsung Secures your wallet by Tencent LAB EL0 -> secure-EL0 BH19 - Breaking Samsung's ARM Trustzone EL0 -> secure-EL3 what if the device is turned off and we don't .. in this talk outside the box locked phone -> non secure one S-Boot Boot Flow set monitor mode init check boot mode verify boot image boot into kernel ODIN mode flash stock firmware Rollback prevention This stage provide a vulnerability that can attack. vulnerability 1 Odin Request opCode 0x64 Odin mode initial and settings 0x65 flask PIT 0x66 Flag image subOp ... Odin flash image command no check for provided size integer overflow user 0xc00000000 if less the 0x1e00000 otherwise use 0xB00000000 copy to buffer S8 and befor at 0xc0000000 S9 and later at 0x880000000 overflow the physical memory buffer for flash image sboot code segment sboot data stack heap ... Bypass MMU S-Boot code segment at 0xC9000000 but read only USB devices have direct memory access ignores mmu control Cathe incoherency while receiving data the CPU keeps tracking the USB event this code is cached only the heap will not be cached code execution the heap is not cached the code accesses a pointer in the heap ... trigger data-abort as soon as we overwrite heap data with NULL overwrite the error handler code with jump sled pt shellcode infront of the code segment overflow the physical memory filled with null shellcode modified sboot code segment but s9 and later are not exploitable the default buffer is changed to 0x880000000 spent half a year trying to exploit s10 potential exploit path on s10 in s9 and later odin has paralled and compressed download mode it will boot up another 2 cpu cores and set the image buffer to 0x880000000 fallback to normal download if boot cpu failure buffer change ... make cpu boot fail `next_available_cpu()` uart mode cmd - smp_test test boot up a cpu core and shurdown immediately but count of booted cores will not decrease cmd download enter odin mode enter uart mode we need a debug cable to make s-boot detect RID_523K tried typec vdm mode accessory mode pull down pull up ... we reported the bug on 2018 8 patch note samaung security update SVE-2019-15230 potential integer overflow in bootloader the patch size = arg1 if (arg1 <= 0xffffffff) vulnerability 2 aligned size? `qword_C91494B0` odin packet data size we can set packet data size with opcode 0x64 subop 0x05 exploit same ... report it patch node ... vulnerability 3 odin pit flash command opcode = 0x65 pit is very small odin store it to heap buffer with the size 0x2000 `pit_buf` pseudo code receive data this is a pseudocde representation of the receive operation in our test ... we thought this was unexploitable so i stuck to vulnerability 1 how about interrupting the usb remove the reinsert the usb cable the usb_recv returns with ... heap overflow we can overwrite the metadata of heap chunk house of spirit fake chunk no check for double linked list limited overwrite data `*prev + 4 != 0` in arrch64 interger 64 bit code at 0xc90000000 we can not pooint to got function pointer overwrite rip in stack the only chance is to overwrite a return address on stack only 3 function calls fortunately odin cmd buf is the first local variable after code execution in sboot boot the phone we smashed the stack and heap hard to recover call the boot functions one by one skip trustzone related calls we only have EL1 privilige .. load custom kernel after loading the kernel to memory ... exploit set the size of packet data to a big number send odin pit flash command send payload after interrupt the usb_recv() leds to heap overflow send anothe odin ... we got el1 in normal world but the phone is still locked cannnot read sensitive data man in the nonsecure el1 wait for the user to unlock the phone hijack sniff everything between nonsecure world and secure world exposed attacking surface attacking secure world trustlet gatekeeper trustlet samsung pay trustlet keystore trustlet .. many vulnerabilities in the past attack the gatekeeper trustlet to decrypt storage SVE-2019-14575 with this vulnerability we can try all the possible pattern codes in a few hours sensitive data unlocked conclusion even if the data is store in secure world it does not mean it is 100% secure but it is made exploiting complex multiple actions are needed to retrieve the data landing rce local usb exploit social engineering privilege excalation to nonsecure el1 vulnerability ... disclosure timeline ... thank you jeffxx@trapasecurity.com ###### tags: `HITCON2020`,`HITCON`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully