G36_maid
    • 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
    # NASA HW04 學生鍾詠傑 學號41173058H <div style="page-break-after:always;"></div> ## 1. 迷星叫 ### 1. 在 Cisco Switch 上我們可以指定一個埠口為 Access Port 或者 Trunk Port,請問這兩者有什麼差異,請完成下列表格。 | | 可通過的 VLAN 數量 | 802.1Q 標記 | | - | - | - | | Access Port | 僅限於一個 VLAN | 不進行 802.1Q 標記 | | Trunk Port | 可通過多個 VLAN | 進行 802.1Q 標記 | <div style="page-break-after:always;"></div> ### 2. 請問何謂 Trunk Native VLAN? Trunk Native VLAN 是指在一個 Trunk Port 上,未標記(即未打上 802.1Q 標籤)的封包所屬的 VLAN。 當封包從 Trunk Port 進入或離開交換機時,如果封包未標記,則交換機將其視為屬於 Trunk Native VLAN。 通常情況下,交換機的 Trunk Native VLAN 與管理人員設置的其他 VLAN 是分開的。 這樣做的目的是為了確保 Trunk Port 能處理未標記的封包,以及在需要時能夠區分它們屬於哪個 VLAN。 <div style="page-break-after:always;"></div> ### 3. | 傳遞方向 | 線路 1 | 線路 2 | 線路 3 | 線路 4 | 線路 5 | 能否抵達 | | -------- | ------ | ------ | ------ | ------ | ------ | ---- | | PC-01/VLAN 10 → PC-02 |10|10||||可| | PC-01/VLAN 20 → PC-02 |20|X||||否| | PC-01/VLAN 10 → PC-04 |10||無||X|否| | PC-01/VLAN 20 → PC-04 |20||20||20|可| | PC-01/VLAN 10 → PC-03 |10|||10||可| | PC-01/VLAN 20 → PC-03 |20|||20||可| <div style="page-break-after:always;"></div> ### 4. 在這個網路中有機會能透過 Double Tagging Attack 從 PC-01/VLAN 10 傳送到 PC-04。 PC-01 的 VLAN 10 封包通過 Trunk Port 發送到 switch-01,然後通過帶有 VLAN 10 和 VLAN 20 的 Trunk 連接發送到 switch-02。然而,在 switch-01 到 switch-02 的 Trunk 連接上,VLAN 10 被設定為 Native VLAN。 Native VLAN 是在 Trunk 連接上未打上 VLAN 標籤的默認 VLAN, 但在這個情況下,switch-01 將 Native VLAN 設置為 VLAN 10。 由於 VLAN 10 是 Native VLAN,因此從 switch-01 到 switch-02 的 Trunk 連接上傳輸的 VLAN 10 封包將不會被打上 VLAN 標籤。因此,當這些不帶 VLAN 標籤的封包到達 switch-02 時,switch-02 將會將它們視為屬於其本地 VLAN 20(即目標 VLAN)的封包進行處理。 所以 PC-01 發送的 VLAN 10 封包在特定情況下能夠發送到 PC-02 。 <div style="page-break-after:always;"></div> ## 2. 春日影 ### part1 密碼有以下 ``` enable secret 5 $1$mERr$xOBRtHD8zJf.94CGVuvjw/ username RiNG privilege 15 password 7 0813435D0C150C16 ``` 一種是Cisco的Type 7加密形式,一種是Type 5加密形式。 前者是Cisco自己的加密形式,存在多年,但是這種加密方式很簡單,是可以進行破解的。 後者相當於MD5加密,是無法被破解的。 透過 0813435D0C150C16 經過解密工具 可以知道密碼是`Roselia` 工具: https://www.firewall.cx/cisco/cisco-routers/cisco-type7-password-crack.html <div style="page-break-after:always;"></div> ### part2 建立VLAN 20,30 將 Fa0/1-3 規劃到 Vlan 20 設定為access, 將 Fa0/11-12 規劃到 vlan 30 設定為access, ``` RiNG-Core(config)#vlan 20 RiNG-Core(config-vlan)#exit RiNG-Core(config)#vlan 30 RiNG-Core(config-vlan)#exit RiNG-Core(config)#interface range fastEthernet 0/1-3 RiNG-Core(config-if-range)#switchport access vlan 20 RiNG-Core(config-if-range)#exit RiNG-Core(config)#interface range fastEthernet 0/11-12 RiNG-Core(config-if-range)#switchport mode access RiNG-Core(config-if-range)#switchport access vlan 30 RiNG-Core(config-if-range)#exit ``` RiNG-Edge 中 建立Vlan 20 並 將 Fa0/21-22 規劃到 Vlan 20 設定為access ``` RiNG-Edge(config)#vlan 20 RiNG-Edge(config-vlan)#exit RiNG-Edge(config)#interface range fastEthernet 0/21-22 RiNG-Edge(config-if-range)#switchport mode access RiNG-Edge(config-if-range)#switchport access vlan 20 RiNG-Edge(config-if-range)#exit ``` 以下設定在RiNG-Core RiNG-Edge 中都有做 刪除vlan 10 ``` RiNG-Core# configure terminal RiNG-Core(config)# RiNG-Core(config)# no vlan 10 ``` 改名vlan 20 30 ``` RiNG-Core(config)#vlan 20 RiNG-Core(config-vlan)#name VLAN-MyGO RiNG-Core(config-vlan)#exit RiNG-Core(config)#vlan 30 RiNG-Core(config-vlan)#name VLAN-AveMujica RiNG-Core(config-vlan)#exit ``` 將swithc 0-1 中 Gi 0/1-2 設為 port-channel 開啟 Trunk模式 ``` ### Trunk : 多個 VLAN RiNG-Core(config)# interface GigabitEthernet 0/1-2 // specify interface RiNG-Core(config-if-range)# switchport mode trunk // force mode TRUNK RiNG-Core(config-if-range)# switchport trunk allowed vlan 20,99 RiNG-Core(config-if)# exit // 1. add physical ports into port channel RiNG-Core(config-if)# interface range GigabitEthernet 0/1-2 RiNG-Core(config-if-range)# channel-group 1 mode active RiNG-Core(config-if-range)# exit // 2. create a new port channel RiNG-Core(config)# interface port-channel 1 RiNG-Core(config-if)# switchport mode trunk RiNG-Core(config-if)# switchport trunk allowed vlan 20,99 RiNG-Core(config-if)# exit ``` <div style="page-break-after:always;"></div> ### part3 #### 調整帳號 RiNG 的密碼為 secret 模式,且更改密碼為 Afterglow 如過對兩個密碼使用相同的用戶名 所以我採取以下措施: 添加帶有秘密密碼的新用戶<<-這作為備份,以防刪除舊用戶名後無法存取任何內容。 刪除舊的用戶名命令,然後使用秘密密碼再次添加它。 以下設定在 RiNG-Core 跟 RiNG-Edge 中的做法一樣 ``` RiNG-Core(config)#username RiNG_backup secret Roselia RiNG-Core(config)#exit RiNG-Core# RiNG-Core#write memory Building configuration... [OK] RiNG-Core#configure terminal RiNG-Core(config)#no username RiNG RiNG-Core(config)#exit RiNG-Core#write memory Building configuration... [OK] RiNG-Core#conf t RiNG-Core(config)#username RiNG secret Afterglow RiNG-Core(config)#no username RiNG_backup RiNG-Core(config)#exit RiNG-Core#write memory Building configuration... [OK] ``` #### 啟動 RiNG-Core 的 Telnet/SSH 登入 這部分 RiNG-Edge 不用做 ``` RiNG-Core(config)# ip domain-name Ring_Core RiNG-Core(config)# crypto key gen rsa 輸入1024 ``` #### 設定 RiNG-Core 和 RiNG-Edge 的 vty 0-4 都可以使用 (a) 的帳密且只能透過 SSH 登入 ``` RiNG-Core(config)# line vty 0 4 RiNG-Core(config-line)# transport input ssh RiNG-Core(config-line)# login local ``` #### 設定 RiNG-Core 和 RiNG-Edge 的 vty 5-15 都無法登入 ``` RiNG-Core(config)# line vty 5 15 RiNG-Core(config-line)# transport input none ``` #### 設定 RiNG-Core 和 RiNG-Edge 的 SSH 版本為 v2 ``` RiNG-Core(config)# ip ssh version 2 RiNG-Core(config)# do wr //儲存 ``` <div style="page-break-after:always;"></div> ## 3. 無路矢 ### 1. ![Capturing from 乙太網路 2024_3_17 下午 07_39_10](https://hackmd.io/_uploads/B1Rv88V0a.png) 以上是經過手動/release /renew 之後,使用Wireshark觀察手動filter DHCP 在使用Wireshark來觀察通過DHCP協定自動取得網路組態的過程時,我們可以觀察到以下四個階段,也就是DORA: 1. **Discover (尋找):** 在這個階段,客戶端(即你的電腦)向網絡中的DHCP伺服器發送尋找請求。這個尋找請求是一個廣播消息,目的是尋找可用的DHCP伺服器。 2. **Offer (提供):** DHCP伺服器收到尋找請求後,如果有可用的IP地址和設定資訊,就會向客戶端發送一個提供消息。這個消息包含了IP地址、子網掩碼、網關等資訊。 3. **Request (請求):** 客戶端收到一個或多個提供消息後,會從中選擇一個提供消息,然後向該DHCP伺服器發送一個請求消息,表示接受該伺服器提供的設定資訊。 4. **Acknowledge (確認):** DHCP伺服器收到請求消息後,會向客戶端發送一個確認消息,表示客戶端可以開始使用提供的IP地址和設定資訊了。 這四個階段共同構成了DHCP的過程,使得客戶端可以自動獲得網路設定資訊,而無需手動設定。 <div style="page-break-after:always;"></div> ### 2. 在DHCP Discover階段中,以下是特殊的IP/MAC地址以及它們的含義: - **IP 0.0.0.0**: - 涵義:表示客戶端尚未擁有有效的IP地址。 - 原因:在DHCP Discover階段,客戶端尚未獲得有效的IP地址,因此它在尋找可用的DHCP伺服器時使用0.0.0.0作為源IP地址。 - **IP 255.255.255.255**: - 涵義:表示廣播地址,用於將消息發送到網絡中的所有主機。 - 原因:在DHCP Discover階段,客戶端尋找可用的DHCP伺服器,因此將尋找請求消息廣播到網絡中的所有主機,以便任何可用的DHCP伺服器都能接收到。 - **MAC FF:FF:FF:FF:FF:FF**: - 涵義:表示廣播MAC地址,用於將消息發送到網絡中的所有主機。 - 原因:與IP 255.255.255.255相似,在以太網中,MAC地址FF:FF:FF:FF:FF:FF是一個特殊的廣播地址,它將消息發送到網絡中的所有主機,以便任何可用的DHCP伺服器都能接收到尋找請求消息。 在DHCP Discover階段,使用這些特殊地址可以確保所有的DHCP伺服器都能收到尋找請求訊息(對所有人請求) <div style="page-break-after:always;"></div> ### 3. 以下是對RiNG-Core 進行 dhcp snooping 的方式 並對FA0/22設定為信任(預設為否) ``` RiNG-Core#conf terminal Enter configuration commands, one per line. End with CNTL/Z. RiNG-Core(config)#ip dhcp snooping vlan 1 RiNG-Core(config)#in RiNG-Core(config)#interface fa RiNG-Core(config)#interface fastEthernet 0/22 RiNG-Core(config-if)#ip dh RiNG-Core(config-if)#ip dhcp s RiNG-Core(config-if)#ip dhcp snooping t RiNG-Core(config-if)#ip dhcp snooping trust RiNG-Core(config-if)#exit ``` Ref: https://www.youtube.com/watch?v=2eNsoS9Ri6w&ab_channel=NorthwoodsPS <div style="page-break-after:always;"></div> ## 指令備份 ### mode ``` meow> // user EXEC meow> enable meow# // privileged EXEC meow# configure terminal meow(config)# // global configuration meow(config)# interface GigabitEthernet 1/0/1 meow(config-if)# // interface configuration meow(config-if)# exit meow(config)# // global configuration meow(config)# exit meow# // privileged EXEC meow# disable meow> // user EXEC ``` ### VLAN ``` meow(config)# vlan 99 // create a vlan meow(config-vlan)# exit ``` ### Access : 單一 VLAN ``` meow(config)# interface FastEthernet 1/0/1 // specify interface meow(config-if)# switchport mode access // force mode ACCESS meow(config-if)# switchport access vlan 123 meow(config-if)# exi ``` ### Trunk : 多個 VLAN ``` meow(config)# interface GigabitEthernet 1/0/2 // specify interface meow(config-if)# switchport mode trunk // force mode TRUNK meow(config-if)# switchport trunk allowed vlan 1-10,123 meow(config-if)# exit ``` ### Port Channel : 多個 Port ``` // 1. add physical ports into port channel meow(config-if)# interface range GigabitEthernet 1/0/1-4 meow(config-if-range)# channel-group 1 mode active meow(config-if-range)# exit // 2. create a new port channel meow(config)# interface port-channel 1 meow(config-if)# switchport mode trunk meow(config-if)# switchport trunk allowed vlan 1-10,123 meow(config-if)# exit ``` ### other ``` meow# copy running-config startup-config // method 1 meow# write memory // method 2 meow(config)# do wr ``` ``` meow# show ... // in privileged EXEC meow(config)# do show ... // at or above global configuration ``` ###

    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