SlideShare uma empresa Scribd logo
1 de 67
Baixar para ler offline
About Us
• Li Yuxiang @Xbalien29
Security researcher, found several vulnerabilities in Android, Former ROIS CTF
team member, speaker of HITB 2018 AMS.
• Qian Wenxiang @leonwxqian
Security Researcher, Top 100 of MSRC list ( 2016 & 2017 ), Author of
"WhiteHat to talk about web browser security ".
• Wu Huiyu @DroidSec_cn
Security Researcher, Bug Hunter, GeekPwn 2015 Winner, Speaker of HITB
2018 AMS and POC 2017.
Acknowledgement
@Gmxp, Team Leader of Tencent Blade Team.
@Lake2, Founder of Tencent Security Response Center.
Tencent Blade Team
• Founded By Tencent Security Platform Department.
• Focus on security research of AI, IoT, Mobile devices.
• Found 70+ security vulnerabilities (Google, Apple).
• Contact us: https://blade.tencent.com
Agenda
• Introduction to Smart Speaker
• Attack Surface
• Remote Attack Xiaomi AI speaker
• Breaking Amazon Echo
• Conclusion
Introduction to Smart Speaker
About Amazon Echo
About Xiaomi AI Speaker
Attack Surface
Smart Speaker Mobile App
Cloud Server
Communication Protocol
Remote Attack Xiaomi AI Speaker
• A Brief Look At Xiaomi AI Speaker
• MIIO Ubus Command Execution
• Messageagent Command Execution
• Remote Exploit
• Demo
A Brief Look At Xiaomi AI Speaker
• Base on OpenWrt 15.05.1
• SSH Disabled
• Firmware Verification based on RSA
• Ports:
– UDP 54321 MIIO
– TCP 9999 UPNP
– UDP 53 DNS
MIIO Protocol
MIIO Ubus Command Execution
• Get MIIO protocol AES secret key (token)
- Use a unauthorized unbind vulnerability to remote reset MI AI speaker
- Bind MI AI Speaker to attacker’s account, extract token from MI Home
App’s database (/data/data/com.xiaomi.smarthome/databases/miio2.db)
MIIO Ubus Command Execution
• Disable dropbear password auth
• Start dropbear to open ssh
• Connect Speaker in LAN
MIIO Ubus Command Execution
Messageagent
Messageagent Command Execution
• Parser and execute ubus command
• Parser and execute system command
Remote Exploit
Demo
Breaking Amazon Echo
• A Brief Look At Amazon Echo
• Soldering & Desoldering Tools
• Flash Dump
• Root Amazon Echo by Modify Firmware
• Exploit Amazon Echo
• Demo
A Brief Look At Amazon Echo
MTK 8163 CPU
Mircon / Samsung
4GB EMCP BGA221
• Fire OS v5.5
(Based On Android 5.1)
• SELinux & ASLR enabled
• Bootloader Locked
• Ports:
TCP 55442 HTTP Server
TCP 55443 HTTPS Server
UDP 55444 Time Sync
UDP 55445 Device Sync
Soldering & Desoldering Tools
Amtech Tacky FluxSolder Wick
Hot Air Gun Soldering Iron Solder Wire Solder Paste
Reballing Tool
Desoldering Demo
Flash Dump
BGA211 EMCP Adapter + EMCP USB Reader
Flash Dump
Preloader
Bootloader
……….
Boot image
/system
/data
/sdcard
Root Amazon Echo by Modify Firmware
Modify /system/etc/init.fosflags.sh
Soldering Demo
Root Amazon Echo by Modify Firmware
Exploiting Amazon Echo:
On Basis of Software
3 Steps to Eavesdropping the Target
3 Big Problems Need to Be Solved
Vulnerable
Program
21 3
An Attacker is Always Happy to See
There’s a Web Server Available
Whole Home Audio Daemon (whad)
✓ root
✓ Able to record voice
✓ Network access
✓ Web server
Protocol Port Purpose
TCP 55442 HTTP Server (audio cache)
TCP 55443 HTTPS Server w/authentication (device control)
UDP 55444 Time Sync.
UDP 55445 Device Sync.
Client-authenticated TLS Handshake
• We need Server Certificate, Client Certificate and Private Key.
• Get them from libcurl’s negotiate function.
• Solution: Extract information from physically hacked device.
This one!
Bind the Hacked Device into Victim’s
Account First
Web Service Auditing
• XSSes we’ve found are hard to use, but it is fatal.
• Session based, some actions need re-login.
• Lack of modern protections.
Use Several Redirects to Mimic an XSS
• Alexa OpenID login redirect to any domain fits
https://*.amazon.com .
• assoc-redirect.amazon.com will redirect to an Amazon site
amazon.cn, amazon.co.uk …
• Validate rule: http(s)://*.amazon.com*.*/ (We guess).
• We need a downgrade: http://subdomain.amazon.com .
Restrictions
• Find an Amazon domain resolves to LAN address.
• Attacker can be joined into the LAN with that IP address.
Steal Cookies with the Redirect
• aapsservice.amazon.com, A Record(DNS A) resolves to a local
address 10.189.XX.XX.
• Attacker joins the LAN with IP statically set to 10.189.XX.XX,
and web server enabled.
aapsservice resolves to attacker in that LAN.
2 Big Problems Need to Be Solved
Vulnerable
Program
2 3
• When user login, we can get the cookies.
• Bind our device.
• We can communicate with other devices of victim.
DEAL WITH IT
Extract Certificates and Private Keys
From libcurl’s Negotiate Function
The Cloud Synchronize of Device Info
Device info obtained from Amazon when whad starts.
Patching Whad
• Whad HTTPS “ping” other devices periodically.
• Patch whad (of physically rooted device).
• Dump the certs and private keys we need!
• Benefit: No need to crack the complex algorithm.
• Simple and violent, but it works.
Get the Keys to Pwn
• Disable ASLR, SELinux of physically hacked device
• Dump Server Certificate, Client Certificate from the variant
which outputs adb log.
• Dump Private Key from negotiate function too, with a call to
PEM_write_PrivateKey() .
1 Big Problem Needs to Be Solved
Vulnerable
Program
3
• Every time before we would attack, we run patched whad
to get the certs & key.
• “Firewall” of client authentication is broken.
DEAL WITH IT DEAL WITH IT
Binary Auditing
• Amazon’s own code is secured by design.
• Echo’s using very old version of the 3rd party libraries.
• N days & 0 day.
Attack the Web Server, to Finally Get
Control of Whad
The Web Server -- libcivetweb
• The code is written 4 years ago.
• A failed condition check caused almost every type of
vulnerabilities in sequence in getParam().
• Nobody calls the vulnerable function until an update…
A Bad Move Leads to Chain Reaction
bool
CivetServer::getParam(struct mg_connection *conn,
const char *name,
std::string &dst,
size_t occurrence)
{
……
……
}
CVE-2018-12686
Fixed in June, 2018
Overflow the dlmalloc(0)
• dlmalloc(0) is valid.
16 bytes (8B metadata + 8B user data)
• mg_read() fix the input length ( uint -1 ):
int write_size = min(0xfffffff, actual length);
• POST data written into buffer.
• length of input > 8 bytes Heap buffer overflow
Shape the heap
• Shape the heap by sending HTTPS request.
• malloc() controlled by user.
• Sending or omitting rnrn to control the connection.
Bypass ASLR to Continue Our Attack
Heap spray
• Large heap allocation mmaped anonymous memory.
• Memory lays in a predictable range (even ASLR is enabled).
• In our case, which is 0xf15f1008 (empirical value).
• Heap spray and put our shellcode into this address.
Leak Addresses of Other Libraries
• Information leak via network?
• CVE-2017-1000254 of libcurl in FTP connection is exploitable.
• To reproduce the vulnerability
we need a FTP connection reuse.
Echo disabled many dangerous libcurl functions
Trigger the Hidden Code Path
• Playlist download Connection reuse!
• Accept only HTTP/HTTPS 302 Redirect to FTP.
• FTP 404 Prevent from caching.
• Command downloadAudio with extension .pls,
libcurl visits FTP server twice Address leaked!
Leaking the Address
• Payload length = 103 leak an function address by luck (~80%).
• Calculate libcurl’s base loading address.
• Calculate other libraries’ addresses based on leaked address.
Code Execution
• Overwrite the function pointer in SSL context object
• Webserver responding SSL_write
• Fastest way to trigger: malformed HTTP version header.
• Not safe if you compile this code on Windows, did you see
that? ☺
Attacking Primitives
• Restart the whad
• Information leak
• Heap maintaining
• Heap freeing
• Fast SSL_write call
• Create any size of heap
• Use different types of connection to obtain ideal heap layout.
• Combine them to get an RCE.
Time to PWN
Entrust The Hack to Time
• Challenge: disturb from background threads.
• ~40% for a testing gadget (4 Bytes)
• Real life gadget is 24 bytes, success rate down to ~8%.
• But whad is respawned after crash automatically.
• The only thing we need is time ☺ (avg. 30 min per success).
The Shellcode
• Almost same system version on every Echo device
->We don’t need to adapt for many versions
• fork() to prevent crash
• Handlers for SIGSEGV/SIGABRT
• Send the data via TCP to attacker
Deal with It
whad
• Whad is now turning into a eavesdropping program.
• It’s eavesdropping silently and it’s sending every voice
data to the attacker.
DEAL WITH IT
Demo Video
Updates
• Reported to Xiaomi in April, fixed in May, received $25,000
USD bonus.
“Thanks to the Tencent Blade Team for the support of Xiaomi's product
safety. All reported vulnerabilities have been fixed to ensure maximum
user security.”
• Reported to Amazon in May, fixed in July.
“Amazon would like to thank the Tencent Blade Team for working with us
on resolving this issue. Customer trust is important to us and we take
security seriously. Customers do not need to take any action as their
devices have been automatically updated with security fixes.”
Conclusion
• Exploit Source Code:
– We will update full exploit code to Github in the future:
https://github.com/tencentbladeteam
• Hack tips:
– Get the firmware first.
– It’s good to master all kinds of soldering and firmware extraction
methods.
– Web Vulnerabilities + Binary Vulnerabilities Remote Exploit.
– Be patient.
Thank You
https://blade.tencent.com
Contact us
https://security.tencent.com
Our Bug Bounty Program
Q & A
https://blade.tencent.com
Contact us
https://security.tencent.com
Our Bug Bounty Program
Reference
https://en.wikipedia.org/wiki/Transport_Layer_Security#Client-
authenticated_TLS_handshake
https://github.com/civetweb/civetweb
http://www.openwall.com/lists/oss-security/2018/02/27/5
https://github.com/aholstenson/miio
https://twitter.com/fjeronimo/status/975781623127068674
https://github.com/jhautry/echo-dot

Mais conteúdo relacionado

Mais procurados

Shmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSHShmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSH
Andrew Morris
 
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CanSecWest
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
Positive Hack Days
 
BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat Security Conference
 

Mais procurados (20)

Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0
 
Shmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSHShmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSH
 
Improvement in Rogue Access Points - SensePost Defcon 22
Improvement in Rogue Access Points - SensePost Defcon 22Improvement in Rogue Access Points - SensePost Defcon 22
Improvement in Rogue Access Points - SensePost Defcon 22
 
CSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on androidCSW2017 Geshev+Miller logic bug hunting in chrome on android
CSW2017 Geshev+Miller logic bug hunting in chrome on android
 
Huiming Liu-'resident evil' of smart phones--wombie attack
Huiming Liu-'resident evil' of smart phones--wombie attackHuiming Liu-'resident evil' of smart phones--wombie attack
Huiming Liu-'resident evil' of smart phones--wombie attack
 
Socially Acceptable Methods to Walk in the Front Door
Socially Acceptable Methods to Walk in the Front DoorSocially Acceptable Methods to Walk in the Front Door
Socially Acceptable Methods to Walk in the Front Door
 
Nick Stephens-how does someone unlock your phone with nose
Nick Stephens-how does someone unlock your phone with noseNick Stephens-how does someone unlock your phone with nose
Nick Stephens-how does someone unlock your phone with nose
 
Threat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my HoneypotsThreat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my Honeypots
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
OFFENSIVE: Exploiting DNS servers changes BlackHat Asia 2014
OFFENSIVE: Exploiting DNS servers changes BlackHat Asia 2014OFFENSIVE: Exploiting DNS servers changes BlackHat Asia 2014
OFFENSIVE: Exploiting DNS servers changes BlackHat Asia 2014
 
Ntxissacsc5 red 1 & 2 basic hacking tools ncc group
Ntxissacsc5 red 1 & 2   basic hacking tools ncc groupNtxissacsc5 red 1 & 2   basic hacking tools ncc group
Ntxissacsc5 red 1 & 2 basic hacking tools ncc group
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
Sticky Keys to the Kingdom
Sticky Keys to the KingdomSticky Keys to the Kingdom
Sticky Keys to the Kingdom
 
The state of wireless security
The state of wireless security The state of wireless security
The state of wireless security
 
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteliDefcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
Zhiyun Qian-what leaves attacker hijacking USA Today site
Zhiyun Qian-what leaves attacker hijacking USA Today siteZhiyun Qian-what leaves attacker hijacking USA Today site
Zhiyun Qian-what leaves attacker hijacking USA Today site
 
BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...
 
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, ...
 
CNIT 128 3. Attacking iOS Applications (Part 1)
CNIT 128 3. Attacking iOS Applications (Part 1)CNIT 128 3. Attacking iOS Applications (Part 1)
CNIT 128 3. Attacking iOS Applications (Part 1)
 

Semelhante a Breaking Smart Speakers: We are Listening to You.

[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...
[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...
[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...
CODE BLUE
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...
Black Duck by Synopsys
 

Semelhante a Breaking Smart Speakers: We are Listening to You. (20)

Workshop on Network Security
Workshop on Network SecurityWorkshop on Network Security
Workshop on Network Security
 
DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...
DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...
DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploi...
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
Making and breaking security in embedded devices
Making and breaking security in embedded devicesMaking and breaking security in embedded devices
Making and breaking security in embedded devices
 
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
The Internet of Fails - Mark Stanislav, Senior Security Consultant, Rapid7
 
Fundamentals of network hacking
Fundamentals of network hackingFundamentals of network hacking
Fundamentals of network hacking
 
BlackHat Hacking - Hacking VoIP.
BlackHat Hacking - Hacking VoIP.BlackHat Hacking - Hacking VoIP.
BlackHat Hacking - Hacking VoIP.
 
Shameful secrets of proprietary network protocols
Shameful secrets of proprietary network protocolsShameful secrets of proprietary network protocols
Shameful secrets of proprietary network protocols
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
 
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
Beginner’s Guide on How to Start Exploring IoT Security 1st SessionBeginner’s Guide on How to Start Exploring IoT Security 1st Session
Beginner’s Guide on How to Start Exploring IoT Security 1st Session
 
[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...
[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...
[CB19] I KNOW WHAT YOU DID LAST NIGHT : Pwning The State-Of-The-Art the IoT H...
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...
 
Programming for the Internet of Things
Programming for the Internet of ThingsProgramming for the Internet of Things
Programming for the Internet of Things
 
Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014
Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014
Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014
 
Security Issues in Internet of Things
Security Issues in Internet of ThingsSecurity Issues in Internet of Things
Security Issues in Internet of Things
 

Mais de Priyanka Aash

Mais de Priyanka Aash (20)

Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
 
Verizon Breach Investigation Report (VBIR).pdf
Verizon Breach Investigation Report (VBIR).pdfVerizon Breach Investigation Report (VBIR).pdf
Verizon Breach Investigation Report (VBIR).pdf
 
Top 10 Security Risks .pptx.pdf
Top 10 Security Risks .pptx.pdfTop 10 Security Risks .pptx.pdf
Top 10 Security Risks .pptx.pdf
 
Simplifying data privacy and protection.pdf
Simplifying data privacy and protection.pdfSimplifying data privacy and protection.pdf
Simplifying data privacy and protection.pdf
 
Generative AI and Security (1).pptx.pdf
Generative AI and Security (1).pptx.pdfGenerative AI and Security (1).pptx.pdf
Generative AI and Security (1).pptx.pdf
 
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdfEVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
EVERY ATTACK INVOLVES EXPLOITATION OF A WEAKNESS.pdf
 
DPDP Act 2023.pdf
DPDP Act 2023.pdfDPDP Act 2023.pdf
DPDP Act 2023.pdf
 
Cyber Truths_Are you Prepared version 1.1.pptx.pdf
Cyber Truths_Are you Prepared version 1.1.pptx.pdfCyber Truths_Are you Prepared version 1.1.pptx.pdf
Cyber Truths_Are you Prepared version 1.1.pptx.pdf
 
Cyber Crisis Management.pdf
Cyber Crisis Management.pdfCyber Crisis Management.pdf
Cyber Crisis Management.pdf
 
CISOPlatform journey.pptx.pdf
CISOPlatform journey.pptx.pdfCISOPlatform journey.pptx.pdf
CISOPlatform journey.pptx.pdf
 
Chennai Chapter.pptx.pdf
Chennai Chapter.pptx.pdfChennai Chapter.pptx.pdf
Chennai Chapter.pptx.pdf
 
Cloud attack vectors_Moshe.pdf
Cloud attack vectors_Moshe.pdfCloud attack vectors_Moshe.pdf
Cloud attack vectors_Moshe.pdf
 
Stories From The Web 3 Battlefield
Stories From The Web 3 BattlefieldStories From The Web 3 Battlefield
Stories From The Web 3 Battlefield
 
Lessons Learned From Ransomware Attacks
Lessons Learned From Ransomware AttacksLessons Learned From Ransomware Attacks
Lessons Learned From Ransomware Attacks
 
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
Emerging New Threats And Top CISO Priorities In 2022 (Chennai)
 
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
Emerging New Threats And Top CISO Priorities In 2022 (Mumbai)
 
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
Emerging New Threats And Top CISO Priorities in 2022 (Bangalore)
 
Cloud Security: Limitations of Cloud Security Groups and Flow Logs
Cloud Security: Limitations of Cloud Security Groups and Flow LogsCloud Security: Limitations of Cloud Security Groups and Flow Logs
Cloud Security: Limitations of Cloud Security Groups and Flow Logs
 
Cyber Security Governance
Cyber Security GovernanceCyber Security Governance
Cyber Security Governance
 
Ethical Hacking
Ethical HackingEthical Hacking
Ethical Hacking
 

Último

Último (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Breaking Smart Speakers: We are Listening to You.

  • 1.
  • 2. About Us • Li Yuxiang @Xbalien29 Security researcher, found several vulnerabilities in Android, Former ROIS CTF team member, speaker of HITB 2018 AMS. • Qian Wenxiang @leonwxqian Security Researcher, Top 100 of MSRC list ( 2016 & 2017 ), Author of "WhiteHat to talk about web browser security ". • Wu Huiyu @DroidSec_cn Security Researcher, Bug Hunter, GeekPwn 2015 Winner, Speaker of HITB 2018 AMS and POC 2017. Acknowledgement @Gmxp, Team Leader of Tencent Blade Team. @Lake2, Founder of Tencent Security Response Center.
  • 3. Tencent Blade Team • Founded By Tencent Security Platform Department. • Focus on security research of AI, IoT, Mobile devices. • Found 70+ security vulnerabilities (Google, Apple). • Contact us: https://blade.tencent.com
  • 4. Agenda • Introduction to Smart Speaker • Attack Surface • Remote Attack Xiaomi AI speaker • Breaking Amazon Echo • Conclusion
  • 7. About Xiaomi AI Speaker
  • 8. Attack Surface Smart Speaker Mobile App Cloud Server Communication Protocol
  • 9. Remote Attack Xiaomi AI Speaker • A Brief Look At Xiaomi AI Speaker • MIIO Ubus Command Execution • Messageagent Command Execution • Remote Exploit • Demo
  • 10. A Brief Look At Xiaomi AI Speaker • Base on OpenWrt 15.05.1 • SSH Disabled • Firmware Verification based on RSA • Ports: – UDP 54321 MIIO – TCP 9999 UPNP – UDP 53 DNS
  • 12. MIIO Ubus Command Execution • Get MIIO protocol AES secret key (token) - Use a unauthorized unbind vulnerability to remote reset MI AI speaker - Bind MI AI Speaker to attacker’s account, extract token from MI Home App’s database (/data/data/com.xiaomi.smarthome/databases/miio2.db)
  • 13. MIIO Ubus Command Execution • Disable dropbear password auth • Start dropbear to open ssh • Connect Speaker in LAN
  • 14. MIIO Ubus Command Execution
  • 16. Messageagent Command Execution • Parser and execute ubus command • Parser and execute system command
  • 18. Demo
  • 19. Breaking Amazon Echo • A Brief Look At Amazon Echo • Soldering & Desoldering Tools • Flash Dump • Root Amazon Echo by Modify Firmware • Exploit Amazon Echo • Demo
  • 20. A Brief Look At Amazon Echo MTK 8163 CPU Mircon / Samsung 4GB EMCP BGA221 • Fire OS v5.5 (Based On Android 5.1) • SELinux & ASLR enabled • Bootloader Locked • Ports: TCP 55442 HTTP Server TCP 55443 HTTPS Server UDP 55444 Time Sync UDP 55445 Device Sync
  • 21. Soldering & Desoldering Tools Amtech Tacky FluxSolder Wick Hot Air Gun Soldering Iron Solder Wire Solder Paste Reballing Tool
  • 23. Flash Dump BGA211 EMCP Adapter + EMCP USB Reader
  • 25. Root Amazon Echo by Modify Firmware Modify /system/etc/init.fosflags.sh
  • 27. Root Amazon Echo by Modify Firmware
  • 28. Exploiting Amazon Echo: On Basis of Software
  • 29. 3 Steps to Eavesdropping the Target
  • 30. 3 Big Problems Need to Be Solved Vulnerable Program 21 3
  • 31. An Attacker is Always Happy to See There’s a Web Server Available
  • 32. Whole Home Audio Daemon (whad) ✓ root ✓ Able to record voice ✓ Network access ✓ Web server Protocol Port Purpose TCP 55442 HTTP Server (audio cache) TCP 55443 HTTPS Server w/authentication (device control) UDP 55444 Time Sync. UDP 55445 Device Sync.
  • 33. Client-authenticated TLS Handshake • We need Server Certificate, Client Certificate and Private Key. • Get them from libcurl’s negotiate function. • Solution: Extract information from physically hacked device. This one!
  • 34. Bind the Hacked Device into Victim’s Account First
  • 35. Web Service Auditing • XSSes we’ve found are hard to use, but it is fatal. • Session based, some actions need re-login. • Lack of modern protections.
  • 36. Use Several Redirects to Mimic an XSS • Alexa OpenID login redirect to any domain fits https://*.amazon.com . • assoc-redirect.amazon.com will redirect to an Amazon site amazon.cn, amazon.co.uk … • Validate rule: http(s)://*.amazon.com*.*/ (We guess). • We need a downgrade: http://subdomain.amazon.com .
  • 37. Restrictions • Find an Amazon domain resolves to LAN address. • Attacker can be joined into the LAN with that IP address.
  • 38. Steal Cookies with the Redirect • aapsservice.amazon.com, A Record(DNS A) resolves to a local address 10.189.XX.XX. • Attacker joins the LAN with IP statically set to 10.189.XX.XX, and web server enabled. aapsservice resolves to attacker in that LAN.
  • 39. 2 Big Problems Need to Be Solved Vulnerable Program 2 3 • When user login, we can get the cookies. • Bind our device. • We can communicate with other devices of victim. DEAL WITH IT
  • 40. Extract Certificates and Private Keys From libcurl’s Negotiate Function
  • 41. The Cloud Synchronize of Device Info Device info obtained from Amazon when whad starts.
  • 42. Patching Whad • Whad HTTPS “ping” other devices periodically. • Patch whad (of physically rooted device). • Dump the certs and private keys we need! • Benefit: No need to crack the complex algorithm. • Simple and violent, but it works.
  • 43. Get the Keys to Pwn • Disable ASLR, SELinux of physically hacked device • Dump Server Certificate, Client Certificate from the variant which outputs adb log. • Dump Private Key from negotiate function too, with a call to PEM_write_PrivateKey() .
  • 44. 1 Big Problem Needs to Be Solved Vulnerable Program 3 • Every time before we would attack, we run patched whad to get the certs & key. • “Firewall” of client authentication is broken. DEAL WITH IT DEAL WITH IT
  • 45. Binary Auditing • Amazon’s own code is secured by design. • Echo’s using very old version of the 3rd party libraries. • N days & 0 day.
  • 46. Attack the Web Server, to Finally Get Control of Whad
  • 47. The Web Server -- libcivetweb • The code is written 4 years ago. • A failed condition check caused almost every type of vulnerabilities in sequence in getParam(). • Nobody calls the vulnerable function until an update…
  • 48. A Bad Move Leads to Chain Reaction bool CivetServer::getParam(struct mg_connection *conn, const char *name, std::string &dst, size_t occurrence) { …… …… } CVE-2018-12686 Fixed in June, 2018
  • 49. Overflow the dlmalloc(0) • dlmalloc(0) is valid. 16 bytes (8B metadata + 8B user data) • mg_read() fix the input length ( uint -1 ): int write_size = min(0xfffffff, actual length); • POST data written into buffer. • length of input > 8 bytes Heap buffer overflow
  • 50. Shape the heap • Shape the heap by sending HTTPS request. • malloc() controlled by user. • Sending or omitting rnrn to control the connection.
  • 51. Bypass ASLR to Continue Our Attack
  • 52. Heap spray • Large heap allocation mmaped anonymous memory. • Memory lays in a predictable range (even ASLR is enabled). • In our case, which is 0xf15f1008 (empirical value). • Heap spray and put our shellcode into this address.
  • 53. Leak Addresses of Other Libraries • Information leak via network? • CVE-2017-1000254 of libcurl in FTP connection is exploitable. • To reproduce the vulnerability we need a FTP connection reuse. Echo disabled many dangerous libcurl functions
  • 54. Trigger the Hidden Code Path • Playlist download Connection reuse! • Accept only HTTP/HTTPS 302 Redirect to FTP. • FTP 404 Prevent from caching. • Command downloadAudio with extension .pls, libcurl visits FTP server twice Address leaked!
  • 55. Leaking the Address • Payload length = 103 leak an function address by luck (~80%). • Calculate libcurl’s base loading address. • Calculate other libraries’ addresses based on leaked address.
  • 56. Code Execution • Overwrite the function pointer in SSL context object • Webserver responding SSL_write • Fastest way to trigger: malformed HTTP version header. • Not safe if you compile this code on Windows, did you see that? ☺
  • 57. Attacking Primitives • Restart the whad • Information leak • Heap maintaining • Heap freeing • Fast SSL_write call • Create any size of heap • Use different types of connection to obtain ideal heap layout. • Combine them to get an RCE.
  • 59. Entrust The Hack to Time • Challenge: disturb from background threads. • ~40% for a testing gadget (4 Bytes) • Real life gadget is 24 bytes, success rate down to ~8%. • But whad is respawned after crash automatically. • The only thing we need is time ☺ (avg. 30 min per success).
  • 60. The Shellcode • Almost same system version on every Echo device ->We don’t need to adapt for many versions • fork() to prevent crash • Handlers for SIGSEGV/SIGABRT • Send the data via TCP to attacker
  • 61. Deal with It whad • Whad is now turning into a eavesdropping program. • It’s eavesdropping silently and it’s sending every voice data to the attacker. DEAL WITH IT
  • 63. Updates • Reported to Xiaomi in April, fixed in May, received $25,000 USD bonus. “Thanks to the Tencent Blade Team for the support of Xiaomi's product safety. All reported vulnerabilities have been fixed to ensure maximum user security.” • Reported to Amazon in May, fixed in July. “Amazon would like to thank the Tencent Blade Team for working with us on resolving this issue. Customer trust is important to us and we take security seriously. Customers do not need to take any action as their devices have been automatically updated with security fixes.”
  • 64. Conclusion • Exploit Source Code: – We will update full exploit code to Github in the future: https://github.com/tencentbladeteam • Hack tips: – Get the firmware first. – It’s good to master all kinds of soldering and firmware extraction methods. – Web Vulnerabilities + Binary Vulnerabilities Remote Exploit. – Be patient.
  • 66. Q & A https://blade.tencent.com Contact us https://security.tencent.com Our Bug Bounty Program