AnnieDoDo
    • 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
    # Coursera - Penetration Testing, Incident Response and Forensics, Offered by IBM ## Planning * 主要的目標是什麼? 1. 特定的資料,或是特定某個人,甚至是某個群體: > 像是想要得到某台電腦或是手機的資訊 範圍就會限縮在那台電腦或是手機 2. 劃清界線: > 這時候就可以劃清邊界 知道哪些能做哪些不能做 ***法律***上(簽約的部分) ***實際應用***上(呃就是指物理或技術層面上) 也必須知道說目標是哪種服務或是產品? 會如何影響到使用他們的人? 例如某間公司想對內部使用的網路跟產品做測試 所以設定攻擊的時間點就要選在較無人使用的假日 攻擊要延續多久?是連續的還是斷斷續續的? 3. 通知需要知情的人 > 假如要做 social engineering 可能會需要到某個實體現場接觸到特定的人之類的(?) 參考資料: https://hub.packtpub.com/penetration-testing-rules-of-engagement/ * Rules of Engagement (RoE) is a document that deals with the manner in which the penetration test is to be conducted 1. The type and scope of testing Black box testing:完全不知道任何資訊,必須從掃 network map 開始。不太推薦,因為假定內部資訊只有內部能得到,而且也可能有內鬼。 White box testing:全部的資訊都給,有時候甚至包含 source code Gray box testing:最有用的方式,可能會給 url, document, test team 的 帳號等等。可以跟使用者一起做事,有機會從他們的觀點去做 social engineering 2. Client contact details 3. Client IT team notifications 4. Sensitive data handling 5. Status meeting and reports ## Discovery 1. 弱點分析:分析這個 target 是否有已知的弱點?(已知弱點有資料庫)透過弱點掃描工具有目的地找目標 2. 各種 scanning tools: * Network mapper - Nmap * Network Analyzer and Profiler - Wireshark * Password Crackers - JohnTheRipper * Hacking Tools - Metasploit (hacking database and tool repository) 3. 掃描有分成 passive & active * Passive Online - wire sniffing, man in the middle, 通常會把所有封包都搜集起來,直到足夠得到他的身份授權為止。replay attack,可能把這些身份授權的東西複製一份,讓自己有這個身份。(主要是 capture the session) * Active Online - 暴力破解;木馬,感染之後從遠端進入;hash injection,從他們的 server 拿到密碼檔之後再解密;釣魚。 * Offline Attacks - Pre-Computed Hashes,就是hash injection;Distributed Network Attack,Rainbow Attack,用 inverted cryptographic hash functions 先算好的表 ,都是 hash attack * Social Engineering * Google Hacking https://securitytrails.com/blog/google-hacking-techniques ## Attack 如果說,弱點掃描是用來檢查弱點存在的可能性 那麼 attack 階段就是真的戳下去,來確認弱點真的存在 ![](https://i.imgur.com/cZ5oMl9.png) 這個階段會是一個循環 第一步先確保已經能進入系統 我們已經在 Discovery 階段拿到了足夠的資料 這時候我們來到第二步 如果我們只是一般的使用者 那要提權到能拿到所有控制權, 或是至少能拿到可以對系統做更動的管理權限 這時候進到第三步 因為有了權限可以到處亂逛 所以用這個身份繼續搜集更多資料 當你發現自己可以進入一個新的系統或是可以使用新的工具 就可以再 loop 回去上一個 discovery 的階段 當然~我們可以各種繼續這個 cycle 下去 或是進入到下一步 安裝一些自己需要用的工具 ![](https://i.imgur.com/ZnyjU8R.png) 這邊他的課程感覺比較多是在講系統的 通常是已經利用 web 進來系統之後要做的事情 那如果是 web 方面的 penetration test 可以參考 OWASP ~ 他有提到八個進入系統之後 比較常見的弱點 第一個就是錯誤的設定 通常會是一些 default 的安全設定 第二個是跟 kernel 的漏洞 因為 kernel 的 code 是整個作業系統的核心 他會執行系統安全的 model 所以這會造成整個系統上的危險 第三個是非預期的輸入 以 web 的服務來說 假如要對資料庫做 query 但是這個 web 的服務沒有把不 ok 的 sql 指令給濾掉 那就可能會造成 sql injection 第四個是symbolic link 這個可以把它想成是 windows 的捷徑 從一個檔案指到另一個檔案 那如果今天有一個權限需要是 root 才可以讀寫執行的 但是對他建了一個 symbolic link 可能就騙過系統 可以對這個檔案讀寫跟執行 第五個是 file descripter 在 linux 系統裡啊~ 萬物皆是檔案 每個檔案都會有一個號碼去描述他 其實他就是個指標 每個 file descripter 都會指到不同的檔案 有些數字是約定成俗的 像是 stdin 是 0, stdout 是 1 及 stderr 2 接下來開的檔案就會照著順下去 現在有一個受害者正在使用terminal 1 你也開一個 terminal 2 然後再把這兩個 file descripter 交換 這樣對方打的東西就會跑到你這邊來了~ 第六個是 race condition 當一個 process 進入到 kernel mode 所以可以利用進入 kernel mode 跟著被提權 第七個是 buffer overflow 當 input 超過許可的長度 而 program 沒有檢查的時候 就會造成隨意的 code 片段 可能可以被系統以特權執行 最後一種是不 ok 的權限 可能造成別人可以對密碼檔讀寫 或甚至是從遠端可以 ssh 進去你的系統 ## Report 最後一個階段是 Report 主要有兩件事 第一件事是 executive summary 這邊主要是運用了我們第一階段的做的 planning 誰有加入?發生了什麼事?遇到了什麼困難? 最後把測試的結果整理成圖表或文件 因為會聽 report 的人 不一定是資訊相關背景的人 所以要盡量讓大家都能容易理解為主 然後可能用 cvss 做個 risk ranking 跟客戶解釋這些漏洞的危害程度 第二個是 techinal review 這個部分就是你本身找到了什麼漏洞? 中間你可能用什麼工具,怎麼打的 整個漏洞打下來的步驟 可能有截圖會讓對方的技術團隊較能理解怎麼修這個漏洞 感覺有點像是... 花錢請人幫忙 debug 找到 bug 之後,他們再自己修這樣

    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