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 --- Playing Win32 Like a K!NG ;) - 馬聖豪 === <blockquote> 在 Windows Vista 後作業系統內置了 UAC(User Account Control)防護,本來應被視為其中一項相當重要的惡意程式防護、替我們擋下未知的惡意程式做出的惡意手段。然而現實慘狀卻告訴我們:UAC 服務只是一個惱人要求使用者同意的彈窗設計、而未能擋下數不盡的惡意程式攻擊。 在這場議程中,將簡介微軟在 Windows 上防護體系的馬其諾防線、Win32 Process 裝載特性、逆向工程分析 UAC 實作細節、微軟設計 UAC 時作出的安全考量假設 與 各個大神是怎麼玩爆你的 UAC 防護的。 ## 先備知識 先備知識要有的話要很到很深入的逆向工程、Windows 特性、C & C++ 資料結構觀念 etc。不過這份稿件我希望講架構大觀念與方向上是怎麼被惡意利用,應該不太需要前備知識 </blockquote> ###### tags: `SITCON 2020 共筆` `SITCON 2020` `2020` `共筆` `R2` {%hackmd dTfmj-h3QvSA0myqavKbxg %} > 請從這裡開始 aaaddress1@chroot.org [slido](https://app.sli.do/event/drnbokpn/live/questions) ## Outline 1. UAC Design 2. Exploit Attacks 1. Misc Method 2. CIA Vault7:Ele 3. UAC Bypass by Mocking Trusted Disrect 3. Recap ## UAC > 您是否要允許這個來自未知發行者的App * Windows Vista 之後內置 * UAC 下放服務,病毒就可以有權限 * process tree * svchost.exe * //系統服務 * consent.exe * 負責UI視窗的顯示 * 如果 trust_authA 和 trust_authB 不通過認證,就會開啟 consent.exe 向使用者詢問權限 * 執行流程: ``` Explorer(一般使用者 Ring3) -> runAs -- RPC message --> UAC Service (B.)Send a task by RPC message to UAC service for creating a different privilege child proccess -> trust_authA --> trust_authB -> privileged child process ``` syscall Ring3 * Win 7 之後 Explorer 都只有使用者權限而已 auth_a * TrustAuth_A #trust path verify ``` $p = ToDosName("C:\\a.exe") $p.startwith(\??\C:Windows\System32) $p.startwith(\??\C:Windows\SysWoW64) ``` * deny-list ``` \??\C:\Windows\Debug\ \??\C:\Windows\PCHealth\ \??\C:\Windows\Registration\ \??\C:\Windows\System32\com\ \??\C:\Windows\System32\FxsTmp\ \??\C:\Windows\System32\Microsoft\ \??\C:\Windows\System32\Spool\ ... ``` debug 執行版本的程式 /?auth_b //安裝服務、安裝系統套件 //要有微軟的簽章簽過,或是只要自己標註提升權限就可以提權 * TrustAuth_B // cttunesvr inetmgr migsetup mmc oobe pkgmgr provisionshare provisionstorage ... /?Bypass UAC:用兩種rule A. launched from the system directory B. whitelisted + signed by sigcheck -m <program> - 檢查程式是否想要被提權 /?Attack - Misc: 在野奇技淫巧系列 - CIA: Elevated COM Object /?misc#1 Accessing Access Tokens for UIAccess > 就是直接操作游標去點確定啦 lol [ Accessing Access Tokens for UIAccess ](https://www.tiraniddo.dev/2019/02/accessing-access-tokens-for-uiaccess.html) /?misc#2 - 那我們能讓高權限服務直接呼叫我們嘛 - 磁碟清掃工具 - 駭客程式執行起來,寫進Local\Temp,就提權了 > 磁碟清掃工具會去 load Temp 裡面的 dll lol [Bypassing UAC on Windows 10 using Disk Cleanup](https://enigma0x3.net/2016/07/22/bypassing-uac-on-windows-10-using-disk-cleanup/) /?misc#3 - 解壓縮直接把系統程式檔案蓋掉 ``` wusa hack.cab /extract C:\windows\system32 ``` [WUSA.exe – Extract option is gone in Windows 10](msitpros.com/?p=3100) > 用系統更新工具幫你解 .cab 進系統資料夾 # IFileOperation comobject接口 檔案搬移、刪除、複製... 使用者帳戶控制 KuGou.exe 變更這些通知顯示的時機 複製的時候 菊花圖,放在C:應該也是UAC授權啊,但是視窗長得不一樣 ㄊ 用戶權限低嘗試到高權限的目錄下 /?fileCopy /?alert 上面兩個操作詢問提升權限的方法不同 可以發現 KuGou 是透過 Consent.exe 詢問 而 Explorer 複製檔案時表現的方式代表其實本身可以使用高權限 /?hijack $PATH:{ C:\hijack\VERSION.dll } 系統函式庫VERSION.dll,你可能想要同層目錄的dll不是系統的dll PoC 1. DLL Side-Loading - inject *.dll module 2. IFileOperation - create a new thread to wake up malware 3. DLL Injection - drop a *.dll into %system32% to hijack service > 簡單來說就是利用 dll 注入 explorer 幫你做任意寫入,再讓其他服務 load 你的惡意 dll。 <!-- 乾 AV 夢還是跑進來了 --> 更動Windows註冊 開機選項 你的 D 槽裡面可能會有很多`.avi` /?MasqueradePEB > 偽裝執行程序資訊 - 透過修改自己的 PEB 讓系統誤以為這隻程式是 explorer.exe 來取得使用 IFileOperation 的權限。 /?WikiLeaks Vault 7: CIA Hacking Tools Revealed > patched after Win10 1607 by utilizing dll load path whitelist Moking /?DACL `mkdir "C:\Windows \"` `mkdir "C:\Windows \System32"` > 放在Win32,低權限,VERSION.dll就可以劫持 > Windows 在解析路徑時會去掉尾端的空白,但是只有在透過 UI 修改時會阻擋尾端空白。所以可以透過其他方式創造經過處理後會變成系統路徑的假路徑,來繞過保護機制。 /?attack - TrustAuth_A - Path Normalization - TrustAuth_B - x /?recap

    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