No Apology Required
Deconstructing BB10 CanSecWest 2014
No Apology Required Deconstructing BB10 CanSecWest 2014 - - PowerPoint PPT Presentation
No Apology Required Deconstructing BB10 CanSecWest 2014 Introduction Presentation is exploratory Research is on-going Body Level One Focused mostly on methodology, less on Body Level Two findings Body Level Three
Deconstructing BB10 CanSecWest 2014
methodology, less on findings
(since we may run out of time)
stereotypical Canadians apologize for everything
methodology, less on findings
(since we may run out of time)
stereotypical Canadians apologize for everything
Ben Nell bNull
Accuvant Labs Zach Lanier quine
Duo Security
Presentation foul: <--- mixing memes --->
— TabletOS on BB PlayBook
disclosure for Bridge/Balance (steal all the corporate data)
all the premium apps)
can exec*() / spawn*() and
unfettered (no perm’s req’d)
detached) child procs killed when app/parent ends
background services, but special perms required
contingent upon approval from RIM/BB signing service
research
USA ’13)
QNX/TabletOS/BB10 works
all Snapdragon S4 SoC)
8.0.0)
corporate PIM)
component
process manager - procnto
I/O, HMI, etc. into separate components
IPC (QNX message passing + POSIX IPC abstraction)
by Ilja van Sprundel, Tim Brown, Julio Cesar Fort, cenobite, and others
app permissions (allow, prompt, deny)
filesystem objects based on app permission requested
capabilities for certain permission types (e.g. “Headless apps”)
setting up (app) GID:rule mapping
to SapphireProxy (for BB Bridge) on 127.0.0.2
Dec 06 01:53:04 5 41 0 authman: RX euid=89/egid=0, 'defapp ext __def personal dual 100001000 100001000 sys.browser.gYABgJYFHAzbeFMPCCpYWBtHAm0 "Browser" "Research In Motion Limited" "gYAAgNpMbwE-h W4khx0h8BidUeI" run_when_backgrounded manage_certificates access_location_services use_camera record_audio access_shared access_internet post_notification gain_oma_fl_group access_oma_fl_write_personal acce ss_oma_fl_write_enterprise access_bbjma_data access_carrier_browser access_cclagent_service use_certmgr_server access_wifi_limited run_native permanent access_perimeter_personal' Dec 06 01:53:04 5 41 0 authman: Requested caps: Dec 06 01:53:04 5 41 0 authman: req:Allow execute Dec 06 01:53:04 5 41 0 authman: Applying execute Dec 06 01:53:04 5 41 0 authman: pf_remove_gid: scanning anchors for gid=100001000 Dec 06 01:53:04 5 41 0 authman: Requested caps: Dec 06 01:53:04 5 41 0 authman: req:Allow run_when_backgrounded Dec 06 01:53:04 5 41 0 authman: req:Allow manage_certificates Dec 06 01:53:04 5 41 0 authman: req:Allow access_location_services Dec 06 01:53:04 5 41 0 authman: req:Allow use_camera Dec 06 01:53:04 5 41 0 authman: req:Allow record_audio Dec 06 01:53:04 5 41 0 authman: req:Allow access_shared Dec 06 01:53:04 5 41 0 authman: req:Allow access_internet Dec 06 01:53:04 5 41 0 authman: req:Allow gain_oma_fl_group Dec 06 01:53:04 5 41 0 authman: req:Allow access_oma_fl_write_personal Dec 06 01:53:04 5 41 0 authman: req:Allow access_oma_fl_write_enterprise Dec 06 01:53:04 5 41 0 authman: req:Allow access_bbjma_data Dec 06 01:53:04 5 41 0 authman: req:Allow access_carrier_browser Dec 06 01:53:04 5 41 0 authman: req:Allow access_cclagent_service Dec 06 01:53:04 5 41 0 authman: req:Allow use_certmgr_server Dec 06 01:53:04 5 41 0 authman: req:Allow access_wifi_limited Dec 06 01:53:04 5 41 0 authman: req:Allow run_native Dec 06 01:53:04 5 41 0 authman: req:Allow permanent Dec 06 01:53:04 5 41 0 authman: req:Allow access_perimeter_personal Dec 06 01:53:04 5 41 0 authman: Applying run_when_backgrounded Dec 06 01:53:04 5 41 0 authman: Applying manage_certificates Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=060, /pps/services/certmgr/control Dec 06 01:53:04 5 41 0 authman: Applying access_location_services Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=040, /pps/services/cellular/radioctrl/status_cell_cdma_private Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=040, /pps/services/cellular/radioctrl/status_cell_private Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=040, /pps/services/cellular/radioctrl/status_private Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=040, /pps/services/radioctrl/modem0/status_private Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=060, /pps/services/geolocation/geomonitor/control Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=050, /pps/services/geolocation/geomonitor Dec 06 01:53:04 5 41 0 authman: set_acl_group_perms: gid=100001000, perms=060, /pps/services/geolocation/control
“Capabilities” based
ACLs based on permissions pf rule(s)
Message passing
Shared memory Pipes FIFOs Message copying Simple messages Channels Events (pulses, signals, unblocks) Typed memory
Signals
Kernel Kernel External process/manager
C/C++
Flash/AS/ HTML/JS
HTML/JS Java/DEX
20 app perms documented 340 unique app & sys perms observed
GIDs (incl. supplemental GIDs)
stores
https://www.sec-consult.com/fxdata/seccons/prod/downloads/sec_consult_vulnerability_lab_blackberry_z10_initial_analysis_v10.pdf
QNX Foundry
golden…
Speaking of Google dorks…
Some random RIM employee’s file dump? Upcoming product feature assessment
hardware code names
Upcoming project effort estimations/ release dates
Some random RIM employee’s file dump? Internal bug tracker
internal URL
RIM wants to get your hacking^Wdevelopment projects up and running as quickly as possible! Lots of SDK stuff, including a native SDK, giving us:
and tons more
Development Tools Sample code
Momentics target navigator Proc/thread mem info FS nav, etc. Controller app Controls NFC, Camera, geoloc, etc. for Simulator
builds of the typical toolchain
Blackberry Simulator QNX Software Dev Platform (SDP)
to the real thing
the real thing
“platform” debug tool
environment
* - with a bit of work
Just another box on the network
friends)
There are lots of network services Twist:
BB10 network services
Dec 07 16:14:20.041 sys.pim.contacts.gYABgGsAOuzqCT1fu5Zx4sqrJdY.28930195 default 9000 [ServiceManager] refreshing accounts list Dec 07 16:14:20.042 sys.pim.contacts.gYABgGsAOuzqCT1fu5Zx4sqrJdY.28930195 default 9000 Calling AccountServicePrivate::accounts for service "contacts" Dec 07 16:14:20.042 sys.pim.contacts.gYABgGsAOuzqCT1fu5Zx4sqrJdY.28930195 default 9000 Calling AccountServicePrivate::accounts Dec 07 16:14:20.044 sys.pim.messages.gYABgJ8jn83Ok_NEWYplPYozt5w.3567740 default 9000 MNH(93): handleAccountUpdated accountId 4 Dec 07 16:14:20.045 sys.pim.messages.gYABgJ8jn83Ok_NEWYplPYozt5w.3567740 default 9000 Calling AccountServicePrivate::account for AccountKey = 4 Dec 07 16:14:20.052 sys.pim.messages.gYABgJ8jn83Ok_NEWYplPYozt5w.3567740 default 9000 GET 0x13 Dec 07 16:14:20.052 sys.pim.messages.gYABgJ8jn83Ok_NEWYplPYozt5w.3567740 default 9000 URL Buffer: http://127.0.0.1:8888/ accounts/4
Dec 07 16:14:20.066 sys.pim.contacts.gYABgGsAOuzqCT1fu5Zx4sqrJdY.28930195 default 9000 URL Buffer: http://127.0.0.1:8888/ accounts
Dec 07 16:14:20.080 sys.pim.contacts.gYABgGsAOuzqCT1fu5Zx4sqrJdY.28930195 default 9000 Curl Easy perform Dec 07 16:14:20.081 menu_service.2830447 menu_svc_logs 0 MS PIMCORE: command: GET method: /accounts URL:http:// 127.0.0.1:8888/accounts Dec 07 16:14:20.082 phone.3567743 phone 0 [ I][18][PlatformContact:lookupByPhoneNu| 107] ContactService returns 0 contacts for number '1212xxxxx40'.
For the things that can’t be watched
Installation bundles
non-factory packages
info
% zipinfo -l1 ./Gooby/arm/o.le-v7/Gooby-1_0_0_1.bar META-INF/MANIFEST.MF META-INF/AUTHOR.SF META-INF/AUTHOR.EC META-INF/RDK.SF META-INF/RDK.EC native/bar-descriptor.xml native/icon.png native/assets/main.qml native/qm/Gooby.qm native/Gooby.so native/GoobyService native/assets/.assets.index
MANIFEST.MF: Package Meta Info
MANIFEST.MF: Application Meta Info
MANIFEST.MF: Entry Point Info
MANIFEST.MF: Entry Point Info
Getting Firmware
some good tools
http://forums.crackberry.com/bb10-leaked-beta-os-f395/sachesi-firmware-extractor-searcher-installer-825409/
Getting Into the Firmware
https://github.com/intrepidusgroup/pbtools
Shell Scripts
success! from “startup.sh”
Python: For everything important on BB10 that isn’t written in bash
Python (bytecode; *.pyc)
https://code.google.com/p/unpyc3/
ActionScript
qnx.AIRServices.ota.OtaUpdate
Compiled binaries
disassembly might be your best/only bet for dorking with many network services
http://www.harkavagrant.com/?id=250
Where the device accepts data
caught our eye
scanners / fuzzers
(or able to attach to channel but unable to send)
times during mass channel scans
$ ./scanchan.py 643092 Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] [+] PID: 643092 - Connected to channel: 2 [-] PID: 643092 - Error for channel 6: [Errno 1] Operation not permitted
$ ./fchan1.py 1019928 16 [+] PID: 1019928 - Connected to channel: 16 (48, b"AAAAAAAAAAAAAAAA(coid, b'Hello!')\n c \x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x0 0\x00\x00O\x00\x00\x00s\x16\x00\x00\x00|\x01\x00| \x00\x00_\x00\x00|\x02\x00|\x00\x00_\x01\x00d \x00\x00S(\x01\x00\x00\x00N(\x02\x00\x00\x00u \x04\x00\x00\x00argsu\x06\x00\x00\x00…
Local-hosted CGI scripts are used for device management “stuff”
functions happen over HTTP/ SMB with the option of
gateway
problematic areas observable
Ethernet!
(WWW/SMB), with additional capabilities
tablet
BlackBerry “Bridge” / SapphireProxy
This service has had problems in the past… *
* Barely recognizable BattleStar reference
It works and there are no security problems?
explored this
likely bad NDEF message parsing by 3rd party native apps
side attacks
file and network resources
escalations are like gold
separation between personal and enterprise applications, data, and network resources
controlled by BES and enforced locally
Concerned Consumer: Sounds great. How does it work? I am familiar with the iOS security model and might expect to see some sort of sandboxing technology to enforce this separation.
RIM: I don’t want to say that it’s all based on file permissions… …but it’s all based on file permissions
zach@n0where.org zach@duosecurity.com
[NO_EMAIL_PROVIDED]
<--shameless plug