SITCON
      • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Help
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
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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- GA: UA-34467841-15 --- CDN 網站攻擊 - 這次換駭客當鬼來抓你了 - Mico === <blockquote> 此議程探討不同於傳統網頁功能缺陷攻擊的駭客手法。 近年來因網站 CDN/WAF 技術以及網路負載平衡、反向代理等前後端點類型的伺服器架構盛行,被世人遺忘的攻擊手法再次被提起。 網站管理員用了這些節點技術,卻可能因為多了這些端點,反而多了更多新的駭客攻擊方法? 新手乍到 CDN 就像在玩鬼抓人,駭客就像鬼一樣,用了一些手法,找到你,接著攻擊你,你.. 真的躲好了嗎? 一起來看看這些奇妙的攻擊手法吧 ## 先備知識 會從基礎講,有網路(http)基本概念及略懂資安攻擊名詞佳 </blockquote> ###### tags: `SITCON 2020 共筆` `SITCON 2020` `2020` `共筆` `R0` {%hackmd dTfmj-h3QvSA0myqavKbxg %} > 請從這裡開始 <!--要結束了 有人要認親嗎(誤--> <!--DSC認親(?--> <!-- 嗨 --> <!--傳server 邀請(?--> ## outline Speaker: Mico ## 1. Architecture 一蘭拉麵 - 本來:要飛到日本才能吃的到 - 開分店在世界各地,顧客就可以用最低的時間成本和物理距離吃到,CDN同理 ### 伺服器服務模式 單一節點網站服務模式(常見) - 通常為單一伺服器 - 離線快取不友善 - 端點防禦成本高 - 靜態流量浪費 節點式網站服務模式 - 各地的近端伺服器 - 離線快取機制 - 端點防禦成本較低 - 靜態快取重用 content deliver network CDN Domain Resolve 使用者不會知道網站的真實 ip 一般直連 > #像極了愛情 透過CDN快取 可以更快取得資料 ## 2. threats and mitigations ### Disclosure of Origin IPs bypass cdn and waf dos, attack directly to host how to 域名的 a 紀錄 dig query name server multi ping 異地 domain 的解析IP不同 網址/cdn-cgi/trace 是否使用CDN cdn-cgi trace 製造parse error % %後面一般接上兩個十六進位的字元 單一一個%造成 request for comments(RFC) IETF RFC 規範了一個標準 不遵循 RFC 開發的例子,粽子沒有規定烹飪方式 >中部粽(? >南部粽 >(3D油飯? <!-- 慶記XD --> 子/域名探測 wordlist scanner - [knockpy on github](https://github.com/santiko/KnockPy) passive dns 過往的 dns 紀錄 virustotal x509v3 subject altermative name <!-- 通配 --> - crt.sh 查詢憑證申請紀錄中有無目標 domain - associated domain [buildwith](https://builtwith.com/) - [cloudflair](https://github.com/christophetd/CloudFlair) 查找所有很像的憑證網站 :arrow_right: 可能是真實域名 - domain fronting 透過修改 Host header 讓 cdn 將封包導向與連線 domain 不同的主機 - 直接打 ip 訪問(不帶 host header infected pc tructed website attackers web server c c server - osint - whois 資料庫 作者名稱、社交網頁等 GET一些可能有用內容 - theharvester build by python - content search - shodan - yandex 不會出現同個網域的結果藉以找到旁站 - integration tools - sublist3r on github - dnsdumpster ## 功能探測 利用公開網站提供的預覽功能(該網站的IP連接) 其他思路 xss -> 打客服 上傳 webshell crimeflare 濫用早期 cloudflare 的檢舉功能 撈 phpinfo.php or web config cf-connnecting-ip CDN Domain resolve 永遠是 CDN IP 要怎麼知道真實 IP Cloudflare Header: CF-Connecting-IP ## 防禦措施 - 白名單允許 CDN 的 IP - cloudflare - https://www.cloudflare.com/ips-v4 - https://www.cloudflare.com/ips-v6 - 旁站ip區段間隔不宜過小 - 使用新的ip墜綁定,避免DNS留下過往紀錄 web cache deception and poisoning cached and confused web cache deception in the wild caching 101 cache key 靜態資源副本 cache control headers 1. Vary 2. Cache-Control - public 總之會快取 - private 中間伺服器不快取 - no-cache 僅在有變動時快取 - no-store 完全不快取 max-age 存留秒數(較被受用) expires 過期時間 cach extension 預設快取項目 html php aspx js css <!--還有一個 --> custom route web cache deception attack in paypal settings page 1. 不存在的 css 資源網址(malicious.css)被受害者打開 - 但 'malicious.css' 被 paypal 當作參數解析,因此不會 404 2. 得到頁面(被快取) 3. 攻擊者打開同個路徑,得到快取的內容 web chache poisoning web cache poisoning - DOM first cache time 1. unity3d.com X-Host 參數可以指定 js 來源 <!--小夫 --> 防禦措施 只快取指定資料夾 ... cache poisoned denial of service (CPDoS) attack method heep header oversize usually maxmium 8192 bytes http meta character 400 不該被快取 Get Post Delete Http Method Override rfc 7231 Method: GET HEAD POST Status Code: 200 203 204 206 300 301 404 405 410 414 501 > 404 也會被快取 #### CDN 平台 流量計價 連線計價 攻擊流量 > 預算 經濟式服務阻斷攻擊 #### CDN 流量放大 網站源地址相同 -> 容易被擋 CDN 來源三角映射 // 太多CDN節點會不提供服務 相同節點網站阻斷服務 ### 防禦措施 - 選擇具有威信 採良性存取行為計價的 CDN 服務 - 異常頁面加入 `Cache-Control: no-store` - 遵循 RFC 開發,可快取狀態碼白名單 - 簽訂 SLA ## http desymc requests smuggling(協議走私attack) > 這個攻擊 http response splitting http desymc attacks lasted release: blackhat usa 2019 8 defcon 27 2019 8 HTTP 1.0+ keep alive & pipeline <!--真的太快了聽不懂---> <!-- +1 QQ --> <!-- +1 QQ --> multiple connections persistent connection(持久連線)->非常省時間 no pipelining pipelining 駭客可以謊報自己的封包長度,用以穿插別人的封包 不會檢查嗎? 攻擊圍繞在這兩個方式 Content-Length (整體傳輸、較舊) Transfer-Encoding RFC2616 一起傳會怎麼樣 會忽略比較舊的那一個 > Transfer-Encoding 0 \r\n End; <!--比電鍵盤好難打QQ 好想拿機械鍵盤出來 但會被打--> <!--我不習慣打mac QQ--> Front-end->Back-end CLTE TECL 傳兩個 Content-Length 會怎樣 RFC2616 沒有意料到有這個操作 ... http desymc smuggling and web cache poisoning paypal bugbounty $38,900 usd http desymc smuggling slack bugbounty paypal bugbounty $6,900 usd ### 防禦措施 選擇會正規劃 header 的 CDN 服務 前後端不使用TCP重用 使用HTTP/2 嚴格遵守 RFC ## 結論 > ***歷史唯一給我們的教訓,就是我們無法從歷史中獲得任何教訓*** > 要精準的評估資訊安全的風險不容易,必須持續關注最新議題才能意識最新的資安攻擊 thank you ## Q&A <!-------講師的FB能傳連結嗎---> <!-- 傳送門 https://www.facebook.com/MicoDer --> <!--認親專區開在這(?------> <!--資訊太多啦,腦袋當機--> <!-- 快清快取 (X) -->

    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