Turkey Li
    • 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

      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
    • 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 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

    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
    # HITCON FreeTalk 2018 暢談 CPU 處理器的歷史包袱 共同筆記 ###### tags: `HITCON` 主辦單位:社團法人台灣駭客協會(HITCON) 時間: 2018/01/19(五) 13:20 - 17:00 報名網址: https://hitcon.kktix.cc/events/hitconfreetalk20180119 直播網址: https://www.facebook.com/HITCON/ 議程表: 12:50 - 13:20 報到 13:20 - 13:30 開場 13:30 - 14:00 Spectre & Meltdown 漏洞原理說明與 POC 剖析(講師:Bletchley) 14:00 - 14:30 從晶片設計角度看硬體安全(講師:中原大學 黃世旭教授) 14:30 - 15:00 下午茶交流 15:00 - 15:30 Spectre & Meltdown 漏洞的修補策略與 risk mitigation(講師:gasgas) 15:30 - 16:00 詭譎多變威脅下的資安應變與治理(講師:林宏嘉協理) 16:00 - 17:00 Panel Discussion 歡迎大家針對這次的議題作共筆! ## Spectre & Meltdown 漏洞原理說明與 POC 剖析 (講師: Bletchley) ### Overview of Meltdown and Spectre * Threat: adversary who can execute low privilege code can read unpermitted memory region * Impact: * Meltdown: Most Intel Processors * Spectre: Intel, AMD, ARM processors * Reason: * INconsistent between processor architecture and microarchitecture(cache) * Lack of permission checking when CPU optimization * Website: meltdownattack.com ### CVEs * CVE-2017-5753 * CVE-2017-5715 * CVE-2017-5754 ### Inside the CPU (CPU architecture) * Frontend * Execution Engine * Reorder Buffer * CPU 偷跑後面順序可以先執行的指令 * 若發現偷跑的指令不合法則把指令結果丟棄 * 可是已經把 value 寫到 cache 當中了 * Execution Unit ### Meltdown Proof-of-Concept * Website: https://github.com/IAIK/meltdown > 請問有Spectre的 POC 連結嗎,剛剛投影片太快沒看到 ### Spectre POC https://github.com/crozone/SpectrePoC ### main differences between Meltdown and Spectre * https://www.facebook.com/ENISAEUAGENCY/photos/pb.260742884030702.-2207520000.1516342064./1316708825100764 > 投影片好模糊,看得好吃力 > ==投影片來樓~p== > ==https://drive.google.com/file/d/1E2VXtXTTD4_-IR6sbRvP9MiADKo41zvu/view?usp=sharing== array = [ secret * cache_line_size] read all array and count how many element loaded to cache = secret value 看不出來這兩個漏洞的差異啊,好像都是同一個方法 > [name=CK] 雖然漏洞被區分為兩種,他們概念都以out-of-order execution為核心。可以把Spectre看成Meltdown的擴充,比較大的差異是Spectre加入branch prediction做攻擊。 > > [name=Ethen] 之前我看到Meltdown的特點不只是讀取數據,還可以打破隔離(寫入),沒介紹到... > 如果按照上面的比較表兩邊都是僅讀取,只是讀取範圍不一樣(kernel space v.s. user space any process),那為什麼Meltdown可以直接傷到虛擬化環境?ring -1不是單純讀取kernel就可以跳進去的啊 > [name=Austin]Guset攻擊Host的部份是屬於Spectre-Variant2的範疇,它其實是利用從Guest program去推敲kvm.ko, vmlinux的記憶體位置,在將資料流至user space。雖然Guset跟Host看起來是分離的,其實有很多共用的特性,可以這樣去推敲記憶體位置 > [name=Austin]我的理解沒錯的話,Spectre跟Meltdown的差異在於後者使用了Out of order execution,兩者都有使用speculative execution(branch prediction),另外講者沒有提到的是到底如何取得secret的資料,根據POC code給的 char *secret = "The Magic Words are Squeamish Ossifrage."; malicious_x = (size_t)( secret - (char*) array1 ); 當我們推敲出array = [ array1[x] * cache_line_size] 裡面array1[x]的值後,其實就可以推導secret的內容: array1[x] = addrress of array1 + offset x =  addrress of array1 + address of secret - address of array1 = address of secret = ‘T‘ > [name=Ethen] 站在攻擊者的立場,Meltdown對我來說會是一個不錯的攻擊輔助資訊,我可以拿到核心記憶體中的帳號密碼或知道有開啟什麼服務輔助我攻擊,但這僅限於當下的作業系統,如果能夠寫入或直接提權那會好用的多 > 單純推敲kvm.ko能做的事情有限,如果hypervisor沒有放出可攻擊的服務或權限,我會很難往上打,頂多去讀其他虛擬機器試圖利用其他虛擬機上的服務弱點去一台一台打,這樣就沒那麼好用了 ## 從晶片設計角度看硬體安全(講師:中原大學 黃世旭教授) 硬體上實踐安全的難處 don't care condition可能造成的問題 共筆斷了?????? ## Spectre & Meltdown 漏洞的修補策略與 risk mitigation(講師:gasgas) gasgas: 謝謝大家指教. @@ * 線上找的到 checker script 執行後沒問題不代表你的 CPU 沒問題,只證明你的 CPU 能通過那支 checker 的檢查;但是只要檢查出問題就一定有問題 * Mac 也可以使用 Unix 檢查程式 * 瀏覽器有可能是接下來最有風險的 * CPU Level Microcode 修補 * 程式千萬別看錯執行錯,變磚機率爆高! * 目前還不是 CPU Microcode 修補的好時機,可能都只是暫時修補,後續的修補應該會比較全面也比較安全。 * BIOS Level * 修補會是個比較好的選擇 (其中也包含 CPU Microcode),變磚機率低一點點。 > [name=Wisely] BIOS Update 目前只能修補其中一個 Spectre 的弱點 * OS Level 修補 * Amazon (AWS)(VMware) 已修補 * Application Level 修補 * Windows - lfence * 未重新 comliler 的程式還是有機會有風險 * 千萬不要從非官方下載任何修補程式 * Skyfall and Solace * 根據這次漏洞的靈感所找到的新漏洞 騰訊的線上測試 https://xlab.tencent.com/special/spectre/spectre_check.html > [name=Ethen] 不對啊,目前的弱點需要讀取變數/建立陣列/評估cache速度,這些在JS / Java翻譯成實際執行在CPU上的native code不太可能還包在同一個分支中,他是怎麼有辦法說這樣是可以攻擊的?有成功案例嗎? > [name=Austin]如果JS注入的code(browser->OS->CPU)是在同一個process或可控制的process就可以互相做存取,簡單的範例影片在這:https://www.youtube.com/watch?v=RbHbFkh6eeE > [name=Ethen] 這個影片看起來是在本機端執行原生程式,來撈取另一個程式的記憶體內容,好像不是JS / Java? > 即便都在同一顆CPU上,但直譯語言被翻過去到CPU上應該會有多不少東西,如Java有GC的動作,也沒有指標可直接讀取,這些東西混進去會導致執行不是連貫的或不是同一個分支,影響分析結果 > [name=gasgas] 是..這樣的測試會有很多干擾, 也會大大地影響到結果. 所以只能參考用. 這個javascript POC 目前爭議還很大..XDDD > [name=bletchley] 再利用JS的時候,會需要很多try and error,要去拼JS經過JIT轉成Native Code時,還保有可以攻擊的pattern,對防禦者來說,很多時候也是把jit插一些雜訊,讓攻擊者沒辦法組出可攻擊的Native Code ## 詭譎多變威脅下的資安應變與治理(講師:林宏嘉協理) 1.請問能提供簡報嗎? ## Panel 問題(歡迎大家先來填寫) 1. 面對 zero day attack,如何偵查與預防 用萬佛朝宗 gasgas覆議: 不是觀落陰? 2. arm64 為何也會有同樣的問題~目前的解法是什麼?? 3. 今年剛舉辦的 CES 2018 上所展示的最新型筆電,同樣也使用 Intel 第八代 CPU,是否有受此次漏洞影響?畢竟很多人會猶豫是否要再等待下一代的 CPU 再購買,謝謝。 gasgas回答: 8th Gen Intel CPU 一樣有這三個漏洞, 一樣需要修補, 請參考https://hothardware.com/news/intel-8th-gen-core-cpus-10-slowdown-javascript-spectre-meltdown-patches 4. 依據 ITHOME 的訊息(https://www.ithome.com.tw/news/120312), 目前透過OS更新的方式為針對 meltdown 的弱點修補,請問關於 Spectre 漏洞是否有 OS 或是 firmware 的修補連結嗎? gasgas回答: 目前的OS修補, 已同時修補這兩個漏洞, 可以到各作業系統官網查看 例如微軟網站: https://support.microsoft.com/zh-tw/help/4072698/windows-server-guidance-to-protect-against-the-speculative-execution 5. 問題一:目前全世界尚無發生災情,如果BIOS更新會拖慢電腦效能,那公司內部先發佈KB4056892更新檔的有效阻擋程度。 問題二:台灣國內有哪些資安網站可即時發佈及提供解決方案。 6. 如何能更有效率的檢查並修補該漏洞 7. 如何進行CPU攻擊 8. 對於晶片出包的問題,未來是否有更好的因應方式?如果來不及修補該如何自保? 9. 想請問針對Meltdown & Spectre 漏洞,對於一般做為系統、網站伺服器之主機有何影響,如果不更新作業系統只單靠防火牆進行過濾控管(EX:限定某幾個ip可以連線)可以避免被駭客入侵嗎? 10. 為什麼對一般使用者電腦影響較低,對雲端業者卻衝擊很大? 作業系統修補,成效如何?會對微軟的效能有重大影響嗎? 雲端的衝擊有何應對之道? 11. 這次Meltdown和Spectre更新檔有其必要更新嗎?看一些報導上說更新後的問題還比較多。 12. 除了CPU外,其它的GPU或TPU等,是否應該也會如此呢?該如何因應處理? gasgas回答: 目前沒有聽說GPU,TPU有這個問題, 然後https://nvidia.custhelp.com/app/answers/detail/a_id/4611 上面的修補, 也是只針對自家驅動程式不要被拿來做CPU漏洞. 13. 針對微軟官方說明網頁:https://support.microsoft.com/en-us/help/4072698/windows-server-guidance-to-protect-against-the-speculative-execution 請問其中的 To enable the fix 部分所提到的機碼是否為安裝了微軟的 Patch,且新增這三個機碼就可修補 CVE-2017-5715、CVE-2017-5753和CVE-2017-5754 三個漏洞嗎?還是除了進行以上步驟後,仍需更新Server硬體製造商給的 BIOS 才能阻擋攻擊呢?(微軟官方建議還是要更新硬體BIOS才能完整修補漏洞,但如果只上OS Patch 就能有效防禦的話,是否就可以不用急著更新BIOS了) gasgas回答: 微軟這三個修補無法擋掉所有用這原理的攻擊. 不過目前網路已經流傳的POC 已經完全阻擋. 至於要不要進行CPU Level/BIOS Level的修補, 跟機器的重要性,機器所在的網路區域, 駭客進入點的容易與否(malware進來等)有關. 需要更多因素的考量. 14. 如果在虛擬主機上,Host端打上了Patch,但是Guest端沒有打上,這樣在Guest端能引發攻擊,攻擊HOST嗎? Bletchley: 根據VM的廠商可能會有所差異,建議先了解官方patch的說明。以VMware的網站 https://www.vmware.com/us/security/advisories/VMSA-2018-0004.html 仍須對guest OS處理。除了對底層的CPU修補可以根絕問題,其他Application上的修補很難完全解決問題,可能會被繞過。 15. Variant2 Branch target injection, hacker是如何對Branch history buffer進行訓練以及達到修改目的地位置,使得它會進行推測執行然後執行到hacker的gadget? 跟ROP(Return oriented programming)的攻擊方式是一樣的嗎? 16. 對於因CPU漏洞修補而造成其他系統運作的問題時,在整個產業生態系統方面是否有更好的解決方式,以避免MIS人員害怕系統出問題而不願意修補漏洞? 17. 如何評估修補前與修補後的效能差異?網路上有人說差異不大,也有人說差異滿多的,是否有較客觀的評估方法? -> https://newsroom.intel.com/news/firmware-updates-and-initial-performance-data-for-data-center-systems/ 18. CPU層級的弱點需要靠明確的指令碼來利用,我的理解是只有在Native code已經可以執行的情況下可以藉此竊取資料或提權,不過可以看到各大瀏覽器在第一時間就做了修補。想請問是否代表這個弱點可以在不使用native code的情況下利用? gasgas回答: 由於browser解譯javascript/java/flash時, 會丟給browser, 然後browser丟給OS, OS丟給CPU. 所以把POC用javascript實作, 就可以因為bug讀到不該讀的東西. 可以參考騰訊的檢查code: http://xlab.tencent.com/special/spectre/js/check.js js 補充: 研究人員在 "spectre attacks" 論文就示範了針對 V8 (JavaScript Engine) 的 attack PoC,該攻擊可以讓攻擊者偷出同一個 process memory space 當中原本 JavaScript code 不應該能存取到的資訊。不過現在瀏覽器像是 Chrome 都有 sandbox 隔離機制,要打穿這一層到其他的 browser process、甚至到 OS 層會比較困難。但是這已經打破了原本 JavaScript runtime 的 security boundary 了。 瀏覽器廠商之所以這麼在意,是因為 JavaScript runtime 的天性:無時無刻他都在跑 untrusted code... 「任何一個看似不起眼的威脅,都有可能成為壓倒駱駝的最後一根稻草。」 防患未然。 > [name=Ethen] 感謝,我來研究看看XD 19. 如主機受到此類 攻擊,主機上是否會留存紀錄? gasgas回答: 不會.. :( 所以駭客很高興!!!!! 20. 我的認知是V1緩解是加入serializing instruction(CPUID/MSR), V2 則是避免Indirect branch所以用Retpoline包裝, V3用KPTI將Page table分開, 這三種緩解方法,KPTI是meltdown的根解嗎? Retpoline/Serializing instruction 只能算緩解嗎? gasgas回答: KPTI的確是根本解決了meltdown的問題. V1,V2 其實應該是換個沒BUG的CPU才是正解(XDDDDDDDD) 21. 若以效能為主要考量,不修補此漏洞,會容易遭受到那種類型的攻擊?只有資料漏洩漏外,會有權限或是資料被竄改的可能嗎? js 答: 具體受影響程度難以一概而論,會取決於實際情境、假想敵的能力。只要 attacker 能找到一條 path 達成某些形式的 code execution (低權限、被封在 sandbox 裡面也沒關係)... 就有機會讀到原本不應該讀到 (sandbox 外) 的資料。Information leakage 能造成怎樣的影響?攻擊者偷到的資料可能不重要 (we're lucky),也有可能是很重要的 encryption key、RNG seed... 使得 attacker 能夠 hijack 當前的 authenticated/encrypted channel 做到原本不能做的事情,包含竄改系統狀態。 22. Meltdown的特性是針對Out of order,應該所有的處理器都有使用,AMD沒中的原因是因為實做方式不同嗎? Bletchley: 參考以下網站,https://www.amd.com/en/corporate/speculative-execution ,有提到因為privilege level protections within paging architecture不同而不受影響,但目前沒看到詳細的分析。 23. 請問提供加解密功能硬體安全晶片 (TPM, SE...) 是否有類似的問題? js 答: 提供密碼功能的安全硬體晶片是現代資訊安全最重要的 roots of trust 之一。幾個月前被公布的,某知名硬體廠為了優化、提升運算速度,而導致密碼晶片嚴重安全漏洞的 ROCA => CVE-2017-15361,受影響產品數以百萬計 (security tokens, smart cards, electronic ID cards, TPMs, security chips embedded into many products)。五年前台灣自然人憑證、十年前悠遊卡... 許多產品都會需要用到密碼晶片,都曾經有嚴重安全問題。 BTW: 現在愈來愈多安全管理的 features 都被 delegate、整合到硬體系統,例:可信任執行平台 (TEE: Intel SGX, ARM TrustZone...) 系統愈來愈複雜,安全問題愈來愈難檢視。 24. Microsoft 是何時得知並開始準備 Patches 的? 四個小時 現在談到的大部分修補方式,大多針對PC、nb、mobile等裝置,那對其他設備,如ioT、穿戴裝置等,是否也有建議的改善方向? 26. 若已確定防毒相容微軟更新,可以直接手動下載微軟更新安裝嗎?是否還需要有機碼? 27. 行政院國家資通安全會報技術服務中心有提供一個政府組態基準(GCB)是對微軟作業系統的安全設定,對一般企業有用嗎? GCB的效益如何? 28. 微軟在這次漏洞update的KB說,此次更新安裝後某些防毒軟體會造成BSOD,請問到底修正了甚麼會造成這種影響?

    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