SlideShare a Scribd company logo
1 of 43
Download to read offline
Let’s talk about SOAP, baby.
Let’s talk about UPnP.
Ricky “HeadlessZeke” Lawshae – DEFCON 23
Who am I?
• Security Researcher for HP TippingPoint’s DVLabs
team
• At Rapid7 before that, and BreakingPoint before that
• Speaker at Defcon, Recon, Insomni’hack, and
Ruxcon
• Voider of warranties
• Reader of comic books
• Drinker of beers
• TRIVIA: I once got a job at a police department while
I had 4 active warrants out for my arrest.
What are we talking about?
• The Internet of Things™ (ugh…)
• It’s here, whether you like it or not
• “Just put a network interface on it. We’ll worry about why later.”
• Smart devices aren’t very smart
• Need simple way to talk to each other
• Ease-of-use: Get the tech out of the way of UX
• Often accomplished with SOAP/UPnP services
• Super talkative
• Happily tell you all their capabilities in a well-structured format
• Also, don’t bother themselves with pesky issues like security
What are we talking about?
• UPnP
• Universal Plug and Play
• SSDP
• Simple Service Discovery Protocol
• SCPD
• Service Control Protocol DeBnition
• SOAP
• Simple Object Access Protocol
Let’s talk about all the good
things…
UPnP
• 1900/UDP
• HTTP over UDP allowing devices to discover each other
• Multicast 239.255.255.250
• UPnP Stack[1]
• Discovery
• Advertising and Searching
• Description
• An XML Ble describing the device
• Control
• Call an action or query for a value
• Eventing
• Used for announcing state changes
• Presentation
• UI…web page or management portal I guess?
[1]
http://www.upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.0-20080424.pdf
UPnP – Discovery
All you need to know about
discovery. Also, this is the
really noisy part.
UPnP – Discovery
All you need to know about
discovery. Also, this is the
really noisy part.
UPnP – Description
• XML Ble usually hosted on a high number TCP port
• Version info
• upnp.org spec
• Usually just 1.0
• Device deBnitions
• Device type
• Make/model/UUID
• Service list
• Service type
• SCPD URL
• Control URL
• Event URL
UPnP – Description
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://10.0.0.1:5000/</URLBase>
<device>
<pnpx:X_hardwareId>VEN_01f2&…&REV_01</pnpx:X_hardwareId>
<pnpx:X_deviceCategory>NetworkInfrastructure.Router</pnpx:X_deviceCategory>
<df:X_deviceCategory>Network.Router.Wireless</df:X_deviceCategory>
<pnpx:X_compatibleId>urn:schemas-upnp-org:device:InternetGatewayDevice:1</pnpx:X_compatibleId>
<deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
<friendlyName>WNDR3400v2 (Gateway)</friendlyName>
<manufacturer>NETGEAR, Inc.</manufacturer>
<manufacturerURL>http://www.NETGEAR.com</manufacturerURL>
<modelDescription>NETGEAR WNDR3400v2 N600 Wireless Router</modelDescription>
<modelNumber>WNDR3400v2</modelNumber>
<modelName>WNDR3400v2</modelName>
<modelURL>http://www.netgear.com</modelURL>
<UDN>uuid:bc567461-ee40-a9c2-39d3-5338c402cc8d</UDN>
<iconList>…</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType>
<serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId>
<SCPDURL>/Public_UPNP_Layer3F.xml</SCPDURL>
<controlURL>/Public_UPNP_C1</controlURL>
<eventSubURL>/Public_UPNP_Event_1</eventSubURL>
</service>
</serviceList>
</device>
UPnP – Description
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://10.0.0.1:5000/</URLBase>
<device>
<pnpx:X_hardwareId>VEN_01f2&…&REV_01</pnpx:X_hardwareId>
<pnpx:X_deviceCategory>NetworkInfrastructure.Router</pnpx:X_deviceCategory>
<df:X_deviceCategory>Network.Router.Wireless</df:X_deviceCategory>
<pnpx:X_compatibleId>urn:schemas-upnp-org:device:InternetGatewayDevice:1</pnpx:X_compatibleId>
<deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType>
<friendlyName>WNDR3400v2 (Gateway)</friendlyName>
<manufacturer>NETGEAR, Inc.</manufacturer>
<manufacturerURL>http://www.NETGEAR.com</manufacturerURL>
<modelDescription>NETGEAR WNDR3400v2 N600 Wireless Router</modelDescription>
<modelNumber>WNDR3400v2</modelNumber>
<modelName>WNDR3400v2</modelName>
<modelURL>http://www.netgear.com</modelURL>
<UDN>uuid:bc567461-ee40-a9c2-39d3-5338c402cc8d</UDN>
<iconList>…</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType>
<serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId>
<SCPDURL>/Public_UPNP_Layer3F.xml</SCPDURL>
<controlURL>/Public_UPNP_C1</controlURL>
<eventSubURL>/Public_UPNP_Event_1</eventSubURL>
</service>
</serviceList>
</device>
UPnP – SCPD
• XML Ble deBning the service actions and arguments
• Version info
• Same deal as description
• Action list
• Action name
• Arguments
• Argument name
• Direction (input/output)
• Variable name
• Variable list
• Variable name
• Data type
UPnP – SCPD
<actionList>
<action>
<name>SetDefaultConnectionService</name>
<argumentList>
<argument>
<name>NewDefaultConnectionService</name>
<direction>in</direction>
<relatedStateVariable>DefaultConnectionService</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetDefaultConnectionService</name>
<argumentList>
<argument>
<name>NewDefaultConnectionService</name>
<direction>out</direction>
<relatedStateVariable>DefaultConnectionService</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
<serviceStateTable>
<stateVariable sendEvents="yes">
<name>DefaultConnectionService</name>
<dataType>string</dataType>
</stateVariable>
</serviceStateTable>
UPnP – SCPD
<actionList>
<action>
<name>SetDefaultConnectionService</name>
<argumentList>
<argument>
<name>NewDefaultConnectionService</name>
<direction>in</direction>
<relatedStateVariable>DefaultConnectionService</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetDefaultConnectionService</name>
<argumentList>
<argument>
<name>NewDefaultConnectionService</name>
<direction>out</direction>
<relatedStateVariable>DefaultConnectionService</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
<serviceStateTable>
<stateVariable sendEvents="yes">
<name>DefaultConnectionService</name>
<dataType>string</dataType>
</stateVariable>
</serviceStateTable>
UPnP – Control
• This is where SOAP comes in (Bnally!)
• Mostly just frontends for an RPC service or CGI script
• SOAP envelopes
• XML-formatted API calls
• Service type from description XML
• Action name and arguments from SCPD XML
• POST envelope to control URL
UPnP – Control
POST /Public_UPNP_C1 HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:schemas-upnp-org:service:Layer3Forwarding:1#SetDefaultConnectionService"
Content-Length: 568
Host: x.x.x.x:12345
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<n1:SetDefaultConnectionService xmlns:n1="urn:schemas-upnp-org:service:Layer3Forwarding:1">
<NewDefaultConnectionService xsi:type="xsd:string">blah</NewDefaultConnectionService>
</n1:SetDefaultConnectionService>
</env:Body>
</env:Envelope>
TL;DR
But what can you do with it?
But what can you do with it?
• Control AV equipment
• Home automation
• Network administration
• Physical security systems (ok, easy there buddy)
• Industrial monitoring and control (uh…what?)
• And this is just the oUcial specs
Neat, so…
• All our devices can talk to each
other!
• Brave new worlds of remote control
and automation!
• Have your toaster turn on the
lights, set the TV to the news
channel, and send you a text
message when breakfast is ready!
• The future is now!
• Nothing could possibly go wrong!
And the bad things…
What about security?
• Embedded devices
• Limited memory and processing power
• Board dev and software dev are often completely diVerent companies
• Copy-and-paste development
• Keep costs low
• Not exactly concerned/knowledgeable
• Deployment
• Millions of internet-facing UPnP-enabled devices
• Too many vendors to count
• Frontend is standardized, backend varies even within same vendor
• DiUcult to patch/update Brmware
• Just because you can, doesn’t mean you should
What about security?
• XML parsing is hard
• Needs lots of system resources
• Free-form, user-supplied data
• In 2013, 2.5% of CVE’s were XML-related[2]
• Of those, almost 36% had CVSS severity of 7 or above
• As the use-case for XML grows, so do the classes of vulns
• Recursion bugs, XXE, command injection, etc…
[2]
http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=xml
Attack surface
• UPnP service
• HTTP header parsing
• SSDP parsing
• OS command injection
• Information disclosure
• SOAP service
• HTTP header parsing
• XML parsing
• Injection vulns
• OS command
• SQL injection
• SOAP injection
• Information disclosure
• Ridiculous levels of unauthenticated device control
Attack surface – UPnP
• CVE-2012-5958
• Disclosed a couple years ago by HD Moore (one of many)
• https://community.rapid7.com/docs/DOC-2150
• Calls strncpy to copy a string from the ST header into
TempBuf[COMMAND_LEN]
• Size argument for strncpy is based on number of characters between colons
Attack surface – UPnP
• CVE-2012-5958
• Disclosed a couple years ago by HD Moore (one of many)
• https://community.rapid7.com/docs/DOC-2150
• Calls strncpy to copy a string from the ST header into
TempBuf[COMMAND_LEN]
• Size argument for strncpy is based on number of characters between colons
M-SEARCH * HTTP/1.1
Host:239.255.255.250:1900
ST:uuid:schemas:device:[string longer than
COMMAND_LEN]:blah
Man:"ssdp:discover"
MX:3
Attack surface – UPnP
• D-Link DIR-815 UPnP Command Injection
• Disclosed Feb 2013 by Zach Cutlip
• http://shadow-Ble.blogspot.com/2013/02/dlink-dir-815-upnp-command-injectio
n.html
• Contents of ST header get passed as arguments to M-SEARCH.sh
• No validation or sanitization
Attack surface – UPnP
• D-Link DIR-815 UPnP Command Injection
• Disclosed Feb 2013 by Zach Cutlip
• http://shadow-Ble.blogspot.com/2013/02/dlink-dir-815-upnp-command-injectio
n.html
• Contents of ST header get passed as arguments to M-SEARCH.sh
• No validation or sanitization
M-SEARCH * HTTP/1.1
Host:239.255.255.250:1900
ST:uuid:`[shell command]`
Man:"ssdp:discover"
MX:3
Attack surface – SOAP
• AirTies RT Series SOAPAction Name BuVer Over]ow
• Disclosed earlier this year by Onur Alanbel
• https://www.exploit-db.com/exploits/36839/
• ExecuteSoapAction function allocates statically-sized buVer
• Calls memcpy to copy value of SOAPAction header into it with no bounds
checking
Attack surface – SOAP
• AirTies RT Series SOAPAction Name BuVer Over]ow
• Disclosed earlier this year by Onur Alanbel
• https://www.exploit-db.com/exploits/36839/
• ExecuteSoapAction function allocates statically-sized buVer
• Calls memcpy to copy value of SOAPAction header into it with no bounds
checking
POST / HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "n:schemas-upnp-org:service:WANIPConnection:1#
[more than 2048 bytes]"
Content-Length: [length of req]
Host: x.x.x.x:5555
Attack surface – SOAP
• Broadcom SetConnectionType Format String Vulnerability
• Disclosed a couple years ago by Leon Juranic and Vedran Kajic
• http://sebug.net/paper/Exploits-Archives/2013-exploits/1301-exploits/DC-2013
-01-003.txt
• SetConnectionType action feeds value of NewConnectionType argument to
snprintf
• No sanitization of user-controlled value
Attack surface – SOAP
• Broadcom SetConnectionType Format String Vulnerability
• Disclosed a couple years ago by Leon Juranic and Vedran Kajic
• http://sebug.net/paper/Exploits-Archives/2013-exploits/1301-exploits/DC-2013
-01-003.txt
• SetConnectionType action feeds value of NewConnectionType argument to
snprintf
• No sanitization of user-controlled value
<SOAP-ENV:Body>
<m:SetConnectionType
xmlns:m="urn:schemas-upnp-org:service:WANIPConnection:1"
as="">
<NewConnectionType>[format
string]</NewConnectionType>
</m:SetConnectionType>
</SOAP-ENV:Body>
Attack surface – SOAP
• CVE-2014-3242
• Disclosed last year by pnig0s
• http://www.pnigos.com/?p=260
• SOAPpy allows declaration of user-deBned XML External Entities in SOAP
request
• No sanitization of user-controlled value
Attack surface – SOAP
• CVE-2014-3242
• Disclosed last year by pnig0s
• http://www.pnigos.com/?p=260
• SOAPpy allows declaration of user-deBned XML External Entities in SOAP
request
• No sanitization of user-controlled value
<!DOCTYPE v1 [<!ENTITY xxe SYSTEM "Ble:///etc/passwd">]>
<SOAP-ENV:Envelope … >
<SOAP-ENV:Body>
<echo SOAP-ENC:root="1">
<v1 xsi:type="xsd:string">&xxe;</v1>
</echo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Attack surface – SOAP
• CVE-2014-2928
• Disclosed last year by Brandon Perry (PBerry Crunch!)
• http://seclists.org/fulldisclosure/2014/May/32
• F5 iControl API set_hostname action passes value of hostname argument to
shell
• Once again, no sanitization of user-controlled value
Attack surface – SOAP
• CVE-2014-2928
• Disclosed last year by Brandon Perry (PBerry Crunch!)
• http://seclists.org/fulldisclosure/2014/May/32
• F5 iControl API set_hostname action passes value of hostname argument to
shell
• Once again, no sanitization of user-controlled value
<SOAP-ENV:Body>
<n1:set_hostname xmlns:n1="urn:iControl:System/Inet">
<hostname>`[shell command]`.whatever.com</hostname>
</n1:set_hostname>
</SOAP-ENV:Body>
Attack surface – SOAP
• Netgear R6200 SetFirmware fun
• Spread across a series of blog posts starting in April 2015 (Zach Cutlip again)
• http://shadow-Ble.blogspot.com/2015/04/abandoned-part-01.html
• Dead/non-functional code that shipped with the device…
• Multiple vulnerabilities
• No authentication
• And he works around the fact that the code doesn’t work to upload modiBed
Brmware images anyway
DEMO TIME
Conclusion
Playing along at home
• Know your network
• M-SEARCH every network you connect to
• Watch for new NOTIFY messages
• If you don’t need UPnP, disable it
• If not on the device, then at the router
• Keep on top of Brmware updates
• Not always automatic
Playing along at home
• Fuzz the crap out of it
• Burp – http://portswigger.net/burp/
• WSFuzzer –
https://www.owasp.org/index.php/Category:OWASP_WSFuzzer_Project
• Miranda – http://code.google.com/p/miranda-upnp/
• My stuV…if I ever release it, which I probably won’t…
Hit me up
• @HeadlessZeke on twitter
• Usually lurking on freenode as HeadlessZeke
• headlesszeke@hp.com
Thank you!

More Related Content

What's hot

Defcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-securityDefcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-security
Priyanka Aash
 

What's hot (20)

Introduction to Penetration Testing
Introduction to Penetration TestingIntroduction to Penetration Testing
Introduction to Penetration Testing
 
Pentest Apocalypse - SANSFIRE 2016 Edition
Pentest Apocalypse - SANSFIRE 2016 EditionPentest Apocalypse - SANSFIRE 2016 Edition
Pentest Apocalypse - SANSFIRE 2016 Edition
 
Is code review the solution?
Is code review the solution?Is code review the solution?
Is code review the solution?
 
Defcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-securityDefcon 22-david-wyde-client-side-http-cookie-security
Defcon 22-david-wyde-client-side-http-cookie-security
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devices
 
Pwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShellPwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShell
 
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
 
Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0
 
Defcon 22-metacortex-grifter-darkside-of-the-internet
Defcon 22-metacortex-grifter-darkside-of-the-internetDefcon 22-metacortex-grifter-darkside-of-the-internet
Defcon 22-metacortex-grifter-darkside-of-the-internet
 
Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...
 
Security workflow with ansible
Security  workflow with ansibleSecurity  workflow with ansible
Security workflow with ansible
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)
 
FunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemFunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang Ecosystem
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 1)
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
 
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peopDefcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
Defcon 22-adrian-crenshaw-dropping-docs-on-darknets-how-peop
 
Sticky Keys to the Kingdom
Sticky Keys to the KingdomSticky Keys to the Kingdom
Sticky Keys to the Kingdom
 
BSides London 2017 - Hunt Or Be Hunted
BSides London 2017 - Hunt Or Be HuntedBSides London 2017 - Hunt Or Be Hunted
BSides London 2017 - Hunt Or Be Hunted
 
Ntxissacsc5 red 1 &amp; 2 basic hacking tools ncc group
Ntxissacsc5 red 1 &amp; 2   basic hacking tools ncc groupNtxissacsc5 red 1 &amp; 2   basic hacking tools ncc group
Ntxissacsc5 red 1 &amp; 2 basic hacking tools ncc group
 

Similar to DEF CON 23 - Rickey Lawshae - lets talk about soap

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
 
Martin Zeiser, Universal Pwn n Play - pacsec -final
Martin Zeiser, Universal Pwn n Play - pacsec -finalMartin Zeiser, Universal Pwn n Play - pacsec -final
Martin Zeiser, Universal Pwn n Play - pacsec -final
PacSecJP
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CanSecWest
 
The Background Noise of the Internet
The Background Noise of the InternetThe Background Noise of the Internet
The Background Noise of the Internet
Andrew Morris
 

Similar to DEF CON 23 - Rickey Lawshae - lets talk about soap (20)

U Plug, We Play - NED Summit. Cork, Ireland
U Plug, We Play - NED Summit. Cork, IrelandU Plug, We Play - NED Summit. Cork, Ireland
U Plug, We Play - NED Summit. Cork, Ireland
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Martin Zeiser, Universal Pwn n Play - pacsec -final
Martin Zeiser, Universal Pwn n Play - pacsec -finalMartin Zeiser, Universal Pwn n Play - pacsec -final
Martin Zeiser, Universal Pwn n Play - pacsec -final
 
idsecconf2010-hacking priv8 network
idsecconf2010-hacking priv8 networkidsecconf2010-hacking priv8 network
idsecconf2010-hacking priv8 network
 
y3dips hacking priv8 network
y3dips hacking priv8 networky3dips hacking priv8 network
y3dips hacking priv8 network
 
SDN Demystified, by Dean Pemberton [APNIC 38]
SDN Demystified, by Dean Pemberton [APNIC 38]SDN Demystified, by Dean Pemberton [APNIC 38]
SDN Demystified, by Dean Pemberton [APNIC 38]
 
Nomura UCCSC 2009
Nomura UCCSC 2009Nomura UCCSC 2009
Nomura UCCSC 2009
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathers
 
Null mumbai-reversing-IoT-firmware
Null mumbai-reversing-IoT-firmwareNull mumbai-reversing-IoT-firmware
Null mumbai-reversing-IoT-firmware
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
 
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
 
Smart Bombs: Mobile Vulnerability and Exploitation
Smart Bombs: Mobile Vulnerability and ExploitationSmart Bombs: Mobile Vulnerability and Exploitation
Smart Bombs: Mobile Vulnerability and Exploitation
 
OpManager training - Device discovery and classification.
OpManager training - Device discovery and classification.OpManager training - Device discovery and classification.
OpManager training - Device discovery and classification.
 
Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...
 
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National PoliceDublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
 
The Background Noise of the Internet
The Background Noise of the InternetThe Background Noise of the Internet
The Background Noise of the Internet
 
Bh europe 2013_wilhoit
Bh europe 2013_wilhoitBh europe 2013_wilhoit
Bh europe 2013_wilhoit
 
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National PoliceiSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
 
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and SolutionHeartbleed Bug Vulnerability: Discovery, Impact and Solution
Heartbleed Bug Vulnerability: Discovery, Impact and Solution
 

More from Felipe Prado

More from Felipe Prado (20)

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud security
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (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, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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...
 

DEF CON 23 - Rickey Lawshae - lets talk about soap

  • 1. Let’s talk about SOAP, baby. Let’s talk about UPnP. Ricky “HeadlessZeke” Lawshae – DEFCON 23
  • 2. Who am I? • Security Researcher for HP TippingPoint’s DVLabs team • At Rapid7 before that, and BreakingPoint before that • Speaker at Defcon, Recon, Insomni’hack, and Ruxcon • Voider of warranties • Reader of comic books • Drinker of beers • TRIVIA: I once got a job at a police department while I had 4 active warrants out for my arrest.
  • 3. What are we talking about? • The Internet of Things™ (ugh…) • It’s here, whether you like it or not • “Just put a network interface on it. We’ll worry about why later.” • Smart devices aren’t very smart • Need simple way to talk to each other • Ease-of-use: Get the tech out of the way of UX • Often accomplished with SOAP/UPnP services • Super talkative • Happily tell you all their capabilities in a well-structured format • Also, don’t bother themselves with pesky issues like security
  • 4. What are we talking about? • UPnP • Universal Plug and Play • SSDP • Simple Service Discovery Protocol • SCPD • Service Control Protocol DeBnition • SOAP • Simple Object Access Protocol
  • 5. Let’s talk about all the good things…
  • 6. UPnP • 1900/UDP • HTTP over UDP allowing devices to discover each other • Multicast 239.255.255.250 • UPnP Stack[1] • Discovery • Advertising and Searching • Description • An XML Ble describing the device • Control • Call an action or query for a value • Eventing • Used for announcing state changes • Presentation • UI…web page or management portal I guess? [1] http://www.upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.0-20080424.pdf
  • 7. UPnP – Discovery All you need to know about discovery. Also, this is the really noisy part.
  • 8. UPnP – Discovery All you need to know about discovery. Also, this is the really noisy part.
  • 9. UPnP – Description • XML Ble usually hosted on a high number TCP port • Version info • upnp.org spec • Usually just 1.0 • Device deBnitions • Device type • Make/model/UUID • Service list • Service type • SCPD URL • Control URL • Event URL
  • 10. UPnP – Description <specVersion> <major>1</major> <minor>0</minor> </specVersion> <URLBase>http://10.0.0.1:5000/</URLBase> <device> <pnpx:X_hardwareId>VEN_01f2&…&REV_01</pnpx:X_hardwareId> <pnpx:X_deviceCategory>NetworkInfrastructure.Router</pnpx:X_deviceCategory> <df:X_deviceCategory>Network.Router.Wireless</df:X_deviceCategory> <pnpx:X_compatibleId>urn:schemas-upnp-org:device:InternetGatewayDevice:1</pnpx:X_compatibleId> <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType> <friendlyName>WNDR3400v2 (Gateway)</friendlyName> <manufacturer>NETGEAR, Inc.</manufacturer> <manufacturerURL>http://www.NETGEAR.com</manufacturerURL> <modelDescription>NETGEAR WNDR3400v2 N600 Wireless Router</modelDescription> <modelNumber>WNDR3400v2</modelNumber> <modelName>WNDR3400v2</modelName> <modelURL>http://www.netgear.com</modelURL> <UDN>uuid:bc567461-ee40-a9c2-39d3-5338c402cc8d</UDN> <iconList>…</iconList> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType> <serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId> <SCPDURL>/Public_UPNP_Layer3F.xml</SCPDURL> <controlURL>/Public_UPNP_C1</controlURL> <eventSubURL>/Public_UPNP_Event_1</eventSubURL> </service> </serviceList> </device>
  • 11. UPnP – Description <specVersion> <major>1</major> <minor>0</minor> </specVersion> <URLBase>http://10.0.0.1:5000/</URLBase> <device> <pnpx:X_hardwareId>VEN_01f2&…&REV_01</pnpx:X_hardwareId> <pnpx:X_deviceCategory>NetworkInfrastructure.Router</pnpx:X_deviceCategory> <df:X_deviceCategory>Network.Router.Wireless</df:X_deviceCategory> <pnpx:X_compatibleId>urn:schemas-upnp-org:device:InternetGatewayDevice:1</pnpx:X_compatibleId> <deviceType>urn:schemas-upnp-org:device:InternetGatewayDevice:1</deviceType> <friendlyName>WNDR3400v2 (Gateway)</friendlyName> <manufacturer>NETGEAR, Inc.</manufacturer> <manufacturerURL>http://www.NETGEAR.com</manufacturerURL> <modelDescription>NETGEAR WNDR3400v2 N600 Wireless Router</modelDescription> <modelNumber>WNDR3400v2</modelNumber> <modelName>WNDR3400v2</modelName> <modelURL>http://www.netgear.com</modelURL> <UDN>uuid:bc567461-ee40-a9c2-39d3-5338c402cc8d</UDN> <iconList>…</iconList> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:Layer3Forwarding:1</serviceType> <serviceId>urn:upnp-org:serviceId:L3Forwarding1</serviceId> <SCPDURL>/Public_UPNP_Layer3F.xml</SCPDURL> <controlURL>/Public_UPNP_C1</controlURL> <eventSubURL>/Public_UPNP_Event_1</eventSubURL> </service> </serviceList> </device>
  • 12. UPnP – SCPD • XML Ble deBning the service actions and arguments • Version info • Same deal as description • Action list • Action name • Arguments • Argument name • Direction (input/output) • Variable name • Variable list • Variable name • Data type
  • 15. UPnP – Control • This is where SOAP comes in (Bnally!) • Mostly just frontends for an RPC service or CGI script • SOAP envelopes • XML-formatted API calls • Service type from description XML • Action name and arguments from SCPD XML • POST envelope to control URL
  • 16. UPnP – Control POST /Public_UPNP_C1 HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:schemas-upnp-org:service:Layer3Forwarding:1#SetDefaultConnectionService" Content-Length: 568 Host: x.x.x.x:12345 <?xml version="1.0" encoding="utf-8" ?> <env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <n1:SetDefaultConnectionService xmlns:n1="urn:schemas-upnp-org:service:Layer3Forwarding:1"> <NewDefaultConnectionService xsi:type="xsd:string">blah</NewDefaultConnectionService> </n1:SetDefaultConnectionService> </env:Body> </env:Envelope>
  • 17. TL;DR
  • 18. But what can you do with it?
  • 19. But what can you do with it? • Control AV equipment • Home automation • Network administration • Physical security systems (ok, easy there buddy) • Industrial monitoring and control (uh…what?) • And this is just the oUcial specs
  • 20. Neat, so… • All our devices can talk to each other! • Brave new worlds of remote control and automation! • Have your toaster turn on the lights, set the TV to the news channel, and send you a text message when breakfast is ready! • The future is now! • Nothing could possibly go wrong!
  • 21. And the bad things…
  • 22. What about security? • Embedded devices • Limited memory and processing power • Board dev and software dev are often completely diVerent companies • Copy-and-paste development • Keep costs low • Not exactly concerned/knowledgeable • Deployment • Millions of internet-facing UPnP-enabled devices • Too many vendors to count • Frontend is standardized, backend varies even within same vendor • DiUcult to patch/update Brmware • Just because you can, doesn’t mean you should
  • 23. What about security? • XML parsing is hard • Needs lots of system resources • Free-form, user-supplied data • In 2013, 2.5% of CVE’s were XML-related[2] • Of those, almost 36% had CVSS severity of 7 or above • As the use-case for XML grows, so do the classes of vulns • Recursion bugs, XXE, command injection, etc… [2] http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=xml
  • 24. Attack surface • UPnP service • HTTP header parsing • SSDP parsing • OS command injection • Information disclosure • SOAP service • HTTP header parsing • XML parsing • Injection vulns • OS command • SQL injection • SOAP injection • Information disclosure • Ridiculous levels of unauthenticated device control
  • 25. Attack surface – UPnP • CVE-2012-5958 • Disclosed a couple years ago by HD Moore (one of many) • https://community.rapid7.com/docs/DOC-2150 • Calls strncpy to copy a string from the ST header into TempBuf[COMMAND_LEN] • Size argument for strncpy is based on number of characters between colons
  • 26. Attack surface – UPnP • CVE-2012-5958 • Disclosed a couple years ago by HD Moore (one of many) • https://community.rapid7.com/docs/DOC-2150 • Calls strncpy to copy a string from the ST header into TempBuf[COMMAND_LEN] • Size argument for strncpy is based on number of characters between colons M-SEARCH * HTTP/1.1 Host:239.255.255.250:1900 ST:uuid:schemas:device:[string longer than COMMAND_LEN]:blah Man:"ssdp:discover" MX:3
  • 27. Attack surface – UPnP • D-Link DIR-815 UPnP Command Injection • Disclosed Feb 2013 by Zach Cutlip • http://shadow-Ble.blogspot.com/2013/02/dlink-dir-815-upnp-command-injectio n.html • Contents of ST header get passed as arguments to M-SEARCH.sh • No validation or sanitization
  • 28. Attack surface – UPnP • D-Link DIR-815 UPnP Command Injection • Disclosed Feb 2013 by Zach Cutlip • http://shadow-Ble.blogspot.com/2013/02/dlink-dir-815-upnp-command-injectio n.html • Contents of ST header get passed as arguments to M-SEARCH.sh • No validation or sanitization M-SEARCH * HTTP/1.1 Host:239.255.255.250:1900 ST:uuid:`[shell command]` Man:"ssdp:discover" MX:3
  • 29. Attack surface – SOAP • AirTies RT Series SOAPAction Name BuVer Over]ow • Disclosed earlier this year by Onur Alanbel • https://www.exploit-db.com/exploits/36839/ • ExecuteSoapAction function allocates statically-sized buVer • Calls memcpy to copy value of SOAPAction header into it with no bounds checking
  • 30. Attack surface – SOAP • AirTies RT Series SOAPAction Name BuVer Over]ow • Disclosed earlier this year by Onur Alanbel • https://www.exploit-db.com/exploits/36839/ • ExecuteSoapAction function allocates statically-sized buVer • Calls memcpy to copy value of SOAPAction header into it with no bounds checking POST / HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "n:schemas-upnp-org:service:WANIPConnection:1# [more than 2048 bytes]" Content-Length: [length of req] Host: x.x.x.x:5555
  • 31. Attack surface – SOAP • Broadcom SetConnectionType Format String Vulnerability • Disclosed a couple years ago by Leon Juranic and Vedran Kajic • http://sebug.net/paper/Exploits-Archives/2013-exploits/1301-exploits/DC-2013 -01-003.txt • SetConnectionType action feeds value of NewConnectionType argument to snprintf • No sanitization of user-controlled value
  • 32. Attack surface – SOAP • Broadcom SetConnectionType Format String Vulnerability • Disclosed a couple years ago by Leon Juranic and Vedran Kajic • http://sebug.net/paper/Exploits-Archives/2013-exploits/1301-exploits/DC-2013 -01-003.txt • SetConnectionType action feeds value of NewConnectionType argument to snprintf • No sanitization of user-controlled value <SOAP-ENV:Body> <m:SetConnectionType xmlns:m="urn:schemas-upnp-org:service:WANIPConnection:1" as=""> <NewConnectionType>[format string]</NewConnectionType> </m:SetConnectionType> </SOAP-ENV:Body>
  • 33. Attack surface – SOAP • CVE-2014-3242 • Disclosed last year by pnig0s • http://www.pnigos.com/?p=260 • SOAPpy allows declaration of user-deBned XML External Entities in SOAP request • No sanitization of user-controlled value
  • 34. Attack surface – SOAP • CVE-2014-3242 • Disclosed last year by pnig0s • http://www.pnigos.com/?p=260 • SOAPpy allows declaration of user-deBned XML External Entities in SOAP request • No sanitization of user-controlled value <!DOCTYPE v1 [<!ENTITY xxe SYSTEM "Ble:///etc/passwd">]> <SOAP-ENV:Envelope … > <SOAP-ENV:Body> <echo SOAP-ENC:root="1"> <v1 xsi:type="xsd:string">&xxe;</v1> </echo> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
  • 35. Attack surface – SOAP • CVE-2014-2928 • Disclosed last year by Brandon Perry (PBerry Crunch!) • http://seclists.org/fulldisclosure/2014/May/32 • F5 iControl API set_hostname action passes value of hostname argument to shell • Once again, no sanitization of user-controlled value
  • 36. Attack surface – SOAP • CVE-2014-2928 • Disclosed last year by Brandon Perry (PBerry Crunch!) • http://seclists.org/fulldisclosure/2014/May/32 • F5 iControl API set_hostname action passes value of hostname argument to shell • Once again, no sanitization of user-controlled value <SOAP-ENV:Body> <n1:set_hostname xmlns:n1="urn:iControl:System/Inet"> <hostname>`[shell command]`.whatever.com</hostname> </n1:set_hostname> </SOAP-ENV:Body>
  • 37. Attack surface – SOAP • Netgear R6200 SetFirmware fun • Spread across a series of blog posts starting in April 2015 (Zach Cutlip again) • http://shadow-Ble.blogspot.com/2015/04/abandoned-part-01.html • Dead/non-functional code that shipped with the device… • Multiple vulnerabilities • No authentication • And he works around the fact that the code doesn’t work to upload modiBed Brmware images anyway
  • 40. Playing along at home • Know your network • M-SEARCH every network you connect to • Watch for new NOTIFY messages • If you don’t need UPnP, disable it • If not on the device, then at the router • Keep on top of Brmware updates • Not always automatic
  • 41. Playing along at home • Fuzz the crap out of it • Burp – http://portswigger.net/burp/ • WSFuzzer – https://www.owasp.org/index.php/Category:OWASP_WSFuzzer_Project • Miranda – http://code.google.com/p/miranda-upnp/ • My stuV…if I ever release it, which I probably won’t…
  • 42. Hit me up • @HeadlessZeke on twitter • Usually lurking on freenode as HeadlessZeke • headlesszeke@hp.com