Sean Wei
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
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
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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- type: slide tags: presentation,security title: Cybersecurity Intro 資安入門 - 竹北高中 2023 description: Sean 韋詠祥 / 2023-05-06 09:00 / 報到 / 什麼是資安 / Jeopardy 基本分類 / 認識 Linux 環境、指令教學 / 資安競賽概覽 / Web 網頁安全、Crypto 密碼學、Reverse 逆向工程、Binary 執行檔滲透、Forensic 數位鑑識、Misc 其他通靈題型 / 總結、延伸學習資源 / QA、自由練習 --- # Cybersecurity 資訊安全入門講座 @ 竹北高中 講者:Sean 韋詠祥 <br> ###### 投影片連結:https://hackmd.io/@Sean64/sec-cpshs2023 ###### 直播連結:[YouTube @Sean-Wei](https://www.youtube.com/live/Gh20z6-0ulU) Note: 2023-05-06(六) ### 時間規劃 08:45 - 09:00 報到 09:00 - 09:15 開場 09:15 - 09:45 認識 Linux 環境 09:45 - 10:00 資安競賽概覽 10:00 - 10:30 Web 網頁安全 (Part 1) 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:15 - 12:00 Misc 其他通靈題型 12:00 - 13:00 用餐休息與交流時間 13:00 - 13:45 Web 網頁安全 (Part 2) 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:15 - 15:00 Forensic 數位鑑識 15:00 - 15:30 Web 網頁安全 (Part 3) 15:30 - 15:45 總結、延伸學習資源 15:45 - 16:00 QA、自由練習 行事曆: https://calendar.google.com/calendar/event?eid=MmtkZ3QzaW9zcHA2ZzYzNHRzNGk4ZXJ2aGcgbWVAc2Vhbi50YWlwZWk 校網公告: https://www.cpshs.hcc.edu.tw/ischool/public/news_view/show.php?nid=6858 報名表單: https://forms.gle/rERWYg9mfsgbZGgf7 ---- ## 講者介紹 - 交大資工大四 Sean Wei 韋詠祥 ![](https://i.imgur.com/MWUuh5D.png) Note: 開場 15 min 08:45 - 09:00 報到 09:00 - 09:15 開場 - 交大 資安檢測員 竹苗區網 - 行政院 網路攻擊手 政府弱掃 - CEH 技術、(ISC)² CC 管理 - SITCON 2022 議程組長 ---- ## 什麼是資安? 又為何想學習資安 Note: VPN 保護上網安全 小米華為資安疑慮 --- ## 認識 Linux 指令環境 請打開 Git Bash Note: 09:15 - 09:45 認識 Linux 環境 09:15 - 09:20 基本指令 09:20 - 09:25 多行指令 09:25 - 09:45 進階指令 ---- ## Linux 基本指令 - 三大作業系統簡介 - Linux 指令慣例用法 Note: 09:15 - 09:45 認識 Linux 環境 09:15 - 09:20 基本指令 ls, pwd, cd ls -l ~ ---- ## 多行指令 - Linux 指令核心精神 Note: 09:15 - 09:45 認識 Linux 環境 09:20 - 09:25 多行指令 | head, tail, less, grep pwd; ls ---- ## Busybox - 下載:https://frippery.org/files/busybox/busybox.exe - 路徑:`%HOMEPATH%` - 建立 bin 資料夾 Note: 09:15 - 09:45 認識 Linux 環境 09:25 - 09:45 進階指令 whois twnic.net.tw gamer.com.tw strings ---- ## 進階指令 [krother/bash_tutorial](https://github.com/krother/bash_tutorial#preparations) ```bash cd ~/Documents/ git clone https://github.com/krother/bash_tutorial.git cd bash_tutorial/ cd exercises/ cd exercise_1/ ``` Note: 09:15 - 09:45 認識 Linux 環境 09:25 - 09:45 進階指令 --- ## 資安競賽概覽 Cybersecurity Contest Note: 09:45 - 10:00 資安競賽概覽 09:45 - 09:50 bug bounty 09:50 - 09:55 CTF 概覽 09:55 - 10:00 類型簡介 ---- # 資安競賽類型 - Bug Bounty 賞金獵人 - Capture the Flag (CTF) Note: 09:45 - 10:00 資安競賽概覽 09:45 - 09:50 bug bounty ---- ## Bug Bounty 賞金獵人 以 [Apple](https://security.apple.com/bounty/categories/) 為例 ![](https://i.imgur.com/U0voDqI.png) <small><sup>$500,000 美金 = ~1,500 萬台幣</sup></small> Note: 09:45 - 10:00 資安競賽概覽 09:45 - 09:50 bug bounty ---- ## Capture the Flag (CTF) 又分為... - Attack and Defense 攻防賽 - King of the Hill 爭霸戰 - Jeopardy 解謎賽 Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- ## Attack and Defense (A&D) - 主辦單位提供機器/服務 - 自行研究漏洞 - 幫服務上 patch(補丁) Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- ## HITCON DEFENSE ![](https://i.imgur.com/oB8oYOf.jpg =x480) Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- ## King of the Hill (KoH) - 主辦單位提供幾個服務 - 看誰程式最短、撐得久、速度快、最接近完美 - 通常沒有標準解 Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- ## KoH 題目舉例 - 用最少步數解出 Wordle - 執行任何指令,讓自己程式存活最久 - 植入後門,讓首頁出現自家隊伍名稱 Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- ## Jeopardy - 大家解同一套題組 - 通常各題分數與難度相關 - 最常見的競賽類型 - 找到長得像 `FLAG{printable}` 的字串 Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- ## Jeopardy 常見形式 - CTFd ![](https://i.imgur.com/zeL82yw.png =x480) Note: 09:45 - 10:00 資安競賽概覽 09:50 - 09:55 CTF 概覽 ---- # Jeopardy 基本分類 - Reverse 逆向工程 - Binary 執行檔滲透 - Web 網頁安全 - Crypto 密碼學 - Forensic 數位鑑識 - Misc 其他通靈題型 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 ---- ## Reverse 逆向工程 - 給一個執行檔,回推原始碼 - 先備知識:看得懂組合語言、熟悉各語言特性 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 ---- ## Binary 執行檔滲透 - 看懂程式碼後,找出漏洞並破解 - 通常需要 RCE 執行特定程式碼 - 先備知識:Reverse、系統架構 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 ---- ## Web 網頁安全 - 通常會是一個有資安漏洞的網站 - Flag 可能藏在原始碼、設定檔、資料庫等 - 先備知識:了解常見開發問題 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 ---- ## Crypto 密碼學 - 通常會給加密用腳本、密文 - 自己找出實作瑕疵、可逆函式 - 先備知識:比較吃數學基礎 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 ---- ## Forensic 數位鑑識 - 提供數位檔案,從蛛絲馬跡找出答案 - 例如被駭侵的電腦映像檔 - 先備知識:工具使用、系統架構 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 ---- ## Misc 其他通靈題型 - 無法被歸到特定類別 - 所有天馬行空的題目 Note: 09:45 - 10:00 資安競賽概覽 09:55 - 10:00 類型簡介 --- ## Web 網頁安全 (Part 1) Note: 10:00 - 10:30 Web 網頁安全 (Part 1) 10:00 - 10:10 F12 + HTML 教學 10:10 - 10:20 BAC + JS 教學 10:20 - 10:30 cmdi + PHP 講解 ---- ## Welcome to CTF 請開啟 https://ctf.sean.cat/ 第一題 ![](https://i.imgur.com/SPwstTz.png) Flag 格式為 `FLAG{Print@b1e}` Note: 10:00 - 10:30 Web 網頁安全 (Part 1) 10:00 - 10:10 F12 + HTML 教學 ---- ## Broken Access Control ![](https://ctf.sean.cat/assets/img/bac.png =x400) Note: 10:00 - 10:30 Web 網頁安全 (Part 1) 10:10 - 10:20 BAC + JS 教學 Sean CTF 第二題 ---- ## Command Injection ![](https://ctf.sean.cat/assets/img/cmdi.png =x400) Note: 10:00 - 10:30 Web 網頁安全 (Part 1) 10:20 - 10:30 cmdi + PHP 講解 Sean CTF 第三題 --- ## Crypto 密碼學 (Part 1) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:30 - 10:35 摩斯電碼 10:35 - 10:40 國際手旗信號、國際信號旗 10:40 - 10:45 信號旗例題 10:45 - 10:50 豬圈密碼、例題 10:50 - 10:55 Caesar 10:55 - 11:00 Ecoji 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 ---- ## 摩斯電碼 ![](https://i.imgur.com/6jf9OYv.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:30 - 10:35 摩斯電碼 摩斯電碼 / 摩斯密碼 後面 Encode Encrypt Hash 會提到 https://web.northeastern.edu/stemout/morse-code ---- ## 摩斯電碼例題 Morse code ```text ..-. .-.. .- --. { .... . .-.. .-.. --- _ .-- --- .-. .-.. -.. } ``` Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:30 - 10:35 摩斯電碼 ---- ## 國際手旗信號 ![](https://i.imgur.com/NeJjIqo.png =x480) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:35 - 10:40 國際手旗信號、國際信號旗 https://zh.wikipedia.org/zh-tw/%E6%97%97%E8%AA%9E ---- ## 國際信號旗 ![](https://i.imgur.com/Yw7GjMt.png =x480) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:35 - 10:40 國際手旗信號、國際信號旗 https://en.wikipedia.org/wiki/File:ICS-flags.png ---- ## 信號旗例題 ![](https://i.imgur.com/fvU6Mmh.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:40 - 10:45 信號旗例題 ---- ## 豬圈密碼 Pigpen cipher ![](https://i.imgur.com/O9OKIOL.png =x400) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:45 - 10:50 豬圈密碼、例題 https://en.wikipedia.org/wiki/Pigpen_cipher ---- ## 豬圈密碼變種 Templar cipher ![](https://i.imgur.com/L5QDrgU.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:45 - 10:50 豬圈密碼、例題 https://en.wikipedia.org/wiki/Pigpen_cipher ---- ## 豬圈密碼例題 ![](https://i.imgur.com/FpcClMn.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:45 - 10:50 豬圈密碼、例題 https://v2.cryptii.com/text/pigpen ---- ## 凱薩密碼 Caesar cipher ![](https://i.imgur.com/VspdLlA.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:50 - 10:55 Caesar https://en.wikipedia.org/wiki/File:Caesar_cipher_left_shift_of_3.svg ---- ## 凱薩密碼解法 Frequency Analysis ![](https://i.imgur.com/Zs8EVMH.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:50 - 10:55 Caesar https://commons.wikimedia.org/wiki/File:English_letter_frequency_percentages.png ---- ## 凱薩密碼例題 ![](https://i.imgur.com/vYMkDWl.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:50 - 10:55 Caesar ---- ## Ecoji 表符編碼 ![](https://i.imgur.com/HPmbrdp.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:55 - 11:00 Ecoji ---- ## Ecoji 例題(同上) ![](https://i.imgur.com/vYMkDWl.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 10:55 - 11:00 Ecoji ---- ## 編碼、加密、雜湊、壓縮、混淆 - Encode / Decode - Encrypt / Decrypt - Hash - Compress / Decompress - Obfuscate / Deobfuscate Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 ---- ## 編解碼、加解密 - Encode / Decode - Encrypt / Decrypt Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 base64 在下一部分 Misc 會講 摩斯電碼、信號旗、網址 Caesar、RSA MD5、SHA-256 ---- ## 判讀練習 中冰紅、大涼咖、雞堡蛋 ![](https://i.imgur.com/J4Fi7TT.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 大冰奶、餐廳簡寫 豫章高職 餐廳服務流程 http://www.ycvs.ntpc.edu.tw/ezfiles/0/1000/img/67/138635961.pdf ---- ## Hash 雜湊 - 可接受任意長度的輸入資料 - 輸出固定長度的雜湊值 Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 MD5、SHA-256 身分證字號 校驗碼 下午補充 ---- ## Compress / Decompress 壓縮 / 解壓縮 ![](https://i.imgur.com/YZUdhUS.png) Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 ---- ## Obfuscate / Deobfuscate 程式碼混淆 ![](https://i.imgur.com/R6ngNOe.png) Note: 寫爛 code https://zh.wikipedia.org/zh-tw/%E5%9B%BD%E9%99%85C%E8%AF%AD%E8%A8%80%E6%B7%B7%E4%B9%B1%E4%BB%A3%E7%A0%81%E5%A4%A7%E8%B5%9B Note: 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:00 - 11:15 編碼、加密、雜湊、壓縮、混淆 --- ## Misc 其他通靈題型 45 min Note: 11:15 - 12:00 Misc 其他通靈題型 11:15 - 11:25 Base64 11:25 - 11:35 corgi can fly 11:35 - 11:45 television 11:45 - 11:50 QR code 11:50 - 12:00 合照、放飯 ---- ## Base64 使用 `A-Z`, `a-z`, `0-9`, `+`, `/` 以及 `=` 編碼 ![](https://i.imgur.com/v6tmDzx.png) Note: 11:15 - 12:00 Misc 其他通靈題型 11:15 - 11:20 Base64 https://zh.wikipedia.org/zh-tw/Base64 ---- ## Base64 變種 - Base16 (Hexadecimal):`0-9`, `A-F` - Base32:`A-Z`, `2-7` - Base36:`0-9`, `A-Z` - Base58:Base64 少掉 `0O`, `Il`, `+/` Note: 11:15 - 12:00 Misc 其他通靈題型 11:15 - 11:20 Base64 skipped: ASCII85、uuencoding、xxencoding ---- ## Base64 例題 ```text S0pWWFFRU1NHT lpXV1dTVkpaCj RVMk1LU01aTkV LUVJRQkpJVgpN T0RZTUpXRFMyS 1JMQkhHWVMKTF pKWTRVR1paNUh VRkE9PT09Cg== ``` Note: 11:15 - 12:00 Misc 其他通靈題型 11:15 - 11:25 Base64 ---- ## corgi can fly 題目:[Hackme CTF #2](https://ctf.hackme.quest/scoreboard/) ![](https://ctf.hackme.quest/static/corgi-can-fly.png =x320) 工具:https://ctf.sean.cat/Stegsolve.jar Note: 11:15 - 12:00 Misc 其他通靈題型 11:25 - 11:35 corgi can fly ---- ## television 題目:[Hackme CTF #3](https://ctf.hackme.quest/scoreboard/) ![](https://ctf.hackme.quest/static/television.bmp =400x) Note: 11:15 - 12:00 Misc 其他通靈題型 11:35 - 11:45 television Git Bash 沒有 strings 可用 grep -a 代替 ---- ## QR code 原理 ![](https://i.imgur.com/BLVtTRY.gif) Note: 11:15 - 12:00 Misc 其他通靈題型 11:45 - 11:50 QR code 11:50 - 12:00 合照、放飯 https://blog.inndy.tw/2016/11/29/how-does-qrcode-works/ ---- ## QR code 修復 ![](https://i.imgur.com/Lbnvms2.jpg) Note: 11:15 - 12:00 Misc 其他通靈題型 11:45 - 11:50 QR code 11:50 - 12:00 合照、放飯 ---- # 用餐休息與交流 下午將於 13:00 開始 歡迎與身邊同學切磋交流 Note: 08:45 - 09:00 報到 09:00 - 09:15 開場 09:15 - 09:45 認識 Linux 環境 09:45 - 10:00 資安競賽概覽 10:00 - 10:30 Web 網頁安全 (Part 1) 10:30 - 11:15 Crypto 密碼學 (Part 1) 11:15 - 12:00 Misc 其他通靈題型 12:00 - 13:00 用餐休息與交流時間 13:00 - 13:45 Web 網頁安全 (Part 2) 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:15 - 15:00 Forensic 數位鑑識 15:00 - 15:30 Web 網頁安全 (Part 3) 15:30 - 15:45 總結、延伸學習資源 15:45 - 16:00 QA、自由練習 ---- ## 文章選讀 - [高中解出 LINE 漏洞的高敏睿,一畢業就有百萬年薪來找](https://www.cw.com.tw/article/5125549) - 天下雜誌,2023 年 4 月 - [資安公司監測 160 萬人,有 3% 員工上傳機敏資料到 ChatGPT](https://www.ithome.com.tw/news/156293) - iThome,2023 年 4 月 - [上傳影片聲紋,被駭客用 AI 語音複製來詐騙你媽](https://blog.trendmicro.com.tw/?p=77108) - 趨勢科技,2023 年 5 月 --- ## Web 網頁安全 (Part 2) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:00 - 13:05 Path Traversal 13:05 - 13:10 Grafana 13:10 - 13:20 Code review 13:20 - 13:25 URL encoding 13:25 - 13:30 Unicode、UTF-8 13:30 - 13:35 Code review 13:35 - 13:40 Apache 2.4.49 13:40 - 13:45 Apache 2.4.50 https://hackmd.io/@Sean64/SQLab-Web ---- ## Path Traversal 路徑遍歷 ![](https://i.imgur.com/ht7qtwg.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:00 - 13:05 Path Traversal https://medium.com/sean/path-238218d5115d ---- ## Grafana CVE-2021-43798 ![](https://i.imgur.com/uIvmsm6.png =x320) 💡 用 "`curl --path-as-is`" 保留 "`../`" 路徑 Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:05 - 13:10 Grafana Sean CTF 第七題 ---- ## 修復方式 ![](https://i.imgur.com/Fj9nrPC.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:10 - 13:20 Code review ---- ## 發生原因 用 `filepath.Join` 處理使用者輸入有風險 ![](https://i.imgur.com/Hh7WU42.png =x400) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:10 - 13:20 Code review ---- ## 關於 "`Rel`" 的用途 ```go func Rel(basepath, targpath) /* Join(basepath, Rel(basepath, targpath)) == targpath */ ``` 回傳「某個相對路徑」,這個相對路徑在以 `basepath` 為出發點時,會得到 `targetpath` 如果解不出答案,則回傳錯誤 Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:10 - 13:20 Code review ---- ## 再看一次修復方式 執行前先檢查是否為相對路徑 ![](https://i.imgur.com/Fj9nrPC.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:10 - 13:20 Code review ---- ## URL 編碼 URL Encoding Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:20 - 13:25 URL encoding ---- ## ASCII 編碼 American Standard Code for Information Interchange ![](https://i.imgur.com/5HuaF3Y.gif) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:25 - 13:30 Unicode、UTF-8 ---- ## Unicode 萬國碼 ![](https://i.imgur.com/Lle89AZ.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:25 - 13:30 Unicode、UTF-8 ---- ## UTF-8 Unicode Transformation Format - 8-bit ![](https://img.sean.taipei/2021/12/utf-8.jpg) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:25 - 13:30 Unicode、UTF-8 補充:Big5 排序 ---- ## Apache 2.4.49 CVE-2021-41773 ![](https://i.imgur.com/Gsipgl7.png =x400) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:30 - 13:35 Code review 第八題 ---- ## 修復方式 ![](https://i.imgur.com/3HgZkNi.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:30 - 13:35 Code review 第八題 ---- ## 似乎有點眼熟 嘗試使用 "`%2e`" 來繞過系統 ![](https://i.imgur.com/w5Dk8Hc.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:35 - 13:40 Apache 2.4.49 第八題 ---- ## Apache 2.4.50 <small>(嗯?)</small> CVE-2021-42013 ![](https://i.imgur.com/R1OpDHX.png =x400) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:40 - 13:45 Apache 2.4.50 第九題 ---- ## 發生原因 讓我們再看一次 Patch(補丁) ![](https://i.imgur.com/3HgZkNi.png) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:40 - 13:45 Apache 2.4.50 第九題 ---- ## 修復方式 確保 "`%`" 後面兩個字只能是 `0-9`、`a-f` 或 `A-F` ![](https://i.imgur.com/aPYhoQm.png =x400) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:40 - 13:45 Apache 2.4.50 第九題 ---- ## 嘗試再次攻擊 使用 "`%%32%65`" 進行 double encode(雙重編碼) ![](https://i.imgur.com/w5Dk8Hc.png =x400) Note: 13:00 - 13:45 Web 網頁安全 (Part 2) 13:40 - 13:45 Apache 2.4.50 第九題 --- ## Crypto 密碼學 (Part 2) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 13:45 - 13:55 RSA 13:55 - 14:00 ECC 14:00 - 14:10 Hash 14:10 - 14:15 quip qiup ---- ## RSA 原理 ![](https://i.imgur.com/LCU4RxW.png =x480) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 13:45 - 13:55 RSA key1 = (e, n), key2 = (d, n) m 明文, c 密文, n 模數 e 加密指數, d 解密指數 n = p q ϕ(n) = (p−1) (q−1) e 跟 ϕ(n) 互質 https://hackernoon.com/how-does-rsa-work-f44918df914b ---- ## RSA 例題 https://hackmd.io/@Koios/RSA ![](https://i.imgur.com/Zu51aml.png) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 13:45 - 13:55 RSA ---- ## Diffie-Hellman 金鑰交換 ![](https://i.imgur.com/Z9Sh18A.png =x480) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 13:55 - 14:00 ECC https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange ---- ## ECC 橢圓曲線 Elliptic-Curve Cryptography ![](https://i.imgur.com/1dpxC0y.png =x400) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 13:55 - 14:00 ECC https://fangpenlin.com/posts/2019/10/07/elliptic-curve-cryptography-explained/ ---- ## ECDH 金鑰交換 Elliptic-curve Diffie–Hellman ![](https://i.imgur.com/JGPJC4n.png =x400) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 13:55 - 14:00 ECC https://fangpenlin.com/posts/2019/10/07/elliptic-curve-cryptography-explained/ ---- ## Hash 雜湊 Avalanche Effect ![](https://i.imgur.com/SLuzgPk.png =x400) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:00 - 14:10 Hash https://en.wikipedia.org/wiki/Cryptographic_hash_function ---- ## Hash 雜湊 ![](https://i.imgur.com/lXIBkDA.png) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:00 - 14:10 Hash Stream Cipher https://en.wikipedia.org/wiki/Cryptographic_hash_function ---- ## Hash 例題 請破解以下密碼 | `username` | `md5_password` | |:----------:|:----------------------------------:| | `alice` | `cffbad68bb97a6c3f943538f119c992c` | | `bob` | `a2eda25e9bd2d4a4a1a182cb4d59c16a` | | `carol` | `bed128365216c019988915ed3add75fb` | Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:00 - 14:10 Hash ---- ## Hash 使用問題 ![](https://i.imgur.com/nsyTADU.png) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:00 - 14:10 Hash PHP hash_equals() https://news.ycombinator.com/item?id=9484757 ---- ## BCrypt ![](https://i.imgur.com/9pqojQb.png) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:00 - 14:10 Hash salt concept cost factor N = 2^N rounds recommended: 250 ms / 1000 ms https://asecuritysite.com/encryption/bcrypt ---- ## quip qiup https://quipqiup.com/ ![](https://i.imgur.com/JVkyUPg.png) Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:10 - 14:15 quip qiup https://quipqiup.com/ ---- ## quip qiup 例題 ```text hzsrnqc klyy wqc flo mflwf ol zqdn nsoznj wskn lj xzsrbjnf, wzsxz gqv zqhhnf ol ozn glco zlfnco hnlhrn; nsoznj jnrqosdnc lj fnqj kjsnfbc, wzsxz sc xnjoqsfrv gljn efeceqr. zn rsdnb qrlfn sf zsc zlecn sf cqdsrrn jlw, wzsoznj flfn hnfnojqonb. q csfyrn blgncosx cekksxnb ol cnjdn zsg. zn pjnqmkqconb qfb bsfnb qo ozn xrep, qo zlejc gqozngqosxqrrv ksanb, sf ozn cqgn jllg, qo ozn cqgn oqprn, fndnj oqmsfy zsc gnqrc wsoz loznj gngpnjc, gexz rncc pjsfysfy q yenco wsoz zsg; ``` Note: 13:45 - 14:15 Crypto 密碼學 (Part 2) 14:10 - 14:15 quip qiup Sean CTF Caesar --- ## Forensic 數位鑑識 Note: 14:15 - 15:00 Forensic 數位鑑識 14:15 - 14:20 stego-cat 14:20 - 14:30 PDF masking 14:30 - 14:35 PDF, JPG Metadata 14:35 - 14:40 EXIF 14:40 - 14:45 圖號座標 14:45 - 14:50 boarding pass 14:50 - 15:00 binwalk ---- ## Steganography 隱寫術 ![](https://ctf.sean.cat/assets/img/stego.png =x480) Note: 14:15 - 15:00 Forensic 數位鑑識 14:15 - 14:20 stego-cat Sean CTF 第六題 ---- ## 遮蔽敏感資訊 題目:[Google Slide](https://docs.google.com/presentation/d/18Y4-1Qh831pPY9p47KjKknJfzavKFki8IBIcjntNSJI/edit) ![](https://i.imgur.com/bbIZ3WD.png =x400) Note: 14:15 - 15:00 Forensic 數位鑑識 14:20 - 14:30 PDF masking Copy to my drive Download as PPTX Download as PDF ---- ## 圖片 EXIF 中繼資料 ![](https://i.imgur.com/fMZopMz.png =x480) Note: 14:15 - 15:00 Forensic 數位鑑識 14:30 - 14:35 PDF, JPG Metadata ---- ## PDF 中繼資料 ![](https://i.imgur.com/P8IdH1X.png =x480) Note: 14:15 - 15:00 Forensic 數位鑑識 14:30 - 14:35 PDF, JPG Metadata ---- ## EXIF 地理資訊 ![](https://i.imgur.com/oh1POgq.png =x480) Note: 14:15 - 15:00 Forensic 數位鑑識 14:35 - 14:40 EXIF https://www.intego.com/mac-security-blog/how-to-remove-gps-location-data-from-photos-on-iphone-or-mac/ ---- ## EXIF 地理資訊例題 ![](https://ctf.sean.cat/assets/img/stego.png =x480) Note: 14:15 - 15:00 Forensic 數位鑑識 14:35 - 14:40 EXIF Sean CTF 第六題 ---- ## 台電圖號座標 ![](https://i.imgur.com/AA1jrRt.png =x400) Note: 14:15 - 15:00 Forensic 數位鑑識 14:40 - 14:45 圖號座標 https://www.facebook.com/TaiwanPowerCompany/photos/a.430823640061/10158061544395062/ ---- ## 台電圖號座標 ![](https://i.imgur.com/f971OES.png) ![](https://i.imgur.com/EHcURIu.png) Note: 14:15 - 15:00 Forensic 數位鑑識 14:40 - 14:45 圖號座標 https://blog.xuite.net/lw8930/twblog1/123375601 ---- ## 圖號座標例題 ![](https://i.imgur.com/LmMDhRc.jpg) Note: 14:15 - 15:00 Forensic 數位鑑識 14:40 - 14:45 圖號座標 http://www.cityyeast.com/passion3_show.php?passion3type_id2=108&passion3_id=1559 ---- ## 登機證條碼 ![](https://i.imgur.com/4KVs4kU.jpg) Note: 14:15 - 15:00 Forensic 數位鑑識 14:45 - 14:50 boarding pass https://krebsonsecurity.com/2015/10/whats-in-a-boarding-pass-barcode-a-lot/ ---- ## 登機證條碼 ![](https://i.imgur.com/FfWP0tn.png) Note: 14:15 - 15:00 Forensic 數位鑑識 14:45 - 14:50 boarding pass https://krebsonsecurity.com/2015/10/whats-in-a-boarding-pass-barcode-a-lot/ ---- ## binwalk 題目:[CTF Learn #108](https://ctflearn.com/challenge/108) ![](https://i.imgur.com/Rk22Ubu.png) 圖片:https://ctf.sean.cat/binwalk.jpg 工具:https://ctf.sean.cat/binwalk.zip Note: 14:15 - 15:00 Forensic 數位鑑識 14:50 - 15:00 binwalk --- ## Web 網頁安全 (Part 3) Note: 15:00 - 15:30 Web 網頁安全 (Part 3) 15:00 - 15:15 XSS + JS 教學 15:15 - 15:20 BAC - 2 15:20 - 15:30 picoCTF 練習 ---- ## XSS Cross-Site Scripting ![](https://ctf.sean.cat/assets/img/xss.png =x400) Note: 15:00 - 15:30 Web 網頁安全 (Part 3) 15:00 - 15:15 XSS + JS 教學 Sean CTF 第四題 ---- ## Login ![](https://i.imgur.com/p3tm4tU.png) 題目:[picoCTF login](https://login.mars.picoctf.net) Note: 15:00 - 15:30 Web 網頁安全 (Part 3) 15:15 - 15:20 BAC - 2 ---- ## picoCTF 練習 Note: 15:00 - 15:30 Web 網頁安全 (Part 3) 15:15 - 15:30 Buffer --- # 總結 延伸學習資源 Note: 15:30 - 15:45 總結、延伸學習資源 15:30 - 15:35 CTF 練習平台 15:35 - 15:40 延伸閱讀 15:40 - 15:45 AIS3 影片 ---- ## PicoCTF ![](https://i.imgur.com/AyUjnux.png =x400) 解題網址:https://play.picoctf.org/ Note: 15:30 - 15:45 總結、延伸學習資源 15:30 - 15:35 CTF 練習平台 ---- ## Hackme CTF ![](https://i.imgur.com/fpbUGG2.png =x400) 解題網址:https://ctf.hackme.quest/ Note: 15:30 - 15:45 總結、延伸學習資源 15:30 - 15:35 CTF 練習平台 ---- ## CTFtime ![](https://i.imgur.com/9KRuatP.png =x400) 網址:https://ctftime.org/ Note: 15:30 - 15:45 總結、延伸學習資源 15:30 - 15:35 CTF 練習平台 ---- ## 延伸閱讀 - [CTF 的三十道陰影](https://ithelp.ithome.com.tw/users/20121059/ironman/2810) - dada, iThome 鐵人賽 - [關於 CTF 的那些事](https://sitcon.org/2021/agenda/7a88857e-7d50-4d9c-a656-2d99feef6198) - LYS, SITCON 2022 - [Got Your PW](https://gotyour.pw/resources.html) - 專供資安人的資源與工具整理 - [網路劫持](https://hackmd.io/@Sean64/bgp-hijack-2022) - BGP 路由安全 Note: 15:30 - 15:45 總結、延伸學習資源 15:35 - 15:40 延伸閱讀 ---- ## AIS3 新型態資安暑期課程 {%youtube nHOyRa7zPZE %} 報名網址:https://ais3.org/ Note: 15:30 - 15:45 總結、延伸學習資源 15:40 - 15:45 AIS3 影片 今年報名 4/26 已截止 ---- # Q&A 自由練習、歡迎提問 <br> 投影片連結:https://hackmd.io/@Sean64/sec-cpshs2023 <!-- .element: class="r-fit-text" --> <br> [![CC-BY 4.0](https://hackmd.io/_uploads/BJQQqUVNC.png)](https://creativecommons.org/licenses/by/4.0/deed.zh_TW) ###### 這份投影片以 [創用 CC - 姓名標示](https://creativecommons.org/licenses/by/4.0/deed.zh_TW) 授權公眾使用,原始碼及講稿請見 [此連結](https://hackmd.io/@Sean64/sec-cpshs2023/edit)。 Note: 15:45 - 16:00 QA、自由練習

    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