# 架設tpot 手記 安裝T-pot可依據個人需求進行,一種是分散式,一種是單機版。 下列方式為分散式安裝步驟: 1. 下載輕量化的debian安裝檔。 1.1 安裝步驟依個人喜好進行安裝。(網路上一堆debian安裝步驟,請自行google一下囉) Download Debian Netinstall Image > amd64版本 http://ftp.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/mini.iso 2. 安裝完debian後,下達下列指令,進行t-pot安裝。 git clone https://github.com/telekom-security/tpotce cd tpotce/iso/installer/ ./install.sh --type=user 2.1 若安裝完後,發現git指令未安裝,請執行sudo apt install git-all 3. 開始進行t-pot安裝,因為我們要架設分散式架構,要先準備兩台主機;並請先其中一台選擇安裝HIVE角色。 (HIVE角色主要安裝Elastic stack and T-Pot tools) ![](https://i.imgur.com/6pGTb53.png) https://github.com/telekom-security/tpotce#distributed-deployment 4. 安裝另一台debian & 安裝HIVE-Sensor角色。(HIVE-sensor角色主要是各式hoenypot角色) 5. 兩台主機安裝完後,可於兩台主機執行dps.sh來確認服務是啟動沒問題。 ![](https://i.imgur.com/do7lT9X.png) 6. 將安裝之帳號(ex. james), 加入sudo群組。(非常重要!!) sudo adduser james(account) sudo 7. 於HIVE(tpot02)主機(此例192.168.254.110),輸入 su - deploy.sh 輸入指令後,將依據步驟進行設定。但IP要指向HIVE主機(此例 192.168.254.120)。 待sensor與HIVE主機建立連線後,系統畫面會要求reboot重開,重開後就完成設定。 ![](https://i.imgur.com/0QE55ki.png) 8. Sensor重開過程中,可以登入至HIVE,輸入 cat /etc/group >> 看到tpotlogs & tpot02(電腦名稱)建立。 ![](https://i.imgur.com/YqpBMay.png) cat /etc/passwd >> 看到tpot02 帳號被建立,且無法透過shell登入。 ![](https://i.imgur.com/RdRrxHJ.png) 9. 若想測試sensor是否真的有傳送資料至HIVE,參考官方文件說明 找尋測試honeypot(此例- CitrixHoneypot) ![](https://i.imgur.com/ZZ6LLDt.png) 10. 依據citrixhoneypot登入頁面測試- 測試不斷輸入帳密...並按下[Log on]... ![](https://i.imgur.com/VmAf7Uf.png) 11. 過一段時間,開啟T-pot dashboard,選擇[CitrixHoneypot]。 ![](https://i.imgur.com/f9Y79Oq.png) 12. 開啟Citrixhoneypot deshboard後,畫面拉到下方可以看到Source IP (此例:192.168.254.118),經比對確認是模擬的攻擊主機。 ![](https://i.imgur.com/PVt9TEM.png) 13. YES, 架設T-POT 分散式(HIVE & HIVE sensor)架構完成。 14. 提醒,若真要應用於正式環境,須謹慎評估及確認T-pot的安全設定與擺放的位置與預期目標。 下列方式是安裝T-Pot standalone方式 (這部份實作&測試是OK的,但資源要很兇..記憶體10G以上才順): **1. 選擇STANDARD (standalone)安裝** 1.1 設定固定IP 1.1.1 如何找VM實體網卡名稱-參照https://github.com/telekom-security/tpotce/issues/325 1.2 安裝完後若遇到[Raise network interfaces]錯誤訊息,請參照https://ithelp.ithome.com.tw/articles/10296777進行設定。 1.3 安裝完tpot後,kibana 頁面無法正常顯示(error message- 502) 1.3.1 目前發現可能很大原因是需要讓docker下載與建立完成,可嘗試讓他擺放並運作一段時間,看是否kibana服務會自動起來並運作穩定。 https://github.com/telekom-security/tpotce/issues/205 ***2 預設保存於kibana的log是放置30天。*** 2.1.1 若需要修改保存更久時間,請先修改logrotate.conf檔,路徑如下:/opt/tpot/etc/logrotate/logrotate.conf. 2.1.2 若要清除Log資料,請執行clean.sh ***3 故障排除:*** 3.1 檢查您的容器是否正常運行:dps.sh 3.2 查看你的系統資源是否耗盡:htop,glances ******