Attacking SMS
Attacking SMS
Attacking SMS
RingZero
https://luis.ringzero.net
Agenda
SMS Background
Overview SMS in mobile security
Conclusion
RingZero
https://luis.ringzero.net
SMS Background
Were discussing SMS in the GSM world
SMS is a catch-all term
SMS MMS EMS
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
MMS Flow
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
Testing Environment
RingZero
https://luis.ringzero.net
Testing Setup
Sending messages
Access to GSM modem
Encoding/Decoding messages
PDUs MSISDNs WBXML
Receiving messages
Determining what was actually received
RingZero
https://luis.ringzero.net
Sending messages
AT interface
GSM modems support AT commands
AT+CMGS, AT+CMGW, etc
Different devices and chipsets vary in supported features Terminal needed, HyperTerminal, Minicom, PySerial
RingZero
https://luis.ringzero.net
Encoding/Decoding messages
Encode/Decode SMS
PDUSpy http://www.nobbi.com/pduspy.htm By hand
WBXML
libwbxml converts between XML and WBXML http://libwbxml.aymerick.com/ wbxml2xml.exe converts WBXML to XML xml2wbxml.exe converts XML to WBXML Python bindings available
RingZero
https://luis.ringzero.net
Receiving messages
Many phones drop or alter messages
By the time a user sees the message through the phones UI, the phone has already potentially modified In the case of special messages (ex: concatenated), the user wont see the message until all parts arrive This hides too much data from a tester, need to see the raw message that arrives from the carrier
To obtain access to raw incoming PDU, it is best to use modems or older phones with extremely limited functionality
New phones store messages in phone memory Old phones will write raw PDU directly to SIM
RingZero
https://luis.ringzero.net
Attack Environment
RingZero
https://luis.ringzero.net
Reduce Cost
$0.10-$0.50 per message gets expensive when youre fuzzing thousands of messages
RingZero
https://luis.ringzero.net
Currently only Windows Mobile allows complete Virtual MMS environment over WIFI
Needs new MMS server configuration WM 6.x needs registry key changes
HKEY_LOCAL_MACHINE\Comm\Cellular\WAP\WAPImpl\SMSOnlyPorts
RingZero
https://luis.ringzero.net
Message contents
SMIL
Markup language to describe content
Rich content
Images Audio/Video
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
CommCenter workaround
Attach to CommCenter Turn off all security
sysctl -w security.mac.proc_enforce=0 sysctl -w security.mac.vnode_enforce=0
RingZero
https://luis.ringzero.net
Attacks
RingZero
https://luis.ringzero.net
Implementation Vulnerability
Android flaw in parsing UDH for concatenated messages
Concatenated messages have a sequence number. Valid range is 01-FF.
Setting sequence to 00 triggers an unhandled invalid array exception.
RingZero
https://luis.ringzero.net
Reported to SwirlySpace
Thanks to Tommy and Mats!
RingZero
https://luis.ringzero.net
Configuration vulnerability
Who is responsible?
Much different from normal software vulnerabilities OEMs, OS vendors, carriers all play a role in product
RingZero
https://luis.ringzero.net
Configuration vulnerability
Microsoft recommends strict permissions for WAPSL
Do not put SECROLE_USER_UNAUTH security role in Service Loading (SL) Message Policy. In practice, many phones allow SECROLE_USER_UNAUTH WAP SL messages This means unauthenticated users executing binaries on phones. HKLM\Security\Policies\Policies (recommended values)
0x0000100c : 0x800 0x0000100d : 0xc00
RingZero
https://luis.ringzero.net
Architecture Attacks
Lots of behind-the-scenes administrative messages are sent from the carrier to the phone
If an attacker constructs a validly formatted message, phones usually interpret it accordingly Benign example: voicemail notifications
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
MMS Headers
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
Presenting
RingZero
https://luis.ringzero.net
T.A.F.T.
RingZero
https://luis.ringzero.net
T.A.F.T. ?!
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
About T.A.F.T.
Jailbroken iPhone application
Allows user the launch the attacks we have discussed in this presentation
RingZero
https://luis.ringzero.net
T.A.F.T. Architecture
RingZero
https://luis.ringzero.net
T.A.F.T. Architecture
RingZero
https://luis.ringzero.net
T.A.F.T. Architecture
RingZero
https://luis.ringzero.net
T.A.F.T. Architecture
RingZero
https://luis.ringzero.net
T.A.F.T. Architecture
RingZero
https://luis.ringzero.net
T.A.F.T. Architecture
RingZero
https://luis.ringzero.net
T.A.F.T Screenshots
RingZero
https://luis.ringzero.net
DEMO
RingZero
https://luis.ringzero.net
RingZero
https://luis.ringzero.net
Obtaining TAFT
Updates: http://www.twitter.com/taftapp
Email: taftapp@gmail.com
RingZero
https://luis.ringzero.net
Conclusions
RingZero
https://luis.ringzero.net
Conclusions
Many carrier-only messages can be sent by attackers
MMS Spoofing, OTA Settings, Voicemail are just the start of this vulnerability class
RingZero
https://luis.ringzero.net
Future Thoughts
SMS easier and easier to attack
RingZero
https://luis.ringzero.net
Q&A
RingZero
https://luis.ringzero.net
Thank you!
luis@ringzero.net
http://luis.ringzero.net
zane@isecpartners.com
http://www.isecpartners.com
RingZero
https://luis.ringzero.net
Email iSEC at blackhat@isecpartners.com Instantly receive all iSEC presentations and tools
RingZero
https://luis.ringzero.net
References
RingZero
https://luis.ringzero.net
Tools
PySIM aka PySimReader
Written by Todd Whiteman: http://simreader.sourceforge.net/ Originally designed as a simple tool to read and write phonebook and SMS entries from a SIM card Weve added the ability to use the tool to write arbitrary raw PDU strings to a SIM card for testing Also added verbose debugging output so you can see the raw PDUs that are stored on the SIM Our modified code available at: http://www.isecpartners.com/tools.html
RingZero
https://luis.ringzero.net
Tools
SIM writer
ACS ACR38t USB, PC/SC compliant, supported by everything we tried it out on ~$30 @ http://www.txsystems.com/acs.html
RingZero
https://luis.ringzero.net
Further Information
SMS Information:
http://www.3gpp.org/ftp/Specs/html-info/0340.htm http://www.dreamfabric.com/sms/ http://www.developershome.com/sms/ http://www.activexperts.com/activsms/sms/ http://mobileforensics.files.wordpress.com/2007/06/understanding_sms.pdf
Prior Research:
http://www.mulliner.org/pocketpc/feed/CollinMulliner_syscan07_pocketpcmms.pd f http://www.cs.ucdavis.edu/~hchen/paper/securecomm06.pdf http://www.blackhat.com/presentations/bh-europe-01/job-de-haas/bh-europe-01dehaas.ppt
RingZero
https://luis.ringzero.net