SlideShare a Scribd company logo
1 of 57
Download to read offline
@patrickwardle@colbymoore
“sources a global contingent of vetted security experts worldwide and
pays them on an incentivized basis to discover security vulnerabilities in
our customers’ web apps, mobile apps, and infrastructure endpoints.”
ABOUT (US)
@patrick	
  wardle	
  	
  
/NASA	
  /NSA	
  /VRL	
  /SYNACK
always looking for
more experts!
@colbymoore
/VRL	
  /SYNACK
vetted researchers
internal R&D
backed by google
geolocation bugs, hacks, & fixes
AN OUTLINE
all things geo case study fixes/conclusions
}
}
code bugs
lots of bugs
tracking users
ALL THINGS GEO
overview, code, & bugs
incorporating geolocation is the norm
GEOLOCATION IN MOBILE APPS
74% of smart phone users get info
based on their phone’s current location
Use Geo
No Geo
social
recommendations
health & fitness
commerce
navigation
“84%	
  inquire	
  about	
  location”
HOW IS GEOLOCATION ACCOMPLISHED (IOS)?
create delegate start
“The CLLocationManager class is the central point
for configuring the delivery of location-related events
to your app.” apple.com
wait/handle
using the Core Location Manager
‘doing it’ in Swift
GEOLOCATION (IOS)
//required	
  framework	
  	
  	
  
import	
  CoreLocation	
  
//conform	
  to	
  CLLocationManagerDelegate	
  
class	
  ViewController:	
  UIViewController,	
  CLLocationManagerDelegate	
  {	
  
	
  	
  	
  //[1]	
  CREATE	
  (instance	
  of)	
  location	
  manager	
  
	
  	
  	
  let	
  locationManager	
  =	
  CLLocationManager()	
  
	
  //app	
  delegate	
  function	
  
	
  	
  	
  override	
  func	
  viewDidLoad()	
  {	
  
	
  	
  	
  	
  	
  //[2]	
  set	
  DELEGATE	
  
	
  	
  	
  	
  	
  self.locationManager.delegate	
  =	
  self;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  //request	
  auth	
  
	
  	
  	
  	
  	
  self.locationManager.requestWhenInUseAuthorization()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  //[3]	
  START	
  collecting	
  location	
  
	
  	
  	
  	
  self.locationManager.startUpdatingLocation()

	
  	
  	
  }	
  
	
  	
  	
  //[4]	
  WAIT/HANDLE,	
  delegate	
  (callback)	
  function	
  
	
  	
  	
  func	
  locationManager(manager:	
  CLLocationManager!,	
  didUpdateLocations	
  locations:	
  [AnyObject]!)	
  {

	
  	
  	
  

	
  	
  	
  	
  	
  	
  //do	
  whateverz

	
  	
  	
  	
  	
  	
  //	
  -­‐>user’s	
  location	
  is	
  in	
  manager.location.coordinate.(latitude/longitude)	
  
	
  	
  	
  }	
  
}	
  
os-level alerts
GEOLOCATION (I)OS LEVEL PROTECTIONS
NSLocationWhenInUseUsageDescription:
//request	
  auth	
  for	
  foreground	
  
self.locationManager.requestWhenInUseAuthorization()
App’s	
  Info.plist
iOS alert
code for auth request
“allow the app to get location updates
only when the app is in the foreground”
os-level alerts
GEOLOCATION (I)OS LEVEL PROTECTIONS
//request	
  auth	
  for	
  foreground	
  
self.locationManager.requestAlwaysAuthorization()
App’s	
  Info.plist
iOS alert
code for auth request
“allows the app to receive location updates
both when the app is in the foreground and in
the background (suspended or terminated)”
NSLocationAlwaysUsageDescription:
…bad for users!
GEO CAN ‘LEAK’ IF THE APPLICATION IS BUGGY
“the government”
hackers
“spies could be lurking to snatch data
revealing the [app] player’s location”
-nytimes.com
thieves
criminals
…so what!?
THEY KNOW YOUR LOCATION
“investigators said the suspects used social networking
sites such as Facebook to identify victims who posted
online that they would not be home at a certain time” 

-thieves robbed homes based on facebook [3]
“a [geo]location allows perpetrators the perfect window to
commit a burglary, vandalism, or even a home invasion” 

-criminal use of social media [2]
“[geolocation] generates a precise, comprehensive record
of a person’s public movements that reflects a wealth of
detail about her familial, political, professional, religious,
and sexual associations” 

-u.s. v. jones [1]
1) http://scholarship.kentlaw.iit.edu/cgi/viewcontent.cgi?article=3332&context=fac_schol

2) http://www.nw3c.org/docs/whitepapers/criminal-use-of-social-media.pdf

3) http://www.wmur.com/Police-Thieves-Robbed-Homes-Based-On-Facebook-Social-Media-Sites/11861116
can compromise a user’s physical location
COMMON CLASSES OF GEO BUGZ
insecure network
comms
insecure local
storage
location spoofing
buggy server-side APIs
overly precise location
UI errors/validation
may allow passive attackers access to geo
INSECURE NETWORK COMMS
insecure network

comms
use unencrypted comms
allow self-signed certificates
forget to pin certificates
do not do these things!
find such bugs with a proxy
INSECURE NETWORK COMMS
https://
https://
http://
proxy (burp) config
device config
does the app accept self-signed certificates?
INSECURE NETWORK COMMS
MOVT	
  R8,	
  #(:upper16:(classRef_NSURLRequest	
  -­‐	
  0xC254))	
  
ADD	
  	
  R8,	
  PC	
  ;	
  classRef_NSURLRequest	
  
MOV	
  	
  R2,	
  #(selRef_setAllowsAnyHTTPSCertificate_forHost_	
  -­‐	
  0xC2A4)	
  
ADD	
  	
  R2,	
  PC	
  
LDR	
  	
  R4,	
  [R2]	
  	
   	
   ;"setAllowsAnyHTTPSCertificate:forHost:"	
  	
  	
  	
  
LDR	
  	
  R5,	
  [R8]	
  	
   	
   ;_OBJC_CLASS_$_NSURLRequest	
  	
  	
  	
  
MOV	
  	
  R0,	
  R5	
  	
   	
   	
   ;_OBJC_CLASS_$_NSURLRequest	
  	
  	
  	
  	
  	
  	
  
MOV	
  	
  R1,	
  R4	
  	
   	
   	
   ;"setAllowsAnyHTTPSCertificate:forHost:"	
  	
  	
  	
  	
  	
  	
  
MOVS	
  R2,	
  #1	
  	
   	
   	
   ;’YES’	
  	
  	
  	
  	
  	
  	
  
MOV	
  	
  R3,	
  R8	
  	
   	
   	
   ;	
  the	
  host	
  	
  	
  	
  	
  	
  	
  
BLX	
  	
  _objc_msgSend	
  
class
method
allowing a self-signed certificate (iOS)
setAllowsAnyHTTPSCertificate:forHost:
invoke method
did the app forget to pin certificates?
INSECURE NETWORK COMMS
non-jailbroken device
+
hacker’s cert
can	
  MitM	
  the	
  connection
“SSL pinning is a extra layer of security that
ensures a client will only communicate with
a well-defined set of servers”
stolen or lost phones may compromise user’s geo
INSECURE LOCAL STORAGE
insecure local
storage
store in unencrypted files
again, bad!
}
plists logfilesdatabases
find such bugs with filemon & fileDP
INSECURE LOCAL STORAGE
	
  //dump	
  file	
  attributes	
  	
  
NSLog(@"attrs: %@", [[[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil]
objectForKey:NSFileProtectionKey]);
display file’s protection attributes (iOS)
#	
  ./filemon	
  
Wheres_Waldo	
  Created	
  	
  /Application	
  Support/analytics/location.db-­‐journal	
  
DEV:	
  1,3	
  INODE:	
  121171	
  MODE:	
  81a4	
  UID:	
  501	
  GID:	
  501	
  Arg64:	
  300649589561	
  
Wheres_Waldo	
  Renamed	
  /Preferences/lastKnownLocation.plist.l0mitdo	
  
DEV:	
  1,3	
  INODE:	
  121172	
  MODE:	
  8180	
  UID:	
  501	
  GID:	
  501
monitoring app’s file I/O
on iOS, always check the user’s default plist
INSECURE LOCAL STORAGE
MOV	
  R1,	
  #(selRef_standardUserDefaults-­‐0x5917A)	
  
ADD	
  R1,	
  PC	
  
LDR	
  R1,	
  [R1]	
  	
   	
   	
  	
  ;"standardUserDefaults"	
  
MOV	
  R0,	
  #(classRef_NSUserDefaults-­‐0x591A2)	
  
ADD	
  R0,	
  PC	
  	
  
LDR	
  R0,	
  [R0]	
  	
   	
   	
  	
  ;_OBJC_CLASS_$_NSUserDefaults	
  
BLX	
  _objc_msgSend	
  ;[NSUserDefaults	
  standardUserDefaults]	
  
MOV	
  R3,	
  #(cfstr_geoInfo-­‐0x591D6)	
  
ADD	
  R3,	
  PC	
  	
  	
  	
   	
  	
  	
  	
  ;"geoInfo"	
  
LDR	
  R2,	
  [SP,#0xB4+usersGeo]	
   	
   ;geo	
  data	
  
MOV	
  R1,	
  #(selRef_setObject_forKey_-­‐0x591D6)	
  
ADD	
  R1,	
  PC	
  
LDR	
  R1,	
  [R1]	
  	
   	
   	
  	
  ;"setObject:forKey:"	
  
BLX	
  _objc_msgSend	
  ;[userDefaults	
  setObject:	
  forKey:]
app’s	
  /Library/Preferences/
with NSFileProtectionNone
App’s IDA disassembly
App’s ‘User Defaults’ plist
<dict>	
  
	
  	
  <key>geoInfo</key>	
  
	
  	
  <dict>

	
  	
  	
  	
  <key>homeLong</key>

	
  	
  	
  	
  <real>73.242539</real>

	
  	
  	
  	
  <key>homeLat</key>

	
  	
  	
  	
  <real>34.169308</real>	
  
	
  	
  	
  	
  ...

	
  	
  </dict>	
  
	
  </dict>
don’t trust geolocation from the client
LOCATION SPOOFING
location spoofing
be careful if you do this!
explicitly trust client-side geo
allow client’s (device’s)
location to rapidly change
}
user auth
access to
‘relative’ data
find such bugs by manipulating reported geo
LOCATION SPOOFING
edit to spoof geo!
editing network dataz
cycript (runtime manipulations)
location spoofing apps (from Cydia)
or
do apps really need precision to 12 decimal places?!
OVER PRECISE LOCATION
over precise
location
treat with care!
collect geolocation as precise
as possible
long: 73.242539906632…
~1km ~1m ~1mm
don’t specify a ‘desired accuracy’
(iOS defaults to highest)
sniffing (network or file I/O) or look at disassembly
OVER PRECISE LOCATION
//create	
  instance	
  of	
  location	
  manager	
  
let	
  locationManager	
  =	
  CLLocationManager()	
  
//set	
  ‘desired	
  accuracy’	
  
locationManager.desiredAccuracy	
  =	
  kCLLocationAccuracyBest;	
  
MOV	
  	
  	
  	
  R4,	
  #(_kCLLocationAccuracyBest_ptr	
  -­‐	
  0xACD8)	
  	
  
ADD	
  	
  	
  	
  R4,	
  PC,	
  R4	
  	
  	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ;	
  _kCLLocationAccuracyBest_ptr	
  
LDR	
  	
  	
  	
  R4,	
  [R4]	
  	
  	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ;	
  _kCLLocationAccuracyBest	
  
VLDR	
  	
  	
  D16,	
  [R4]	
  
VMOV	
  	
  	
  R2,	
  R3,	
  D16	
  	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ;	
  R2	
  contains	
  _kCLLocationAccuracyBest	
  
LDR	
  	
  	
  	
  R1,	
  [SP,#0xF8+selRef_setDesiredAccuracy]	
  
LDR	
  	
  	
  	
  R1,	
  [R1]	
   	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ;	
  R1	
  contains	
  selRef_setDesiredAccuracy	
  	
   	
  
	
   	
   	
   	
  
;R0	
  has	
  locationManager	
  object	
  
	
   	
  
LDR	
  	
  	
  	
  R9,	
  [SP,#0xF8+objc_msgSend]	
  	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ;	
  __imp__objc_msgSend	
  
;	
  objc_msgSend(locationManager,	
  “setDesiredAccuracy”,	
  _kCLLocationAccuracyBest);	
  
BLX	
  	
  	
  	
  R9	
  	
  	
  	
  	
   	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
IDA disassembly
setting ‘desired accuracy'
unprotected APIs may provide geo
INSECURE SERVER-SIDE APIS
insecure server-side
APIs
assume undocumented APIs are hidden
allow unlimited (un-throttled) queries
provide unrestricted geo
all bad assumptions/ideas!
allow unauthorized queries
sniffing network traffic often reveals undocumented API
INSECURE SERVER-SIDE APIS
holy $#!@, did we just find Carmen Sandiego!? ;)
intercepted outgoing request modified request
changed user
what lurks below?
USER-INTERFACE
user interface
assume the UI is ‘secure’
implement client-side
protection (in the UI)
all bad assumptions/ideas!
ignore user settings
don’t enforce anything at the UI level
USER INTERFACE
OR
}
ui settings ignored!
ui level logic 

(e.g. precision rounding)
client location still
sent to server
precise geolocation (of other users)
sent to device
buggy apps that compromised a user’s physical location
EXAMPLE OF GEO BUGS
starbucks whisper
angry birds
grindr
tinder
case-study
overpriced coffee, plus a shot of geo tracking
STARBUCKS
[CVE-2014-0647] Insecure Data Storage of User Data in
Starbucks v2.6.1 iOS mobile application (Daniel Wood)
/Library/Caches/com.crashlytics.data/
com.starbucks.mystarbucks/session.clslog
“[unencrypted] geolocation data included alongside
username and password data, meaning that hackers can
potentially see where a user most often traveled if they
were to access the phone”
“the safest place on the internet” - NOPE
WHISPER
users monitored/tracked
(even if opt’d out)
geo stored ‘indefinitely’
shared with the DOD
“”Revealed: how Whisper app tracks ‘anonymous’ users”
-the guardian
precise geo of nearby users, allowed tracking
TINDER
tinder user trilateration 

(blog.includesecurity.com)
main_photo_url =
photos[0]['url']
matches
‘tinderizer’
facebook profiles
…‘they’ are watching you play
ANGRY BIRDS
“the ABC have been developing capabilities to
take advantage of "leaky" smartphone apps,
such as the wildly popular Angry Birds game,
that transmit users' private information [geo]” 

-the guardian
Case Study - Grindr
many, many #$&@ up’s
(all-male) social-dating app
WHAT’S GRINDR?
“the largest and most popular all-male location-based
social network out there. more than 5 million guys in 192
countries around the world -- and approximately 10,000
more new users downloading the app every day” 

-grindr.com
all about
geo
extremely
popular
targeted
group
Those who cannot learn from history are doomed to repeat it
GRINDR’S PREVIOUS ISSUES
“Love online: 100,000 Grindr users
exposed in hack attack” 

-sydney morning herald
Grindr Application Security
Evaluation Report 

-university of amsterdam
“Grindr fails to protect user's”

-anonymous (pastebin)
Grindr Application Analysis
-synack
“0 Feet Away”
GRINDR (CASE STUDY)
lack of SSL pinning
overly precise geo
location spoofing
overly permissible APIs
broken ui level logic
sharing geo

client side precision
yes, so much wrong!
the app does not pin its certs
BUG 0X1: LACK OF SSL PINNING
login info
user geolocation
the app reported (overly) precise relative distances
BUG 0X2: REPORTING OF PRECISE GEO
primus.grindr.com

POST /2.0/nearbyProfiles
{"status":	
  1,	
  "distance":	
  3.861290174942267,	
  
"relationshipStatus":	
  1,	
  "displayName":	
  "Waldo",	
  

"isFavorite":	
  false,	
  "showDistance":	
  true,	
  

"height":	
  187.960006713867,"profileId":	
  12345678,	
  …}	
  
response
3.861290174942267 

km away
even newer versions may reveal precise location
BUG 0X2: REPORTING OF PRECISE GEO
//create	
  instance	
  of	
  location	
  manager	
  
let	
  locationManager	
  =	
  CLLocationManager()	
  
//set	
  ‘desired	
  accuracy’	
  
locationManager.desiredAccuracy	
  =	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  kCLLocationAccuracyNearestTenMeters;	
  
10 meter
location reporting
office
can spoof your location…as much as you want
BUG 0X3: LOCATION SPOOFING
geolocation coordinates for
locating ‘nearby’ users
change these at will!
trilateration?
unauthenticated, unlimited access to APIs
BUG 0X4: WIDE-OPEN APIS
{
"filter":{
"page":1,
"quantity":50
},
"lat":<any lat>,
"lon":<any lon>
}
primus.grindr.com

POST /2.0/nearbyProfiles
name height weight relative
distance
request for users’ info
user info
what you see/say isn’t what you get
BUG 0X5: ‘BROKEN’ UI LEVEL LOGIC
OR
}
if !showDistance
{
hide distance
}

+ settings
+ settings
UI level logic
srsly? wtf!
our goal was to help Grindr under the issues
DISCLAIMER
during vulnerability research and disclosure no individual
users were intentionally or unintentionally identified
all data logged has been irrecoverably destroyed.
The purpose of this research was not to identify Grindr
users but to help protect those that wish to remain private.
combining bugs can lead “total tracking”
IT'S MORPHIN' TIME
wide-open APIs
precise relative geo
location spoofing
+
+
=
tracking of any user
anywhere!
query the APIs to get info about all ‘nearby’ users
COLLECTION DATAZ
$	
  python	
  collectInfo.py	
  -­‐o	
  output.json	
  
	
  [+]	
  sent	
  request	
  to:	
  primus.grindr.com

	
  	
  	
  	
  	
  POST	
  /2.0/nearbyProfiles	
  	
  
	
  [+]	
  saving	
  response	
  (50	
  users)
$	
  less	
  output.json	
  
	
  "profiles":	
  [{	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "profileId":	
  314159265,	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "displayName":	
  "Waldo",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "aboutMe":	
  "Where	
  am	
  I?",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "distance":	
  0.4980983433684	
  
	
   	
   },	
  
	
   	
   ...
request
response
determine absolute location from relative distances
TRILATERATION
“trilateration is the process of determining absolute
locations by measurement of (relative) distances, using
the geometry of circles, spheres or triangles.”
$	
  python	
  findUser.py	
  -­‐i	
  314159265	
  
[+]	
  making	
  query	
  1,	
  2,	
  3	
  
	
  	
  	
  	
  got	
  three	
  relative	
  distances

[+]	
  converting	
  geodetic	
  lat/long	
  to	
  ECEF

[+]	
  transforming	
  
	
  	
  circle	
  1	
  at	
  origin,	
  circle	
  2	
  on	
  x	
  axis,	
  etc	
  
[+]	
  generating	
  array	
  with	
  ECEF	
  x,y,z	
  	
  
[+]	
  converting	
  ECEF	
  back	
  to	
  lat/long

[+]	
  user	
  is	
  at:	
  73.242539906632,	
  34.169308121551
trilateration script
so lets map some users
USER LOCATION
San Francisco
Sochi (olympics)
stores
capitols
so lets track some willing users
USER TRACKING
your life; revealed
it’d be trivial to reveal anonymous user’s identities
IDENTIFYING USERS
picture
geo tracking
from profile name
home work
} revealed!
...unfortunately this isn't just theoretical
IDENTIFYING USERS
"Anti-Gay North Dakota
Representative"
"Married Anti-Gay Pastor"
…didn’t care :/
REPORTING TO GRINDR
initial disclosure to vendor
followups included
conference calls, technical write-ups, & POCs
didn’t fix anything
“we do not view this as a security flaw”

-grindr.com/blog/grindr-security
…sadly it came to this to get (some) fixes
CAT GOT OUT OF THE BAG
“Egyptian officials have resorted to using location-
based dating app Grindr to arrest gay men"
“Grindr fails to protect their user’s” -
anonymous (pastebin)
people’s lives affected :(
fixes & current issues
GRINDR RESPONSE
}
user’s settings respected
geofencing (in Egypt, etc.)
geolocation
kCLLocationAccuracyNearestTenMeters
}
no SSL pinning open APIs spoofing
still can track
most users!
no rate limiting
Fixes/Conclusions
for users and devs alike
for users and app developers alike
BEST PRACTICES
assume you can be tracked
disallow tracking at the OS level
user
developer
secure comms
secure local storage
protected APIs
non-precise geo
correct UI logic
}
where’s waldo?!
QUESTIONS & ANSWERS
{colby,patrick}@synack.com
@colbymoore / @patrickwardle
…feel free to contact us any time!
credits
- thezooom.com
- deviantart.com (FreshFarhan)
- nicolevanputten.com
- http://agentfox.deviantart.com/art/chuck-Norris-hunting-waldo-42939561
- http://fc09.deviantart.net/fs70/f/2010/154/3/9/Waldo_by_MattMelvin.jpg
- http://th05.deviantart.net/fs71/PRE/i/2013/250/c/c/where_s_waldo_by_katanauser98-d6lgepy.png 

- iconmonstr.com
- flaticon.com
images

More Related Content

What's hot

Innovation and Security in Ruby on Rails
Innovation and Security in Ruby on RailsInnovation and Security in Ruby on Rails
Innovation and Security in Ruby on Rails
tielefeld
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
CODE BLUE
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
DVClub
 

What's hot (14)

iOS Automation Primitives
iOS Automation PrimitivesiOS Automation Primitives
iOS Automation Primitives
 
Deploying Next Gen Systems with Zero Downtime
Deploying Next Gen Systems with Zero DowntimeDeploying Next Gen Systems with Zero Downtime
Deploying Next Gen Systems with Zero Downtime
 
Innovation and Security in Ruby on Rails
Innovation and Security in Ruby on RailsInnovation and Security in Ruby on Rails
Innovation and Security in Ruby on Rails
 
Ns client++ icinga camp
Ns client++ icinga campNs client++ icinga camp
Ns client++ icinga camp
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
 
Finding Concurrency Errors in Event-Driven Applications - Strangeloop'14
Finding Concurrency Errors in Event-Driven Applications - Strangeloop'14Finding Concurrency Errors in Event-Driven Applications - Strangeloop'14
Finding Concurrency Errors in Event-Driven Applications - Strangeloop'14
 
NSClient++: Monitoring Simplified at OSMC 2013
NSClient++: Monitoring Simplified at OSMC 2013NSClient++: Monitoring Simplified at OSMC 2013
NSClient++: Monitoring Simplified at OSMC 2013
 
What we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at BackstopWhat we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at Backstop
 
Django productivity tips and tricks
Django productivity tips and tricksDjango productivity tips and tricks
Django productivity tips and tricks
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
 
OSMC 2013 | Making monitoring simple? by Michael Medin
OSMC 2013 | Making monitoring simple? by Michael MedinOSMC 2013 | Making monitoring simple? by Michael Medin
OSMC 2013 | Making monitoring simple? by Michael Medin
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational Processor
 
verilog code
verilog codeverilog code
verilog code
 

Similar to There's Waldo by Patrick Wardle & Colby Moore

Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Robert Nyman
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
Ipsit Dash
 

Similar to There's Waldo by Patrick Wardle & Colby Moore (20)

Synack at AppSec California 2015 - Geolocation Vulnerabilities
Synack at AppSec California 2015 - Geolocation VulnerabilitiesSynack at AppSec California 2015 - Geolocation Vulnerabilities
Synack at AppSec California 2015 - Geolocation Vulnerabilities
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
 
Angular js security
Angular js securityAngular js security
Angular js security
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 
Phone Gap
Phone GapPhone Gap
Phone Gap
 
Docker In Bank Unrated
Docker In Bank UnratedDocker In Bank Unrated
Docker In Bank Unrated
 
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ -  Automated Malware AnalysisIstSec'14 - İbrahim BALİÇ -  Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Automated malware analysis
Automated malware analysisAutomated malware analysis
Automated malware analysis
 
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONELUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
 
Hacking mobile apps
Hacking mobile appsHacking mobile apps
Hacking mobile apps
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
 
Secure Coding For Java - Une introduction
Secure Coding For Java - Une introductionSecure Coding For Java - Une introduction
Secure Coding For Java - Une introduction
 
Zenly - Reverse geocoding
Zenly - Reverse geocodingZenly - Reverse geocoding
Zenly - Reverse geocoding
 
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
IBM Cloud University: Build, Deploy and Scale Node.js MicroservicesIBM Cloud University: Build, Deploy and Scale Node.js Microservices
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
 
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesNode Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backend
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
 

More from Shakacon

Pwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCEPwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCE
Shakacon
 
Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS
Shakacon
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
Shakacon
 
Reviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android KernelReviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android Kernel
Shakacon
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
Shakacon
 

More from Shakacon (20)

Web (dis)assembly
Web (dis)assemblyWeb (dis)assembly
Web (dis)assembly
 
Macdoored
MacdooredMacdoored
Macdoored
 
I can be apple and so can you
I can be apple and so can youI can be apple and so can you
I can be apple and so can you
 
Cloud forensics putting the bits back together
Cloud forensics putting the bits back togetherCloud forensics putting the bits back together
Cloud forensics putting the bits back together
 
Pwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCEPwned in Translation - from Subtitles to RCE
Pwned in Translation - from Subtitles to RCE
 
Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS Oversight: Exposing spies on macOS
Oversight: Exposing spies on macOS
 
Modern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerModern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layer
 
Shamoon
ShamoonShamoon
Shamoon
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server:  A Dive into Attacker InfrastructureHoney, I Stole Your C2 Server:  A Dive into Attacker Infrastructure
Honey, I Stole Your C2 Server: A Dive into Attacker Infrastructure
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...
 
Reviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android KernelReviewing the Security of ASoC Drivers in Android Kernel
Reviewing the Security of ASoC Drivers in Android Kernel
 
Silent Protest: A Wearable Protest Network
Silent Protest:  A Wearable Protest NetworkSilent Protest:  A Wearable Protest Network
Silent Protest: A Wearable Protest Network
 
WiFi-Based IMSI Catcher
WiFi-Based IMSI CatcherWiFi-Based IMSI Catcher
WiFi-Based IMSI Catcher
 
Sad Panda Analysts: Devolving Malware
Sad Panda Analysts:  Devolving MalwareSad Panda Analysts:  Devolving Malware
Sad Panda Analysts: Devolving Malware
 
reductio [ad absurdum]
reductio [ad absurdum]reductio [ad absurdum]
reductio [ad absurdum]
 
XFLTReat: a new dimension in tunnelling
XFLTReat:  a new dimension in tunnellingXFLTReat:  a new dimension in tunnelling
XFLTReat: a new dimension in tunnelling
 
Windows Systems & Code Signing Protection by Paul Rascagneres
Windows Systems & Code Signing Protection by Paul RascagneresWindows Systems & Code Signing Protection by Paul Rascagneres
Windows Systems & Code Signing Protection by Paul Rascagneres
 
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
When Encryption is Not Enough...Sumanth Naropanth, Chandra Prakash Gopalaiah ...
 
The Search for the Perfect Door - Deviant Ollam
The Search for the Perfect Door - Deviant OllamThe Search for the Perfect Door - Deviant Ollam
The Search for the Perfect Door - Deviant Ollam
 

Recently uploaded

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (8)

FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 

There's Waldo by Patrick Wardle & Colby Moore

  • 2. “sources a global contingent of vetted security experts worldwide and pays them on an incentivized basis to discover security vulnerabilities in our customers’ web apps, mobile apps, and infrastructure endpoints.” ABOUT (US) @patrick  wardle     /NASA  /NSA  /VRL  /SYNACK always looking for more experts! @colbymoore /VRL  /SYNACK vetted researchers internal R&D backed by google
  • 3. geolocation bugs, hacks, & fixes AN OUTLINE all things geo case study fixes/conclusions } } code bugs lots of bugs tracking users
  • 5. incorporating geolocation is the norm GEOLOCATION IN MOBILE APPS 74% of smart phone users get info based on their phone’s current location Use Geo No Geo social recommendations health & fitness commerce navigation “84%  inquire  about  location”
  • 6. HOW IS GEOLOCATION ACCOMPLISHED (IOS)? create delegate start “The CLLocationManager class is the central point for configuring the delivery of location-related events to your app.” apple.com wait/handle using the Core Location Manager
  • 7. ‘doing it’ in Swift GEOLOCATION (IOS) //required  framework       import  CoreLocation   //conform  to  CLLocationManagerDelegate   class  ViewController:  UIViewController,  CLLocationManagerDelegate  {        //[1]  CREATE  (instance  of)  location  manager        let  locationManager  =  CLLocationManager()    //app  delegate  function        override  func  viewDidLoad()  {            //[2]  set  DELEGATE            self.locationManager.delegate  =  self;                              //request  auth            self.locationManager.requestWhenInUseAuthorization()                            //[3]  START  collecting  location          self.locationManager.startUpdatingLocation()
      }        //[4]  WAIT/HANDLE,  delegate  (callback)  function        func  locationManager(manager:  CLLocationManager!,  didUpdateLocations  locations:  [AnyObject]!)  {
      
            //do  whateverz
            //  -­‐>user’s  location  is  in  manager.location.coordinate.(latitude/longitude)        }   }  
  • 8. os-level alerts GEOLOCATION (I)OS LEVEL PROTECTIONS NSLocationWhenInUseUsageDescription: //request  auth  for  foreground   self.locationManager.requestWhenInUseAuthorization() App’s  Info.plist iOS alert code for auth request “allow the app to get location updates only when the app is in the foreground”
  • 9. os-level alerts GEOLOCATION (I)OS LEVEL PROTECTIONS //request  auth  for  foreground   self.locationManager.requestAlwaysAuthorization() App’s  Info.plist iOS alert code for auth request “allows the app to receive location updates both when the app is in the foreground and in the background (suspended or terminated)” NSLocationAlwaysUsageDescription:
  • 10. …bad for users! GEO CAN ‘LEAK’ IF THE APPLICATION IS BUGGY “the government” hackers “spies could be lurking to snatch data revealing the [app] player’s location” -nytimes.com thieves criminals
  • 11. …so what!? THEY KNOW YOUR LOCATION “investigators said the suspects used social networking sites such as Facebook to identify victims who posted online that they would not be home at a certain time” 
 -thieves robbed homes based on facebook [3] “a [geo]location allows perpetrators the perfect window to commit a burglary, vandalism, or even a home invasion” 
 -criminal use of social media [2] “[geolocation] generates a precise, comprehensive record of a person’s public movements that reflects a wealth of detail about her familial, political, professional, religious, and sexual associations” 
 -u.s. v. jones [1] 1) http://scholarship.kentlaw.iit.edu/cgi/viewcontent.cgi?article=3332&context=fac_schol
 2) http://www.nw3c.org/docs/whitepapers/criminal-use-of-social-media.pdf
 3) http://www.wmur.com/Police-Thieves-Robbed-Homes-Based-On-Facebook-Social-Media-Sites/11861116
  • 12. can compromise a user’s physical location COMMON CLASSES OF GEO BUGZ insecure network comms insecure local storage location spoofing buggy server-side APIs overly precise location UI errors/validation
  • 13. may allow passive attackers access to geo INSECURE NETWORK COMMS insecure network
 comms use unencrypted comms allow self-signed certificates forget to pin certificates do not do these things!
  • 14. find such bugs with a proxy INSECURE NETWORK COMMS https:// https:// http:// proxy (burp) config device config
  • 15. does the app accept self-signed certificates? INSECURE NETWORK COMMS MOVT  R8,  #(:upper16:(classRef_NSURLRequest  -­‐  0xC254))   ADD    R8,  PC  ;  classRef_NSURLRequest   MOV    R2,  #(selRef_setAllowsAnyHTTPSCertificate_forHost_  -­‐  0xC2A4)   ADD    R2,  PC   LDR    R4,  [R2]       ;"setAllowsAnyHTTPSCertificate:forHost:"         LDR    R5,  [R8]       ;_OBJC_CLASS_$_NSURLRequest         MOV    R0,  R5         ;_OBJC_CLASS_$_NSURLRequest               MOV    R1,  R4         ;"setAllowsAnyHTTPSCertificate:forHost:"               MOVS  R2,  #1         ;’YES’               MOV    R3,  R8         ;  the  host               BLX    _objc_msgSend   class method allowing a self-signed certificate (iOS) setAllowsAnyHTTPSCertificate:forHost: invoke method
  • 16. did the app forget to pin certificates? INSECURE NETWORK COMMS non-jailbroken device + hacker’s cert can  MitM  the  connection “SSL pinning is a extra layer of security that ensures a client will only communicate with a well-defined set of servers”
  • 17. stolen or lost phones may compromise user’s geo INSECURE LOCAL STORAGE insecure local storage store in unencrypted files again, bad! } plists logfilesdatabases
  • 18. find such bugs with filemon & fileDP INSECURE LOCAL STORAGE  //dump  file  attributes     NSLog(@"attrs: %@", [[[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil] objectForKey:NSFileProtectionKey]); display file’s protection attributes (iOS) #  ./filemon   Wheres_Waldo  Created    /Application  Support/analytics/location.db-­‐journal   DEV:  1,3  INODE:  121171  MODE:  81a4  UID:  501  GID:  501  Arg64:  300649589561   Wheres_Waldo  Renamed  /Preferences/lastKnownLocation.plist.l0mitdo   DEV:  1,3  INODE:  121172  MODE:  8180  UID:  501  GID:  501 monitoring app’s file I/O
  • 19. on iOS, always check the user’s default plist INSECURE LOCAL STORAGE MOV  R1,  #(selRef_standardUserDefaults-­‐0x5917A)   ADD  R1,  PC   LDR  R1,  [R1]          ;"standardUserDefaults"   MOV  R0,  #(classRef_NSUserDefaults-­‐0x591A2)   ADD  R0,  PC     LDR  R0,  [R0]          ;_OBJC_CLASS_$_NSUserDefaults   BLX  _objc_msgSend  ;[NSUserDefaults  standardUserDefaults]   MOV  R3,  #(cfstr_geoInfo-­‐0x591D6)   ADD  R3,  PC                ;"geoInfo"   LDR  R2,  [SP,#0xB4+usersGeo]     ;geo  data   MOV  R1,  #(selRef_setObject_forKey_-­‐0x591D6)   ADD  R1,  PC   LDR  R1,  [R1]          ;"setObject:forKey:"   BLX  _objc_msgSend  ;[userDefaults  setObject:  forKey:] app’s  /Library/Preferences/ with NSFileProtectionNone App’s IDA disassembly App’s ‘User Defaults’ plist <dict>      <key>geoInfo</key>      <dict>
        <key>homeLong</key>
        <real>73.242539</real>
        <key>homeLat</key>
        <real>34.169308</real>          ...
    </dict>    </dict>
  • 20. don’t trust geolocation from the client LOCATION SPOOFING location spoofing be careful if you do this! explicitly trust client-side geo allow client’s (device’s) location to rapidly change } user auth access to ‘relative’ data
  • 21. find such bugs by manipulating reported geo LOCATION SPOOFING edit to spoof geo! editing network dataz cycript (runtime manipulations) location spoofing apps (from Cydia) or
  • 22. do apps really need precision to 12 decimal places?! OVER PRECISE LOCATION over precise location treat with care! collect geolocation as precise as possible long: 73.242539906632… ~1km ~1m ~1mm don’t specify a ‘desired accuracy’ (iOS defaults to highest)
  • 23. sniffing (network or file I/O) or look at disassembly OVER PRECISE LOCATION //create  instance  of  location  manager   let  locationManager  =  CLLocationManager()   //set  ‘desired  accuracy’   locationManager.desiredAccuracy  =  kCLLocationAccuracyBest;   MOV        R4,  #(_kCLLocationAccuracyBest_ptr  -­‐  0xACD8)     ADD        R4,  PC,  R4                                                                  ;  _kCLLocationAccuracyBest_ptr   LDR        R4,  [R4]                                                                      ;  _kCLLocationAccuracyBest   VLDR      D16,  [R4]   VMOV      R2,  R3,  D16                                                                ;  R2  contains  _kCLLocationAccuracyBest   LDR        R1,  [SP,#0xF8+selRef_setDesiredAccuracy]   LDR        R1,  [R1]                                                                    ;  R1  contains  selRef_setDesiredAccuracy               ;R0  has  locationManager  object       LDR        R9,  [SP,#0xF8+objc_msgSend]                                  ;  __imp__objc_msgSend   ;  objc_msgSend(locationManager,  “setDesiredAccuracy”,  _kCLLocationAccuracyBest);   BLX        R9                                       IDA disassembly setting ‘desired accuracy'
  • 24. unprotected APIs may provide geo INSECURE SERVER-SIDE APIS insecure server-side APIs assume undocumented APIs are hidden allow unlimited (un-throttled) queries provide unrestricted geo all bad assumptions/ideas! allow unauthorized queries
  • 25. sniffing network traffic often reveals undocumented API INSECURE SERVER-SIDE APIS holy $#!@, did we just find Carmen Sandiego!? ;) intercepted outgoing request modified request changed user
  • 26. what lurks below? USER-INTERFACE user interface assume the UI is ‘secure’ implement client-side protection (in the UI) all bad assumptions/ideas! ignore user settings
  • 27. don’t enforce anything at the UI level USER INTERFACE OR } ui settings ignored! ui level logic 
 (e.g. precision rounding) client location still sent to server precise geolocation (of other users) sent to device
  • 28. buggy apps that compromised a user’s physical location EXAMPLE OF GEO BUGS starbucks whisper angry birds grindr tinder case-study
  • 29. overpriced coffee, plus a shot of geo tracking STARBUCKS [CVE-2014-0647] Insecure Data Storage of User Data in Starbucks v2.6.1 iOS mobile application (Daniel Wood) /Library/Caches/com.crashlytics.data/ com.starbucks.mystarbucks/session.clslog “[unencrypted] geolocation data included alongside username and password data, meaning that hackers can potentially see where a user most often traveled if they were to access the phone”
  • 30. “the safest place on the internet” - NOPE WHISPER users monitored/tracked (even if opt’d out) geo stored ‘indefinitely’ shared with the DOD “”Revealed: how Whisper app tracks ‘anonymous’ users” -the guardian
  • 31. precise geo of nearby users, allowed tracking TINDER tinder user trilateration 
 (blog.includesecurity.com) main_photo_url = photos[0]['url'] matches ‘tinderizer’ facebook profiles
  • 32. …‘they’ are watching you play ANGRY BIRDS “the ABC have been developing capabilities to take advantage of "leaky" smartphone apps, such as the wildly popular Angry Birds game, that transmit users' private information [geo]” 
 -the guardian
  • 33. Case Study - Grindr many, many #$&@ up’s
  • 34. (all-male) social-dating app WHAT’S GRINDR? “the largest and most popular all-male location-based social network out there. more than 5 million guys in 192 countries around the world -- and approximately 10,000 more new users downloading the app every day” 
 -grindr.com all about geo extremely popular targeted group
  • 35. Those who cannot learn from history are doomed to repeat it GRINDR’S PREVIOUS ISSUES “Love online: 100,000 Grindr users exposed in hack attack” 
 -sydney morning herald Grindr Application Security Evaluation Report 
 -university of amsterdam “Grindr fails to protect user's”
 -anonymous (pastebin) Grindr Application Analysis -synack
  • 36. “0 Feet Away” GRINDR (CASE STUDY) lack of SSL pinning overly precise geo location spoofing overly permissible APIs broken ui level logic sharing geo
 client side precision yes, so much wrong!
  • 37. the app does not pin its certs BUG 0X1: LACK OF SSL PINNING login info user geolocation
  • 38. the app reported (overly) precise relative distances BUG 0X2: REPORTING OF PRECISE GEO primus.grindr.com
 POST /2.0/nearbyProfiles {"status":  1,  "distance":  3.861290174942267,   "relationshipStatus":  1,  "displayName":  "Waldo",  
 "isFavorite":  false,  "showDistance":  true,  
 "height":  187.960006713867,"profileId":  12345678,  …}   response 3.861290174942267 
 km away
  • 39. even newer versions may reveal precise location BUG 0X2: REPORTING OF PRECISE GEO //create  instance  of  location  manager   let  locationManager  =  CLLocationManager()   //set  ‘desired  accuracy’   locationManager.desiredAccuracy  =                                                  kCLLocationAccuracyNearestTenMeters;   10 meter location reporting office
  • 40. can spoof your location…as much as you want BUG 0X3: LOCATION SPOOFING geolocation coordinates for locating ‘nearby’ users change these at will! trilateration?
  • 41. unauthenticated, unlimited access to APIs BUG 0X4: WIDE-OPEN APIS { "filter":{ "page":1, "quantity":50 }, "lat":<any lat>, "lon":<any lon> } primus.grindr.com
 POST /2.0/nearbyProfiles name height weight relative distance request for users’ info user info
  • 42. what you see/say isn’t what you get BUG 0X5: ‘BROKEN’ UI LEVEL LOGIC OR } if !showDistance { hide distance }
 + settings + settings UI level logic srsly? wtf!
  • 43. our goal was to help Grindr under the issues DISCLAIMER during vulnerability research and disclosure no individual users were intentionally or unintentionally identified all data logged has been irrecoverably destroyed. The purpose of this research was not to identify Grindr users but to help protect those that wish to remain private.
  • 44. combining bugs can lead “total tracking” IT'S MORPHIN' TIME wide-open APIs precise relative geo location spoofing + + = tracking of any user anywhere!
  • 45. query the APIs to get info about all ‘nearby’ users COLLECTION DATAZ $  python  collectInfo.py  -­‐o  output.json    [+]  sent  request  to:  primus.grindr.com
          POST  /2.0/nearbyProfiles      [+]  saving  response  (50  users) $  less  output.json    "profiles":  [{                                  "profileId":  314159265,                                  "displayName":  "Waldo",                                  "aboutMe":  "Where  am  I?",                                  "distance":  0.4980983433684       },       ... request response
  • 46. determine absolute location from relative distances TRILATERATION “trilateration is the process of determining absolute locations by measurement of (relative) distances, using the geometry of circles, spheres or triangles.” $  python  findUser.py  -­‐i  314159265   [+]  making  query  1,  2,  3          got  three  relative  distances
 [+]  converting  geodetic  lat/long  to  ECEF
 [+]  transforming      circle  1  at  origin,  circle  2  on  x  axis,  etc   [+]  generating  array  with  ECEF  x,y,z     [+]  converting  ECEF  back  to  lat/long
 [+]  user  is  at:  73.242539906632,  34.169308121551 trilateration script
  • 47. so lets map some users USER LOCATION San Francisco Sochi (olympics) stores capitols
  • 48. so lets track some willing users USER TRACKING your life; revealed
  • 49. it’d be trivial to reveal anonymous user’s identities IDENTIFYING USERS picture geo tracking from profile name home work } revealed!
  • 50. ...unfortunately this isn't just theoretical IDENTIFYING USERS "Anti-Gay North Dakota Representative" "Married Anti-Gay Pastor"
  • 51. …didn’t care :/ REPORTING TO GRINDR initial disclosure to vendor followups included conference calls, technical write-ups, & POCs didn’t fix anything “we do not view this as a security flaw”
 -grindr.com/blog/grindr-security
  • 52. …sadly it came to this to get (some) fixes CAT GOT OUT OF THE BAG “Egyptian officials have resorted to using location- based dating app Grindr to arrest gay men" “Grindr fails to protect their user’s” - anonymous (pastebin) people’s lives affected :(
  • 53. fixes & current issues GRINDR RESPONSE } user’s settings respected geofencing (in Egypt, etc.) geolocation kCLLocationAccuracyNearestTenMeters } no SSL pinning open APIs spoofing still can track most users! no rate limiting
  • 55. for users and app developers alike BEST PRACTICES assume you can be tracked disallow tracking at the OS level user developer secure comms secure local storage protected APIs non-precise geo correct UI logic } where’s waldo?!
  • 56. QUESTIONS & ANSWERS {colby,patrick}@synack.com @colbymoore / @patrickwardle …feel free to contact us any time!
  • 57. credits - thezooom.com - deviantart.com (FreshFarhan) - nicolevanputten.com - http://agentfox.deviantart.com/art/chuck-Norris-hunting-waldo-42939561 - http://fc09.deviantart.net/fs70/f/2010/154/3/9/Waldo_by_MattMelvin.jpg - http://th05.deviantart.net/fs71/PRE/i/2013/250/c/c/where_s_waldo_by_katanauser98-d6lgepy.png 
 - iconmonstr.com - flaticon.com images