DDDD1225
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # 資訊搜集技巧 :::info :bulb: 期中考 ::: ### :book: 駭客入侵五步驟 #### 1️⃣ 偵查(Reconnaissance) > ◼ 99.9%駭客,都是要經長期的偵查後,才入侵成功的。 > > ◼ 駭客通常會先蒐集很多關於目標的資訊,以進行評估及攻擊。 > > 1.被動式偵查(Passive reconnaissance) > > 2.主動式偵查(Active reconnaissance) #### 2️⃣ 掃描(Scan) >◼Port掃描 > >◼Network對應(拓樸)圖 > >◼弱點掃描 > #### 3️⃣ 獲得存取權限(Gaining Access) >◼此階段屬於滲透階段,是駭客真正在入侵系統的時期。 > >◼入侵的行為可以透過區域網路,網際網路或欺騙。 > >◼手法包括了「緩衝區溢位」、「阻斷服務」、「攔截」及「密碼破解」…等。 > >==◼駭客可以獲取的權限區分成:== >>==1.作業系統等級(operating system level)== >> >>==2.應用程式等級(application level)== >> >>==3.網路等級(network level)。== #### 4️⃣ 維護存取(Maintaining access) >◼在此階段,駭客已取得一般使用者權限、或經由提權,取得了系統的權限,並且可使用系統的資源。 > >◼此時,駭客可在此系統上,進行下列的行為 : >>1.上傳(uploading) >> >>2.變更(altering) >> >>3.下載(downloading) >> >>4.讀取(reading) #### 5️⃣ 清除軌跡(Clearing tracks) >◼許多主機對於連線的行為都會進行記錄,因此,駭客必須設法覆蓋或刪除入侵的軌跡,以隱藏其 活動的訊息,避免被發現。 > >◼方法包括: >>1.偽裝術(Steganography) >> >>2.建立隱密通道(Tunneling) >> >>3.改變log檔。 --- ### :book: 資訊蒐集 >◼滲透測試,第一步是先蒐集目標的相關資訊,從收集到的資訊,可判斷目標有哪些漏洞。 > >◼可能收集到關鍵人員的資訊(如個資等) ,這些資訊可做為後續帳號或密碼的猜測依據。 > >◼也可能直接取得使用者帳號、密碼的配置表,以及系統設定檔,這些對於後續的攻擊作業有很大的幫助。 > >◼可利用網際網路,搜尋跟目標相關的資訊。 > >==◼因Goolge搜尋引擎,每 6~8 星期會利用Googlebot將可查找的資料找過一遍,並備份至Google儲存伺服器中,故對Google搜尋引擎,輸入適當的條件要求,會有不錯的回應收穫。== > >◼因不需直接探測目標物,故不論搜尋幾次,也不用擔心會被目標物的防護設備,例如IDS或IPS 發現。 --- ### :book: DNS Zone Transfer >◼一般大型企業會自行架設DNS server。 > >◼為了避免DNS的服務忽然中斷,企業通常會建立多台備援DNS Server > >==◼當有多台的DNS Server時,考量紀錄的同步問題,通常會使用Zone Transfer 來同步紀錄。== > >◼對DNS伺服器進行Zone Transfer,此動作是有入侵的意涵,故千萬不要任意對他人公司或組織的DNS伺服器進行Zone Transfer。 --- ### :book: ==nslookup-指令== >◼nslookup是一款查詢 DNS 的小工具,主要用來查詢網域名稱及IP位址之間的對應關係。 ![圖片](https://upload.cc/i1/2024/04/17/0EVsud.png) ![圖片](https://upload.cc/i1/2024/04/17/FwbsJA.png) --- ### :book: ==Who is (TCP協定43 PORT)== >◼現有許多的網站,都有提供whois查詢功能。 > >測試:https://www.whois.com ![圖片](https://upload.cc/i1/2024/04/17/KpdzVG.png) --- ### :book: Google Hacking >◼Google Hacking 是藉由瀏覽器,使用Google的搜尋功能,從Internet 搜尋目標網路的相關資訊,例如:員工名單、個人資料、系統設定檔或帳號密碼。 > >◼常用的限定詞如下 >>Site: {HOST /Domain},指定查詢目標,可以是網站或者網域 >> >>Filetype: Type,指定查詢的檔案副檔名(例 pdf,xls,docx,ppt) >> >>Inurl: login.js,指定查詢網址中有「login.js」字樣的網頁 >> >>Intitle:“index of”,指定查詢網頁的標題包含index of的網頁 >>>一些例子: >>> >>>==inurl:login.php site:.edu.tw== >>> >>>==intitle:”Hacked By” site:.edu.tw== >>> >>>==filetype:xls 帳號 密碼 site:.edu.tw== >>> >>>==“index of /” site:.edu.tw== >>> >>>![圖片](https://upload.cc/i1/2024/04/17/1pGgQn.png) >>> >教學網站 http://www.googleguide.com > >GHDB (Google Hacking DataBase) > >https://www.exploit-db.com --- ### :book: HTTrack Website Copier >進行網站滲透測試時,有時需對網頁內容進行分析,如果逐頁瀏覽效率太慢,可利用此工具,將整個網站複製到本地端,再慢慢分析。 > >==HTTrack Website Copier 是一款可將整個網站內容下載回來,再離線閱讀的免費軟體。== > >此款工具會將整個網站內容下載到本地端的資料夾 (預設為C:\My Websites),然後在該資料夾中,建立所有必要的子資料夾,並從伺服器端將所有圖片、HTML 及其他檔案下載回來。 ![圖片](https://upload.cc/i1/2024/04/17/gPBlz0.png) --- ### :book: DNS資訊 >◼DNS主要是負責 hostname 對 IP 的轉譯工作。 > >◼DNS包含 hostname 的所有對應資料,故探索DNS之訊息,對於滲透有很大的幫助 > >◼DNS 的資料庫之record各欄位: > >>1.NS(host name server):網域名稱 >> >>2.A(address):網域名稱所對應的IPv4位址 >> >>3.AAAA(address):網域名稱所對應的IPv6位址 >> >>4.MX(mail exchanger):郵件伺服器 >> >>5.PTR(pointer):反解資訊 --- ### :book: SSL資訊 >◼SSL(Secure Sockets Layer)是在網頁伺服器和瀏覽器之間,以加解密方式進行通訊的安全技術標準。 > >◼這個通訊過程,確保了所有在伺服器與瀏覽器之間,資料的私密性與完整性 > >◼SSL目前正廣泛使用在http(https)、ftp(ftps)、telnet(ssh)連線上 > >◼SSL通訊時,使用的加密金鑰是兩方協議而得,故透過==中間人攻擊,有可能從中攔截和偽造兩方往來的封包內容。== --- ### :book: sslscan >◼sslscan是用來測試伺服器支援的SSL類型和加密種類。 > >◼如果伺服器使用舊版本SSL,也許可找到可利用的漏洞,進行滲透。 >![圖片](https://upload.cc/i1/2024/04/17/sIu0Jt.png) > --- ### :book: 線上資訊收集工具- 收集漏洞資訊、主機 >◼網路上存在很多無敵意及有敵意的掃瞄。 > >◼駭客藉由掃描,可找到某些網站的漏洞,這些被查找到的漏洞,通常不會主動提供給網站擁有者。 > >◼這些漏洞資訊有時會駭客發佈到網路上,故可在網路上找尋已公布有漏洞的網站,以進行滲透攻擊。 > >◼接下來介紹一些線上資訊蒐集工具 >>1️⃣web.archive.org >>>◼Wayback Machine 是「網際網路檔案館」(Internet Archive)旗下的一項網頁保存計劃,它正在紀錄每分每秒不斷改變的網路生態。 >>> >>>◼每週透過網路爬蟲(Crawler),抓取超過十億個網頁內容!運用大量伺服器、頻寬來提供服務,並極力節省資料大小,因此可以在該網站上,找到一些有興趣網站之古老的網頁備份。 >>> >>>◼Wayback Machine 亦提供線上「網頁備份」功能,只要輸入要備份的網頁網址,就能將它擷取下來,產生一個獨立且永久保存的網址,未來可在 Wayback Machine ,以時光機功能隨時回顧不同時間點,自動抓取備份的網頁內容。 >>>![圖片](https://upload.cc/i1/2024/04/17/6Une1B.png) >>> >>2️⃣ http://www.zone-h.org/archive >>>◼zone-h的archive是專門收集全球被駭網站的資料,一進入就可看到最近被害的網站之資料,且可以過濾條件設定顯示內容。 >>>![圖片](https://upload.cc/i1/2024/04/17/BPMdHC.png) >>3️⃣ www.exploit-db.com >>>◼exploit-db 提供全球駭客提交漏洞的網站,也提供如何利用漏洞的payload,進入網頁就會顯示最近提交的漏洞 >>>![圖片](https://upload.cc/i1/2024/04/17/iImdEC.png) >>4️⃣www.exploit-db.com >>>◼exploit-db 還有Google Hacking Database,GHDB會提供Google Hacking的查詢語法,可以利用這些語法,查詢目標是否有對應的漏洞 >>>![圖片](https://upload.cc/i1/2024/04/17/i2WZye.png) >>> >>5️⃣https://www.seebug.org >>>◼Seebug跟前面提到的exploit-db很像,提供過濾及查詢功能,且介面是中文版,使用上比較容易上手 >>>![圖片](https://upload.cc/i1/2024/04/17/iqBEMn.png) >>==6️⃣http://cve.mitre.org== >>>==◼此網站是一個通用的漏洞資料庫,每一漏洞都給予編號,格式為CVE-YYYY-NNNN。== >>> >>>◼許多弱點掃描可在找到的弱點報表中,列出其對應的CVE編碼。 >>>![圖片](https://upload.cc/i1/2024/04/17/hQoDsU.png) # 網路資訊搜集 ## TCP/UDP Port Scan ### :book: ==網路掃描技術與方法== >◼透過掃描技術,可知道==目標主機之各種TCP/IP port的分配與開啟狀態、使用者所開放的服務、服務軟體版本及作業系統資訊。== > >◼可透露出目標主機所存在的安全問題。 > >◼掃瞄(Scanning、傳輸層) 與列舉(Enumeration、應用層)是攻擊者入侵的第一步驟。 > >◼掃瞄完畢通常就接著進行列舉,故許多的工具軟體也將這兩個步驟結合在一起。 --- ### :book: 常見TCP ports ![圖片](https://upload.cc/i1/2024/04/17/y3HpUx.png) ![圖片](https://upload.cc/i1/2024/04/17/SyJUOA.png) --- ### :book: ==Scanning== >◼藉由掃描可以取得特定主機的IP、作業系統及版本、網路和主機系統架構以及主機上所開啟的服務等等 > >◼依掃描結果,大概分為三類: > >>1.通訊埠端口掃描 >> >>2.網路架構掃描 >> >>3.弱點掃描 >> >==◼依掃描原理,可分為ping scan 及 port sacn== --- ### :book: Ping Scan >◼ICMP Echo > >>==對目標發送ICMP Echo Request 封包,等待ICMP Echo Reply的封包== >> >◼Broadcast ICMP > >>利用ICMP廣播,探測網路範圍內的主機,網路中的上線主機將會予以回應。但此種掃描只適用於UNIX/Linux系统 --- ### :book: Port Scan >◼當駭客想要入侵一部主機時,針對某port ,先傳送一連串的特殊訊息,依照回應訊息,以解析目標主機提供的服務。進一步,嘗試拿到其他相關資訊 > >◼主要可區分為兩類: > >>TCP >> >>UDP --- ### :book: ==TCP Port Scan== >◼TCP(傳輸層)在通訊時,在TCP的封包表頭中有多個旗標(Flag),這些Flag是為了識別及控制的用途,每個Flag在封包中只佔用了1 bit。 > >◼因為通訊協定先天上的缺陷,駭客可利用這些Flag及不完整的程序,進行主機或Port的掃瞄,卻不容易被目的主機發覺。 > >在TCP的旗標中,包括: > >>==1.Synchronize(SYN):用來初始化主機間的連接。== >> >>==2.Acknowledgement(ACK):用來確認主機間的連接。== >> >>==3.PUSH(PSH):立即送出緩衝的資料。== >> >>==4.Urgent(URG):封包中的資料必須立即被處理== >> >>==5.Finish(FIN):通知遠端系統傳輸即將結束。== >> >>==6.Reset(RST):重新啟動連線。== >> >◼網路伺服器開啟的服務,就是在某一個特定的TCP Port上傾聽(Listen),以等待使用者的連結,例如Http Server在Port 80上傾聽。 > >==◼任何一個程式在某一個特定的Port上傾聽,等待使用者的連結,就稱這個Port的狀態為Open,反之則稱這個Port的狀態為Close。== >正常「三方握手協定」之基本程序 >>電腦A會先向電腦B先送出一個SYN,電腦B如果收到一個SYN,會回應一個SYN/ACK(這代表SYN及ACK之位元都被設成1)。 >> >>電腦A收到電腦B發送的SYN/ACK封包,會再回應一個ACK。如此,兩台電腦間的連線動作就算完成。 >> >>![圖片](https://upload.cc/i1/2024/04/17/0oGmMa.png) >> >>如果前述的「握手」不依照規定進行,會發生什麼狀況? --- ### :book: ==不完整的TCP三方握手協定== 1. SYN Stealth 2. Xmas Scan 3. FIN Scan 4. NULL Scan 5. IDLE Scan 6. TCP Connect 7. RPC Scan ### :book: ==FIN Scan== >◼首先A發送一個FIN封包,送到目的主機B的一個Port。 > >==◼假設主機B的Port是開啟的,主機B應該不會有任何回應==(由此判斷主機是活著)。假設主機B的Port是關閉的,主機B會送回一個RST/ACK封包給來源A,就代表這個Port的服務是關閉的。 ### :book: ==IDLE Scan== >◼Idle Scan是一種非常難以察覺的Port Scanning的方法,攻擊者完全不需使用真實的IP來傳送封包給被攻擊的目標主機,而IDS(IntrusionDetection System)也會誤以為無辜的僵屍電腦才是攻擊的來源 > >◼殭屍電腦(Zombie computer) >>簡稱「殭屍(zombie)」,有些人稱之為「肉雞」,指的是一部已經被駭客、電腦病毒、或木馬入侵的電腦,殭屍電腦通常都是連上網際網路。 >> >>殭屍電腦的真正擁有者一般都不會察覺到自己的電腦系統已經被「殭屍 化」,所以暗喻這些電腦與電影情節中的殭屍無異。 >> > ==IDLE Scan(cont.)== >>==每一個IP封包都有一個IPID欄位,大部分的作業系統針對這個欄位只是循序的流水編號==。 >> >>==任何電腦若只收到SYN/ACK將會回覆一個RST==(因為沒發出SYN),但是同時這封包會包含這台主機的IPID,而每次的SYN/ACK連線都會讓IPID會加1。 ### :book: ==Xmas Scan== >==若一個關閉的Port收到諸如FIN、X-mas、Null Scan的封包,則必須回應一個RST封包,若是開放的Port,則會忽略這些封包。== > ### :book: ==Nmap 語法== >namp [選項] [-p ports] Host >>-p ports 表示指定要掃描的端口,如果想要掃描多組端口時,可以使用「,」分開,連續端口可以使用「-」。 例如: -p 80 備註:可用U與T參數,以區分是UDP或TCP連接埠。例如:-p U:80 只掃描UDP 80,-p T:80只掃描TCP 80 >>-p 21,22,23,24 >> >>-p 21,22,101-1024,1443 >> >>-p (只有此項等於全部端口) >> >>==-F :表示掃描常用端口== (設定參考在 /usr/share/namp/nmap-services) >> >>==-PN 掃描在防火牆保護下的主機== >> >>==-A 偵測主機的作業系統與其各種服務的版本== >> >>==-sA 偵測主機是否有啟用防火牆== >> >>==-O 偵測目標主機的作業系統== >> >>==-sL 列出目標主機IP位址,不會進行真正的掃描==

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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