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

    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
    # Final project : Cryptojacking ###### tags: `資安` [Intro](https://www.kaspersky.com/resource-center/definitions/what-is-cryptojacking) --- 簡述:劫持其他人的電腦幫自己挖礦(殭屍礦工) 裝置會消耗CPU 記憶體 硬碟 電力來挖礦,替其他人賺錢 ### in-browser cryptojacking 瀏覽器上的劫持 用 javaScript 在web page 去挖加密貨幣,不需要安裝任何東西 >You load the page, and the in-browser mining code just runs. No need to install, and no need to opt-in. * **Question:** [**怎麼用javaScript 實作挖礦?**](https://blog.gtwang.org/web-development/coinhive-website-crypto-miner-tutorial/) * [**javaScript參考2**](https://hackerbits.com/programming/cryptojacking-javascript/) * [**星巴克WiFi挖礦事件**](https://www.ithome.com.tw/news/119518) (**coinhive** //已關閉服務) Motivation & background 動機跟背景? --- 動機:賺取挖礦的利潤 背景:隨者加密貨幣的盛行, 挖礦事業已經從teams of miners running dedicated mining hadware(硬體的CPU/GPU) ->這種做法會消耗大量電力和硬體資源 可在受害者網頁上進行挖礦(mobile device也可以) cryptojacking開始盛行 而且不管你是不是加密貨幣的用戶,你都會被捲入cryptojacking Attack 攻擊模式 --- :::success **兩種主要攻擊方式** 1. By getting the victim to click on a malicious link in an email that loads cryptomining code on the computer 2. By infecting a website or online ad with JavaScript code that auto-executes once loaded in the victim's browser ::: same way with ransomware does phishing and malware 如果駭客可以讓受害主點擊惡意連結(malicious link/email/infected ad /website) 靠script 在 backgroud 跑 >ex: Monero 門羅幣 [**Attack method 簡述**](https://www.csoonline.com/article/3253572/what-is-cryptojacking-how-to-prevent-detect-and-recover-from-it.html) * Endpoint attacks : 傳統攻擊方式,把惡意軟件script等等在端點運作 * Scan for vulnerable servers and network devices : 把目標延伸到server等網路設備,server 效能比端點用戶更強大(**新**主要攻擊方式) * Software supply chain attacks * Leveraging cloud infrastructure **與其他malware不同之處:do not damage computers or victims' data** Defense 防禦模式 --- ### <font color="1F3484">detect cryptojacking(機器學習偵測)</font> 通常cryptojacking不好檢測,因為他是躲藏在背後運作 檢測有沒有cryptojacking可以從三個角度去看 >1. Decreased performance 效能降低(電力掉的速度變快等等) >2. overheating 過熱( laptop or computer's fan is running faster than usual) >3. Central Processing Unit (CPU) usage CPU的使用率 >用 Activity Monitor / Task Manager 監測 (可能會藏在合法的程式裏面變得難以排除) <font color="dark">**一些論文的做法**</font> 1. [Website Cryptojacking Detection Using Machine Learning](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9162342) (不停在讀取區塊鏈上的歷史交易紀錄,也同時在做記憶體的左移與右移) * monitored the **cache activity** * CryptoNight algorithm /Ethash 一些加密貨幣演算法 ![](https://i.imgur.com/qsU0n9u.png) **作法:** 蒐集 60secs內 每 100 毫秒 的cache hits 和 cache misses 次數 `The reason behind this is that when attacker set higher throttle, which means that the attacker is utilizing the CPU’s maximum capacity for computing hashes and because of which the attacker could compute maximum number of hashes possible` 2. [MINOS*: A Lightweight Real-Time Cryptojacking Detection System](https://www.ndss-symposium.org/wp-content/uploads/ndss2021_4C-4_24444_paper.pdf) 偵測的是wasm-based mining activity(二進位格式) MINOS uses an image-based classification technique 用圖像去區分有無被劫持 早期用黑名單排除惡意網頁很容易被繞過 而大部分是基於特徵分析 Most of these techniques are based on the analysis of dynamic features **缺點**:有很高的運行時間開銷(high runtime overheads),還會受其他外部程式干擾,而且需要權限才能監測(require administrator privileges to monitor CPU and memory events),並且這樣在背景下的動態分析也會影響使用者瀏覽網頁的效能 ``` attackers can throttle the resource consumption of their malware, change function names and strings, use proxies, dynamically generated domain names, and encrypted communications that make their detection increasingly challenging. ``` **MINOS 創新做法:** :::success **特徵 :** use of gray-scale image representations of Wasm-binaries in web browsers. **把網頁的wasm 二進制文件轉成灰階的圖 圖會相似是因為即便他們可以踩取各種手段 利用基於卷積神經網絡 (CNN) 的 Wasm 分類器將圖像分類為惡意(即加密劫持)或良性** // utilizes a Convolutional Neural Network (CNN)-based Wasm classifier to classify the image as either malicious(惡意) (i.e., cryptojacking) or benign(良性). MINOS does not require continuous monitoring of CPU, memory, and network events or counting running instructions. **不像上面需要持續監控CPU memory network event也不用在背景持續running** ::: **Malicious Cryptocurreny Mining Detection Systems** 1. Browser-based Mining (Cryptojacking) Detection `tries to find out how similar the analyzed module is to cryptojacking malware Wasms. In addition, it monitors cache events during runtime` 2. Host-based Stand-alone Mining Detection 針對主機的攻擊:用opcode sequences 和 system calls of windows portable executable files 3. Network-based Detection ### <font color="1F3484">**against cryptojacking**</font> >1. Use a good cybersecurity program: >2. Use browser extensions designed to block cryptojacking: minerBlock, No Coin, and Anti Miner 不好用因為(malicious entities that use cryptojacking malware change their domains’ names frequently) >3. Disable JavaScript:但這樣有些網頁功能就沒辦法使用 >* JavaScript的工作 * 嵌入動態文字 * 對瀏覽器事件做出回應 * 讀寫HTML元素 * 在資料被提交到伺服器之前驗證資料 * 檢測訪客的瀏覽器資訊 * 控制cookie建立、修改…等 >4. 討論 --- **公平交易?** >網頁提供你免費服務 Vs 使用者幫忙挖礦? :::info **大綱** 1. 動機/背景/cryptojacking intro 2. 攻擊模式 3. 具體例子 4. 防禦模式 5. 未來發展 :::

    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