Mobile
Security
part-2
iOS apps
Pen-
testing
Null Mumbai
PuliyaWorkshop
27 January 2018
RomanshYadav
copyright 2018 | Romansh Yadav | All right reserved.
Content
copyright 2018 | Romansh Yadav | All right reserved.
What is mobile
Security
Types of mobile
security
what is ios
iOS secuirty
architecture
Process of app
development.
Android apps file
structure.
Tools for the app
pen testing setup a lab owasp top 10
Power of Drozer MobSF
The power of
smart phone
.
• Smartphones have change our life.As IOT is coming the
number of smartphone uses will increased.
• Smartphone is like our new part of body.
• Company know the next market of business will be IOT
devices.
• Here mobile apps play a great role.
• You need to make sure you customer can use your
mobile apps with confidence.
copyright 2018 | Romansh Yadav | All right reserved.
What is mobile security
• Mobile application security testing can help ensure there aren’t any
loopholes in the software that may cause data loss.
• The sets of tests are meant to attack the app to identify possible
threats and vulnerabilities that would allow external persons or
systems to access private information stored on the mobile device.
copyright 2018 | Romansh Yadav | All right reserved.
Types of mobile apps security testing
• Static mobile apps security testing.
• Dynamic mobile apps security testing.
copyright 2018 | Romansh Yadav | All right reserved.
Static mobile apps security testing
• In the static mobile apps security testing ,we do testing when the code is in
rest mode.
• We review the source code and check hashing algorithm used in the code.
• We analysis the manifest.xml file.
copyright 2018 | Romansh Yadav | All right reserved.
Dynamic mobile apps security testing
• In the dynamic testing we do testing when the app is running or we can say
at the run time label.
• We analysis the flow and try to call the activity and many more .
copyright 2018 | Romansh Yadav | All right reserved.
Platform
for mobile
security
testing
iOS Windows Android Blackberry etc
copyright 2018 | Romansh Yadav | All right reserved.
What is iOS
iOS is a mobile operating system
created and developed by Apple Inc.
exclusively for its hardware.
• Lasted version 11.2.5
• Written in C.C++,objective
C,swift,initial release june 2007
•
copyright 2018 | Romansh Yadav | All right reserved.
iOS Security architecture
copyright 2018 | Romansh Yadav | All right reserved.
• Software
• -Hardware key
• -App sandbox
• -user Partition
• -kernel
• Hardware
• -crypto Enging
• -Device Key
• -Group key
• -Apple root Certificate
iOs IDE • An Integrated Development Environment (IDE) is a
software application that provides comprehensive
facilities to computer programmers for software
development
•X-code
copyright 2018 | Romansh Yadav | All right reserved.
BasicTools for iOS apps
Pen testing
• Brup suite
• putil
• otool
• cycript
•
copyright 2018 | Romansh Yadav | All right reserved.
Vulnerable apps
DVIA
http://damnvulnerableiosapp.com
•
copyright 2018 | Romansh Yadav | All right reserved.
Insecure data storage
copyright 2018 | Romansh Yadav | All right reserved.
• Core data
• Plist
• keyChain
• NSUserDefaults
• Webkit Caching
copyright 2018 | Romansh Yadav | All right reserved.
coredata
• Sqlite is a file based database.
• Install sqlite client
• find . -name *.db
• find . -name *.sqlite3
copyright 2018 | Romansh Yadav | All right reserved.
plist
• use to store application and user setting
• Plutil is a tool for inspect the file and convert it into human readable format.
• Data is serliazed
• /var/mobile/Library/Caches
• find . -name *.plist
• vim com.apple.mobile.installation.plist
• Plutil –convert xml1 com.apple.mobile.installation.plist
• Cat com.apple.mobile.installation.plist
copyright 2018 | Romansh Yadav | All right reserved.
Keychain
• Data is encrypted.
• Secure password, tokes,certificated.
• Keychain_dumper
copyright 2018 | Romansh Yadav | All right reserved.
Jailbreak Detection
copyright 2018 | Romansh Yadav | All right reserved.
• Once a device is jailbroken, a lot of other files and applications are installed
on the devcice. Checking for these files in the filesystem can help us identify
whether the device is jailbroken or not.
• Dump the class information of this app.
• class-dump DamnVulnerableIOSApp
copyright 2018 | Romansh Yadav | All right reserved.
Demo
• Ps aux | grep “damn”
• Cycript -p pid
• UIApp
• JailbreakDetectionVC.messages['isJailbroken'] = function () {return NO};
copyright 2018 | Romansh Yadav | All right reserved.
Runtime Manipulation
copyright 2018 | Romansh Yadav | All right reserved.
• We can bypass the login page via runtime manipulation.
• Let's ssh into our device and hook into our application using cycript.
•
copyright 2018 | Romansh Yadav | All right reserved.
Demo
• Ps aux | grep “damn”
• Cycript -p pid
• UIApp
• RuntimeManipulationDetailsVC.messages['isLoginValidated'] = function()
{return
• YES};
copyright 2018 | Romansh Yadav | All right reserved.
Side channel data
Leakage
copyright 2018 | Romansh Yadav | All right reserved.
• This vulnerability also called the logging based vulnerability.
• This is a mistake on the part of the developer. Such logs should be removed
before submitting an application to
• the app store as it might reveal important information. Optionally, the user
should enable logs only when the
• application is being run in the debug mode.
-snapshots path : -/var/mobile/Library/Caches/Snapshots
copyright 2018 | Romansh Yadav | All right reserved.
Insufficient transport layer
protection
copyright 2018 | Romansh Yadav | All right reserved.
• Transfer data from client to server in plain text.
• Now a days most application prefer to send data over Secure Channel to
prevent interception and leaking to an malicious user.
• We can check this kind of vulnerability by any proxy tool.
• We will use burpsuite.
copyright 2018 | Romansh Yadav | All right reserved.
• Now we are going to set a proxy in our ios device.
copyright 2018 | Romansh Yadav | All right reserved.
For https traffic
• For https traffic we have to install the burp self sign certificate.
•
copyright 2018 | Romansh Yadav | All right reserved.
SSl Certificate Pinning
• It means hard-coding the certificate known to be used by the server in the
mobile application.The app can then ignore the device’s trust store and rely
on its own, and allow only SSL connections to hosts signed with certificates
stored inside the application.
copyright 2018 | Romansh Yadav | All right reserved.
client side injection
copyright 2018 | Romansh Yadav | All right reserved.
• Sql injection-simple as we used in web application(Boolean based )
• JavaScript Injection: - If you have yourGoogle account attached to device
• then you can use your Google account inAndroid Browser without
authentication.
•
copyright 2018 | Romansh Yadav | All right reserved.
• <script>alert(1)</script>
• <script>document.location='tel://1123456789'</script>
• <script>document.location='twitter://post?message=Hello%20World'</scrip
t>.
• In this case you must
make sure that the twitter application is installed on your device.
copyright 2018 | Romansh Yadav | All right reserved.
Conclusion
copyright 2018 | Romansh Yadav | All right reserved.
• Owasp top 10
• Burp suite
• Cycript
• Class-dump
• Plutil
• otool
copyright 2018 | Romansh Yadav | All right reserved.
copyright 2018 | Romansh Yadav | All right reserved.
Thank you
I hope this information help you to
become a mobile Security Expert
copyright 2018 | Romansh Yadav | All
right reserved.

Mobile security part 2

  • 1.
    Mobile Security part-2 iOS apps Pen- testing Null Mumbai PuliyaWorkshop 27January 2018 RomanshYadav copyright 2018 | Romansh Yadav | All right reserved.
  • 2.
    Content copyright 2018 |Romansh Yadav | All right reserved. What is mobile Security Types of mobile security what is ios iOS secuirty architecture Process of app development. Android apps file structure. Tools for the app pen testing setup a lab owasp top 10 Power of Drozer MobSF
  • 3.
    The power of smartphone . • Smartphones have change our life.As IOT is coming the number of smartphone uses will increased. • Smartphone is like our new part of body. • Company know the next market of business will be IOT devices. • Here mobile apps play a great role. • You need to make sure you customer can use your mobile apps with confidence. copyright 2018 | Romansh Yadav | All right reserved.
  • 4.
    What is mobilesecurity • Mobile application security testing can help ensure there aren’t any loopholes in the software that may cause data loss. • The sets of tests are meant to attack the app to identify possible threats and vulnerabilities that would allow external persons or systems to access private information stored on the mobile device. copyright 2018 | Romansh Yadav | All right reserved.
  • 5.
    Types of mobileapps security testing • Static mobile apps security testing. • Dynamic mobile apps security testing. copyright 2018 | Romansh Yadav | All right reserved.
  • 6.
    Static mobile appssecurity testing • In the static mobile apps security testing ,we do testing when the code is in rest mode. • We review the source code and check hashing algorithm used in the code. • We analysis the manifest.xml file. copyright 2018 | Romansh Yadav | All right reserved.
  • 7.
    Dynamic mobile appssecurity testing • In the dynamic testing we do testing when the app is running or we can say at the run time label. • We analysis the flow and try to call the activity and many more . copyright 2018 | Romansh Yadav | All right reserved.
  • 8.
    Platform for mobile security testing iOS WindowsAndroid Blackberry etc copyright 2018 | Romansh Yadav | All right reserved.
  • 9.
    What is iOS iOSis a mobile operating system created and developed by Apple Inc. exclusively for its hardware. • Lasted version 11.2.5 • Written in C.C++,objective C,swift,initial release june 2007 • copyright 2018 | Romansh Yadav | All right reserved.
  • 10.
    iOS Security architecture copyright2018 | Romansh Yadav | All right reserved. • Software • -Hardware key • -App sandbox • -user Partition • -kernel • Hardware • -crypto Enging • -Device Key • -Group key • -Apple root Certificate
  • 11.
    iOs IDE •An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development •X-code copyright 2018 | Romansh Yadav | All right reserved.
  • 12.
    BasicTools for iOSapps Pen testing • Brup suite • putil • otool • cycript • copyright 2018 | Romansh Yadav | All right reserved.
  • 13.
  • 14.
    Insecure data storage copyright2018 | Romansh Yadav | All right reserved.
  • 15.
    • Core data •Plist • keyChain • NSUserDefaults • Webkit Caching copyright 2018 | Romansh Yadav | All right reserved.
  • 16.
    coredata • Sqlite isa file based database. • Install sqlite client • find . -name *.db • find . -name *.sqlite3 copyright 2018 | Romansh Yadav | All right reserved.
  • 17.
    plist • use tostore application and user setting • Plutil is a tool for inspect the file and convert it into human readable format. • Data is serliazed • /var/mobile/Library/Caches • find . -name *.plist • vim com.apple.mobile.installation.plist • Plutil –convert xml1 com.apple.mobile.installation.plist • Cat com.apple.mobile.installation.plist copyright 2018 | Romansh Yadav | All right reserved.
  • 18.
    Keychain • Data isencrypted. • Secure password, tokes,certificated. • Keychain_dumper copyright 2018 | Romansh Yadav | All right reserved.
  • 19.
    Jailbreak Detection copyright 2018| Romansh Yadav | All right reserved.
  • 20.
    • Once adevice is jailbroken, a lot of other files and applications are installed on the devcice. Checking for these files in the filesystem can help us identify whether the device is jailbroken or not. • Dump the class information of this app. • class-dump DamnVulnerableIOSApp copyright 2018 | Romansh Yadav | All right reserved.
  • 21.
    Demo • Ps aux| grep “damn” • Cycript -p pid • UIApp • JailbreakDetectionVC.messages['isJailbroken'] = function () {return NO}; copyright 2018 | Romansh Yadav | All right reserved.
  • 22.
    Runtime Manipulation copyright 2018| Romansh Yadav | All right reserved.
  • 23.
    • We canbypass the login page via runtime manipulation. • Let's ssh into our device and hook into our application using cycript. • copyright 2018 | Romansh Yadav | All right reserved.
  • 24.
    Demo • Ps aux| grep “damn” • Cycript -p pid • UIApp • RuntimeManipulationDetailsVC.messages['isLoginValidated'] = function() {return • YES}; copyright 2018 | Romansh Yadav | All right reserved.
  • 25.
    Side channel data Leakage copyright2018 | Romansh Yadav | All right reserved.
  • 26.
    • This vulnerabilityalso called the logging based vulnerability. • This is a mistake on the part of the developer. Such logs should be removed before submitting an application to • the app store as it might reveal important information. Optionally, the user should enable logs only when the • application is being run in the debug mode. -snapshots path : -/var/mobile/Library/Caches/Snapshots copyright 2018 | Romansh Yadav | All right reserved.
  • 27.
    Insufficient transport layer protection copyright2018 | Romansh Yadav | All right reserved.
  • 28.
    • Transfer datafrom client to server in plain text. • Now a days most application prefer to send data over Secure Channel to prevent interception and leaking to an malicious user. • We can check this kind of vulnerability by any proxy tool. • We will use burpsuite. copyright 2018 | Romansh Yadav | All right reserved.
  • 29.
    • Now weare going to set a proxy in our ios device. copyright 2018 | Romansh Yadav | All right reserved.
  • 30.
    For https traffic •For https traffic we have to install the burp self sign certificate. • copyright 2018 | Romansh Yadav | All right reserved.
  • 31.
    SSl Certificate Pinning •It means hard-coding the certificate known to be used by the server in the mobile application.The app can then ignore the device’s trust store and rely on its own, and allow only SSL connections to hosts signed with certificates stored inside the application. copyright 2018 | Romansh Yadav | All right reserved.
  • 32.
    client side injection copyright2018 | Romansh Yadav | All right reserved.
  • 33.
    • Sql injection-simpleas we used in web application(Boolean based ) • JavaScript Injection: - If you have yourGoogle account attached to device • then you can use your Google account inAndroid Browser without authentication. • copyright 2018 | Romansh Yadav | All right reserved.
  • 34.
    • <script>alert(1)</script> • <script>document.location='tel://1123456789'</script> •<script>document.location='twitter://post?message=Hello%20World'</scrip t>. • In this case you must make sure that the twitter application is installed on your device. copyright 2018 | Romansh Yadav | All right reserved.
  • 35.
    Conclusion copyright 2018 |Romansh Yadav | All right reserved.
  • 36.
    • Owasp top10 • Burp suite • Cycript • Class-dump • Plutil • otool copyright 2018 | Romansh Yadav | All right reserved.
  • 37.
    copyright 2018 |Romansh Yadav | All right reserved.
  • 38.
    Thank you I hopethis information help you to become a mobile Security Expert copyright 2018 | Romansh Yadav | All right reserved.