林裕翔
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # Black Hat 2021 >[name= 感謝Orage大大給的學生票] ## 1. 5G IMSI Catchers Mirage [2] ### Introduction >[name=原以為會是一個很潮的演講,但如標題 Mirage...] > (跳過前面的發展願景跟科普知識)首先,UE 為了拿到網路服務,需要跟 Core Network 表明自己的身份(IMSI/SUPI)並完成驗證。如下圖,但升級服務並不會更換 SIM 卡,所以安全性還是和 4G 差不多,有一篇[論文](https://www.ndss-symposium.org/wp-content/uploads/ndss2021_6B-4_24365_paper.pdf)提出了可行的解決方式。 ![](https://i.imgur.com/elHY1k7.png) 升級到 5G 後,原先的 IMSI 將改為 SUPI 並加密為 SUCI,再將 SUCI 發送給 Core Network,捨棄了原先 UE 與 CN 第一次溝通時,會將 IMSI 直接以明文形式發送,5G 將不會以明文的形式傳送 SUPI,具體的加密方式如下: ![](https://i.imgur.com/qZkmXkG.png) ### UE Registration 接著看看 UE 和 CN 註冊的過程(23.501): ![](https://i.imgur.com/h5TIK6d.jpg) 1. UE 第一次註冊時,用存在 SIM 卡裡的 Public Key 將 SUPI 加密為 SUCI,並發送 Request 2. AMF 把 SUCI 丟給AUSF和UDM(DB)做驗證,在這邊解密出 SUPI 後回傳給AMF 3. AMF 根據 SUPI 生成一個 5G-GUTI,然後回傳給 UE 並註冊完成 4. 下一次註冊時 UE 就會使用 5G-GUTI 發 Request 給 AMF,AMF 會根據 5G-GUTI 找到對應的 SUPI,然後完成驗證; 若 AMF 找不到對應的 SUPI,就會發 Request 給 UE 請求SUCI,然後重複步驟1~3 ### Result 並且 5G 在 Paging 時用到的 5G-S-TMSI 和 5G-GUTI,都將會強制更新,不像LTE時期會用同一個 GUTI 來發 Paging 大約三天。 ![](https://i.imgur.com/6Yq3GlN.png) 一切看起來都很安全,但在一個前提下這些防護功能都會瞬間消失,就是我們無法自己選擇是否要自動降為 LTE ,因為手機都沒有提供這個功能,這大概也是講者主要想表達的危機,攻擊者可以利用降維攻擊使 UE 強迫回到 LTE ,如此就又可以拿到 IMSI 了。 ## 2. Over The Air BasebandExploit: Gaining RemoteCode Execution on 5G Smartphones [1] ### Introduction 他們把手機用來處理有關天線射頻服務的元件 BaseBand 的 Firmware 提取出來並對他逆向,發現某些手機在這方面的防護非常薄弱,利用其中沒有做 Stack Cookie 導致可以 Overflow the buffer 的缺失,控制存儲在 Stack 中的 Retuen Address,並獲得 Code Execution ,更改手機的裝置編號( IMEI )。且 Buffer 大小是由 OTA message 告知,所以大小也取決於 Server (攻擊者?)。 IMS 就是通話或簡訊時會用到的服務,BaseBand 就是該服務的客戶端,於是想達到這個攻擊就需要自己建構一個 SDR 並用自己燒錄的 SIM 卡與其完成驗證後,在這個 SDR 上建立 IMS Server 並發一個會讓手機 Stack Overflow 的 XML payload。 所以他不像一般我們做的攻擊,他需要過驗證後才能觸發這個漏洞,但一般的惡意基地台是無法與商用手機完成驗證的,因為我們沒有解密的 Key。 ### SIP Message 建立 SDR 的話是以 Open5GS + srseNB 完成,手機是 Vivo 的,IMS Server 會以發送 SIP Message 來和 moedm 進行溝通,以下是一個 Example : ![](https://i.imgur.com/lbOs6Eq.jpg) 可以得知 SIP 是一個 text-based,類似HTTP,會有標頭和內文,然後客戶端的 BaseBand 會解析這些訊息,而這個 SIP 的內文就可以是 XML 的格式。 ### Vulnerability 於是要發一個會讓你 Stack Overflow 的 payload: ![](https://i.imgur.com/B7hS92k.jpg) 塞一堆A之後再將要執行的 Shell code 放在他的後面,流程如下: ![](https://i.imgur.com/o2xw7Av.jpg) Payload 以 100 個字節“A”開頭,然後是 stack 中保存的暫存器 R4-R11。 然後真正的 ROP-Chain 從 stack 中復制 shellcode 並最終跳轉到 Shellcode。 ### Result 這個很酷,雖說不能算是攻擊,因為需要和受害者過驗證才能觸發,是一個揭露 BaseBand 安全性相當薄弱的研究,每支手機的防護性也會不盡相同,可能其他手機又有其他的 BUG,讓我好奇手機中有沒有其他像 BaseBand 這樣值得研究的元件。 ## References [1] M. Grassi and X. Chen, “Over the air baseband exploit: Gainingremote code execution on 5G smartphones,” inProc. 2021 BlackHat USA, Aug. 2021. [2] R. Borgaonkar, “5G IMSI catchers mirage,” inProc. 2021 BlackHat USA, Aug. 2021.

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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