Upload
cavedu-education
View
186
Download
0
Embed Size (px)
Citation preview
李倫銓 , Mediatek
絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
2
• HITCON 協會發言人• HITCON CTF 領隊與競賽負責人• 交大資工所,台大電機所博士候選人,目前任職 聯發科技 • 專長:網路安全相關技術、惡意程式與流量分析、雲端服務規劃與研究。
李倫銓
OUTLINE1. 絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
• HITCON CTF 2015 決賽應用2. 絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
• Mediatek Linkit 7688 firmware 解除封印 AP mode+ station mode3. 絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
• 7688 + OpenWRT + Snort 打造駭客入侵偵測器4. 絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
• MCS 雲端平台 + IFTTT 擴增應用
HITCON CTF 2015 決賽應用絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
• 你知道這 13 把光劍是幾時做好的嗎 ?
此時大概是週六凌晨 2 點,距比賽時間還有 7 小時只有一堆光劍的零件
家庭代工
CTF 是甚麼?全名 Captuare The Flag
又稱搶旗賽
CTF 的型式1 2
Jeopardy AttackDefence
Attack & Defence每回合5min
A
攻擊成功 得分 +10 扣分 -10
B
Attack & Defence 攻擊流程1
每個隊伍獲得一個有漏洞服務的主機
2 3 4
分析主機上的漏洞找到漏洞利用的方式 將漏洞寫成攻擊程序並攻擊其他隊伍透過攻擊獲取主機上的 Flag將 Flag 提交給大會
得分 💀
Service 💀
Service
💀Service
A
0day 漏洞B C D E
😆
無法防禦無法防禦無法防禦無法防禦
😣
😣
😣
😣 得分 +40
扣分 -10
攻擊成功 扣分 -10
扣分 -10
2. 被打
1. 打人
DEFCON CTF final 2015
用光劍搭配這次星球大戰風格
+
好吃又好玩
CTF + Star Wars• 燈控光劍效果
目標隊伍遭受攻擊時,伸出光劍劍刃並發出音效
打人時伸出光劍劍刃並發出音效• 當得分隊伍 submit flag ,計分系統會立刻透過
socket 傳訊號給”被得分隊伍”桌上的光劍底座(Linkit Smart 7688 )
• 光劍底座跑一支 server.py ,接收計分系統來的控制訊號
光劍主體• 使用台灣最知名的馬可多版光劍• 劍刃共有六段伸縮節• 劍把,馬可多手工打造電路板• + 電池 + 喇叭
光劍底座
底座壓克力雷切、 Linkit 7688 開發板、喇叭
22
– 1T1R 802.11n Wi-Fi radio– 580MHz MIPS® 24KEcTM CPU– USB2.0 host, SD-XC, I2S / PCM,
I2C, PWM, UART, GPIO, SPI, SPI-slave
– Also featured 5-port router, eMMC, PCIe support
Chipset informationMT7688AN
MEDIATEK
MT7688AN
23
Specification
– MT7688– 128MB DDR2– 32MB Flash– Chip Antenna
(default)– IPEX Ext Antenna – microSD– USB Host– JTAG
劍座接頭 D-sub接上去,就可以放簡報了
設計理念當劍在劍座上,由 7688 控制當劍在手上,由絕地武士控制
• 共地 • 電晶體放大電流
跑 OPENWRT
步驟•uci set network.lan.ipaddr= xxx• 拷貝光劍音效•Madplay –S• 關閉 dhcp• 關閉 wireless •opkg install /root/openssh-sftp-server_6.8p1-1_ramips_24kec.ipk
透過 MRAA 來控制 GPIO
import mraa
print (mraa.getVersion())
x = mraa.Gpio(13)
x.dir(mraa.DIR_OUT)
x.write(1)
• 剛剛的 D1~D6 分別接到 GPIO 14-19
製作過程已經放上 Hackday.io• Lightsaber Stand for Hackers - Making a Star Wars
themed lightsaber scoreboard for 2015 HITCON CTF
等等 !? 你剛剛不是說, 7688 是拿wifi 晶片做的開發版嗎 ?
那如果我想要把光劍底座當成家中的 wifi router 可以嗎 ?
MEDIATEK LINKIT 7688 FIRMWARE原廠解除封印 AP MODE+ STATION MODE絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
官方原廠GUI
Linkit 7688
AP+ Station= Repeater mode
連上 AP
當 AP
上 internet
放在家當中繼器還可以拿來玩
7688 + OPENWRT + SNORT 打造駭客入侵偵測器絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
Snort• Snort is a multi-mode packet analysis tool
– Sniffer– Packet Logger– Forensic Data Analysis tool– Network Intrusion Detection System
Snort on 7688 openwrt• #opkg update• #opkg install snort• 設定 local.rules
– alert icmp any any -> any any (msg:"ICMP test"; sid:10000001; rev:001;)
• #snort -i apcli0 -c /etc/snort/snort.conf -c local.rules --daq-dir /usr/lib/daq -l ./
• 用另外一隻 python 程式透過讀取 alert ,用MRAA 來控制 GPIO
7688 + OpenWRT + Snort 打造駭客入侵偵測器DEMO
• A#snort -i apcli0 -c /etc/snort/snort.conf -c local.rules --daq-dir /usr/lib/daq -l ./
• B# ./alert.py• C# ping www.hinet.net -c 1
MCS 雲端平台 + IFTTT 絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座
45
A cloud based data service platform for Internet of Things devices.
MediaTek Cloud Sandbox (MCS)
MCS – Creating an end-to-end development support for makers
46
Push data points into clouds
Retrieve data generated from device
Send notificationfor specific event
Remote switching and control
47
Maker
Maker to Maker
Maker to Market
Quickly prototype
MCS – Creating an end-to-end development support for makers
Share device
Device managementTest devicePrototype
Test devicePrototype
Prototype
Beta release device
MCS Service
48
Development Progress
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Multi LanguageForum
System MonitorAPI DocumentTutorial
MCS Service Architecture
Common Services
Trigger & action
Remote Control
Data Storage
Data Visualization
Beta Release
Device Registration
Device Status & Usage Report
Prototyping
Firmware Update
HTTP / HTTPS Restful API TCP Socket
Protocol
MCS Console MCS App
Developing Tool Support
API reference
API hint
Tutorial
FAQ
Forum
Data Channel Design
Test Device Management
User Privilege Integration Service
Oauth
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Visualization Data Channels
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support
Device managementTest devicePrototype
• Data Channel• Trigger & Action• User Privileges
• API Hint• Data Visualization• Remote Control• Notification
• FOTA• Device Activation
Support(Preview)
58
Support
Multi LanguageForum
System MonitorAPI DocumentTutorial
简中 繁中 En
Multi Language support
MCS 目前可由 IFTTT maker channel 來控制了
DEMO1 MCS+IFTTT
潛在的 IOT 安全問題
• 智慧型手機• 燈泡• IP camera• 車子• 路由器• 工業 SCADA
….
克萊斯勒的 Uconnect 的車載資訊娛樂系統( In-Vehicle Infotainment, IVI ),提供娛樂、手機、導航、語音命令與控制功能,還有一 Uconnect Access Via Mobile 服務允許駕駛利用手機的數據服務存取支援 Uconnect 的行動程式。
不過, Marc Rogers 和 Kevin Mahaffey 找到 Tesla S 的漏洞並證實可以入侵後, Tesla 則發揮電動車的優勢,他們不需要像其他傳統車廠,例如克萊斯勒一樣,必須召回受駭車輛回廠維修,而這也是發現 Tesla 漏洞的資安專家認為,電動車不同於其他款汽車最大的優勢。他們認為,當 Tesla 在發現電動車上的軟體、系統有任何漏洞後,都可以在完成漏洞程式撰寫後,直接透過 Over The Air(OTA)的方式,更新電動車的軟體,大幅提高電動車更新軟體的速度與安全性。
Binwalk wiki
FILESYSTEM• -e option 自動提 fs• git clone https://github.com/mirror/firmware-mod-kit• 編譯 squashfs-2.1-r2: make -C src/squashfs-2.1-r2
• 使用 unsquashfs_all.sh 腳本解壓縮得到 rootfs
執行 strings rootfs/bin/webs
MASS SURVEILLANCERemote access to sensor data
暗黑版 GOOGLE - SHODAN
Webcam
Bitcoin server
知道的送獎品
https://intel.malwaretech.com/mirai.html
intel security 顯示世界上的 vulnerable device , (mirai 感染 )
駭客掃描的好工具 - NMAP• nmap -iL hostlist.txt• Nmap –O : fingerprint OS• Nmap –sV : 各服務版本• Nmap –p T:80 指定 TCP 連接埠 , -p
U:53(UDP 53)
https://github.com/jgamblin/Mirai-Source-Code/blob/master/mirai/bot/scanner.c MIRAI 原始碼
The countries with the highest number of vulnerable devices are Vietnam (80,000), Brazil (62,000), Turkey (40,000), Taiwan (29,000), China (22,000), South Korea (21,000), Thailand (16,000), India (15,000) and the United Kingdom (14,000).
THE OWASP INTERNET OF THINGS (IOT) TOP 10
I1: 不安全的網頁介面 (Insecure Web Interface)I2: 不充分的認證與授權 (Insufficient Authentication/Authorization)I3. 不安全的網路服務 (Insecure Network Services)I4. 欠缺傳輸時的加密保護 (Lack of Transport Encryption)I5. 隱私威脅 (Privacy Concerns)I6. 不安全的雲端介面 (Insecure Cloud Interface)I7. 不安全的行動介面 (Insecure Mobile Interface)I8. 不充分的安全設定 (Insufficient Security Configurability)I9. 不安全的軟體與韌體 (Insecure Software/Firmware)I10. 實體安全考量不足 (Poor Physical Security)
MCS MQTT
MQTTMessage Queue Telemetry Transport
• 基於 Publish-subscribe 進行資料傳遞• 透過 Broker
• 支援推播 (Push)
• 可一對多 (one-to-many)
• 資料傳輸小、類似 REST架構• 預設通訊埠 1883/8883(TLS)
Publisher 可以是 sensor 或是推播程式,訂閱者可以是個伺服器上的應用服務也可以是個手機
Topics 類似 rest case-sensitive
Single Level: + Multi Level: #
BrokerRetained Message & Offline Message
The MCS MQTT Broker also supports Retained message and Offline message as the MQTT standard defined.
Retained message: This message will be sent everytime a client is subscribe to the topic. For example, a welcome message.
Offline message: This message will be keep in the broker if the client is offline, and sent to the client when it goes online.
DEMO