SlideShare a Scribd company logo
Security testing in mobile
applications
José Manuel Ortega Candel
About me
 Centers Technician at Everis
 Computer engineer by Alicante University
 Frontend and backend developer in Java/J2EE
 Speaker site with some presentations in
mobile and security
https://speakerdeck.com/jmortega
Index
Security Testing for Mobile Apps
Risk Management & Security Threads
Vulnerabilities & Mobile Security Risks
Testing Components Security & Tools
Security Test Plan & Best Practices
Security Testing for Mobile Apps
Security Testing for Mobile Apps
White Box Testing
Static Analysis Code
Black Box Testing
Dinamyc Analysis at
Runtime
Static Application Security Testing
Source code Review Reverse engineering
Lint for Android
Studio
Sonar Plugins for
mobile
http://www.sonarqube.org
Static Application Security Testing
Static Application Security Testing
https://github.com/SonarCommunity/sonar-android
Static Application Security Testing
http://sourceforge.net/projects/agnitiotool
You can decompile APKs and
search calls dangerous functions.
Reverse engineering on Android
APK Tool /Dex2jar/Java Decompiler
Static analysis on iOS
Xcode Development environment
Apple Developer Tools
‘otool’ command provided by XCode can be used to
get information from iOS application binaries and can
be used to support security analysis.
Static analysis on iOS
Detect memory leaks with XCode
Clang Static Analyzer
http://clang-analyzer.llvm.org
Flawfinder(Security weakness in C/C++)
http://www.dwheeler.com/flawfinder
Dynamic Application Security Testing
Analyze Network
Traffic at runtime
Analyze Remote
Services
DroidBox for Android
Instruments for iOS
Discovering logical
vulnerabilities
Dynamic Application Security Testing
 https://code.google.com/p/droidbox
Monitoring Actions
 Information leaks Network IO and File IO
 Cryptography operations SMS and Phone calls
Dynamic Application Security Testing
Instruments for iOS applications
File Activity Monitoring
Memory Monitoring Process Monitoring
Network Monitoring
Application Security Analyser
python androwarn.py -i my_apk.apk -r html -v 3
Telephony identifiers exfiltration: IMEI, IMSI, MCC, MNC, LAC, CID, operator's
name...
Device settings exfiltration: software version, usage statistics, system settings, logs...
Geolocation information leakage: GPS/WiFi geolocation... Connection interfaces
information exfiltration: WiFi credentials, Bluetooth MAC adress...
Telephony services abuse: premium SMS sending, phone call composition...
Audio/video flow interception: call recording, video capture... Remote connection
establishment: socket open call, Bluetooth pairing, APN settings edit...
PIM data leakage: contacts, calendar, SMS, mails...
External memory operations: file access on SD card...
PIM data modification: add/delete contacts, calendar events... Arbitrary code
execution: native code using JNI, UNIX command, privilege escalation...
Denial of Service: event notification deactivation, file deletion, process killing, virtual
keyboard disable, terminal shutdown/reboot...
Risk Management
Intelligence
Gathering
Threat model
Vulnerabilities
OWASP
Security risks
Security
threads
Intelligence Gathering
Environmental
Analysis
Architectural
Analysis
Analyze internal
processes and structures
App [network interfaces, used
data, communication with other
resources, session management]
Runtime environment [MDM,
jailbreak/rooting, OS version]
Backend services [application
server, databases]
Intelligence Gathering
What type of device is it?
Determine Operating System version
Is the device already rooted?
Is the device passcode enabled?
What key applications are installed?
Is the device connected to network?
Thread model in Mobile applications
Functional Security threads
Authentication
Session
Management
Access Control
Input Validation
Cryptography
Error Handling and
Logging
Data Protection
Communication
Security
Security issues
Malicious Applications
– Rooting Exploits
– SMS Fraud
– Rapid Malware Production
Dynamic Analysis
– Sandbox
– Real-time Monitoring
– Mobile Specific Features
Static Analysis
– Permissions
– Data Flow
– Control Flow
Browser Attacks
– Phishing
– Click Through
Mobile Botnets
– Epidemic Spread
– Attacking Network Services
– Tracking Uninfected Devices
User Education
– Ignoring Permissions
– Phishing
– Improperly Rooting Devices
– Alternative Markets
Vulnerabilities
Third party
libraries
Components
WebView
[JavaScript+Cache]
SQLite DataBase
Multiplaftorm
libraries for hybrid apps
Shared Preferences
Vulnerabilities
1. Activity monitoring and
data retrieval
2. Unauthorized dialing,
SMS, and payments
3. Unauthorized network
connectivity (exfiltration or
command & control)
4. UI Impersonation
5. System modification
(rootkit, APN proxy config)
6. Logic or Time bomb
7. Sensitive data leakage
(inadvertent or side
channel)
8. Unsafe sensitive data
storage
9. Unsafe sensitive data
transmission
10. Hardcoded
password/keys
Vulnerabilities Analysis
Static methods
Dynamic
methods
Automatic and manual
source code analysis
Reverse Engineering
Forensic
methods
Network monitoring and
trafic analyzing
Runtime analysis
Log analysis
File permission analysis
File content analysis
Dynamic methods tools
Network monitoring and
traffic analyzing
Runtime analysis
Wireshark, BurpSuite
GNU debugger,
Snoop-it, Cycript
Mercury, Intent Sniffer,
Intent Fuzzer
File analysis androidAuditTools
Testing vulnerabilities
Data flow
Data Storage
Data leakage
Authentication
Authorization
Server-side
OWASP Mobile Security Risks
Insecure Data
Storage
Transport Layer
Protection,
HTTP/SSL
Authorization and
Authentication
Cryptography /
Encrypting data
Session handling
Weak Server Side
Controls in backend
services
Sensitive information
[passwords,API
keys,code ofuscation]
Data Leakage [cache,
logging, temp
directories]
Testing components security
Content Providers Data Storage
WebViewServices
NetWork Connections
[HTTP / SSL]
Certificates
Data Encryption
SQLite
Shared Preferences
File storage
HTTPS and SSL can protect against Man in the Middle
attacks and prevent casual snooping
Data Storage
Encrypt data
Never store user credentials
Tools like SQLCipher for storing
database in applications
No global permissions granted to
applications, using the principle of
"least privilege".
Secure Storage on Android
The access permission of the created file was set to
WORLD_READABLE / WORLD_WRITABLE
Other app could read /write the file if the file path is known.
Application data (private files) should be created
with the access permission MODE_PRIVATE
FileOutputStream fos = openFileOutput(“MyFile",
Context.MODE_PRIVATE);
fos.write(“contenido”.getBytes());
fos.close();
Insecure Data on Android
Look for file open operations using
Context.MODE_WORLD_READABLE
(translates to “1”)
Secure Storage on iOS
NSFileManager class
NSFileProtectionKey attribute
 NSFileProtectionNone – Always accessible
 NSFileProtectionComplete – Encrypted on disk
when device is locked or booting
[[NSFileManager defaultManager] createFileAtPath:[self
filePath]
contents:[@"super secret file contents“
dataUsingEncoding:NSUTF8StringEncoding]
attributes:[NSDictionary
dictionaryWithObject:NSFileProtectionComplete
forKey:NSFileProtectionKey]];
DataBase Storage
Support iOS / Android
https://www.zetetic.net/sqlcipher/open-source
256-bit AES Encrypt SQLite database
Secure Preferences on Android
https://github.com/scottyab/secure-preferences
3rd-party extensions
Secure Shared Preferences
Cryptography
Android and iOS implement standard crypto libraries such as AES
algorithm
try{
PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt,
PBE_ITERATION_COUNT, 256);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(PBE_ALGORITHM);
SecretKey tmp = keyFactory.generateSecret(keySpec);
// Encrypt
SecretKey secret = new SecretKeySpec(tmp.getEncoded(), "AES");
Cipher encryptionCipher = Cipher.getInstance(CIPHER_ALGORITHM);
IvParameterSpec ivspec = new IvParameterSpec(initVector);
encryptionCipher.init(Cipher.ENCRYPT_MODE, secret, ivspec);
encryptedText = encryptionCipher.doFinal(cleartext.getBytes());
// Encode encrypted bytes to Base64 text to save in text file
result = Base64.encodeToString(encryptedText, Base64.DEFAULT);
} catch (Exception e) {
e.printStackTrace()
}
Android provides the javax.crypto.spec.PBEKeySpec
and javax.crypto.SecretKeyFactory classes to facilitate
the generation of the password-based encryption key.
Avoid Data Leackage on Android
public static final boolean SHOW_LOG =
BuildConfig.DEBUG;
public static void d(final String tag, final String msg) {
if (SHOW_LOG)
Log.d(tag, msg);
}
Don't expose data through logcat on production
-assumenosideeffects class android.util.Log
{
public static *** d(...);
public static *** v(...);
public static *** i(...);
public static *** e(...);
}
Proguard configuration
Permissions in mobile apps
AndroidManifest.xml on Android
 Try to minimize permissions
<manifest package="com.example.android" …>
<uses-permission android:name=“android.permission.
ACCESS_FINE_LOCATION"/>
<uses-permission
android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.READ_CONTACTS" />
…
</manifest>
Permissions in mobile apps
info.plist on iOS
Vulnerability scanner on Android
Vulnerability scanner on Android
Vulnerability scanner on Android
Tools / Santoku Linux
Security test plan
Test cases Example
Test Title /level Encryption /critical
Test
Description
When connections are used encryption
is used for sending / receiving sensitive
data.
Details and
tools
All sensitive information (personal data,
credit card & banking information etc.)
must be encrypted during transmission
over any network or communication
link.
Expected
result
It has been declared that the
Application uses encryption when
communicating sensitive data.
Security test plan
Test cases Example
Test Title /level Passwords /critical
Test
Description
Passwords and sensitive data are not
stored in the device and not echoed
when entered into the App, sensitive
data is always protected by password.
Details and
tools
The objective of the test is to minimize
the risk of access to sensitive
information should the device be lost,
by ensuring that no authentication data
can be re-used by simply re-opening
the application
Security test plan
Test cases Example
Test Title /level Passwords /critical
Expected
result
1. Entering a password or other
sensitive data will not leave it in
clear text if completion of the fields
is interrupted but not exited.
2. Passwords, credit card details, or
other sensitive data do not remain
in clear text in the fields where they
were previously entered, when the
application is reentered.
3. Sensitive personal data should
always need entry of a password
before it can be accessed.
Best Practices
Integrate security in Continuous
Integration (CI) process
Apply encryption /decryption techniques
used for sensitive data communication
Detect areas in tested application that have
more risks to detect vulnerabilities
Install an automated security vulnerability
scanner, integrated with your continuous
integration tool
Security testing in mobile applications
Attacker vs Defenders
Defenders Attackers
Often have limited time to
put defences in place
Can take time to plan their
attack
Have limited opportunities
to improve their defences
Can invent new ways to
attack
Need to defend against a
range of possible attacks
Need only pick the most
effective one
Need to defend all entry
points
Can choose where to
attack
Has limited resources to
defend
Can be multiple attackers
References
https://www.owasp.org/index.php/OWASP_Mobile_Security_
Project
http://developer.android.com/training/articles/security-
tips.html
OWASP Mobile Security Project
Android Security Best Practices
References
https://github.com/secmobi/wiki.secmobi.com
Tools
IOS Application Security Testing
https://www.owasp.org/index.php/IOS_Application_Security_
Testing_Cheat_Sheet
Books
Thank You,
Questions?

More Related Content

What's hot (20)

PPTX
Mobile security
Tapan Khilar
 
PPT
Introduction To OWASP
Marco Morana
 
PDF
Android Hacking
antitree
 
PPTX
Ethical Hacking Certifications | Certified Ethical Hacker | Ethical Hacking |...
Simplilearn
 
PDF
Android Security & Penetration Testing
Subho Halder
 
PPTX
Mobile Application Security
Ishan Girdhar
 
PPTX
Introduction to penetration testing
Nezar Alazzabi
 
PDF
Mobile Security
MarketingArrowECS_CZ
 
PDF
Secure Code Review 101
Narudom Roongsiriwong, CISSP
 
PDF
Mobile Security 101
Lookout
 
PPTX
Android security
Midhun P Gopi
 
PPT
Android Security
Suminda Gunawardhana
 
PDF
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 
PPTX
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
Ajin Abraham
 
PPTX
Website hacking and prevention (All Tools,Topics & Technique )
Jay Nagar
 
PDF
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
PPTX
iOS Application Static Analysis - Deepika Kumari.pptx
deepikakumari643428
 
PDF
OWASP Top 10 for Mobile
Appvigil - Mobile App Security Scanner
 
PPTX
OWASP Top 10 2021 What's New
Michael Furman
 
PDF
Android Security
Lars Jacobs
 
Mobile security
Tapan Khilar
 
Introduction To OWASP
Marco Morana
 
Android Hacking
antitree
 
Ethical Hacking Certifications | Certified Ethical Hacker | Ethical Hacking |...
Simplilearn
 
Android Security & Penetration Testing
Subho Halder
 
Mobile Application Security
Ishan Girdhar
 
Introduction to penetration testing
Nezar Alazzabi
 
Mobile Security
MarketingArrowECS_CZ
 
Secure Code Review 101
Narudom Roongsiriwong, CISSP
 
Mobile Security 101
Lookout
 
Android security
Midhun P Gopi
 
Android Security
Suminda Gunawardhana
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
Ajin Abraham
 
Website hacking and prevention (All Tools,Topics & Technique )
Jay Nagar
 
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
iOS Application Static Analysis - Deepika Kumari.pptx
deepikakumari643428
 
OWASP Top 10 2021 What's New
Michael Furman
 
Android Security
Lars Jacobs
 

Viewers also liked (9)

PDF
Bridging the gap - Security and Software Testing
Roberto Suggi Liverani
 
PDF
Rajasekar R_resume_Mobile Testing
Rajasekar Dpi
 
PDF
Security Testing Mobile Applications
Denim Group
 
PDF
Mobile Security
Xavier Mertens
 
PPTX
Hijack rat android malware
Hamid Shekarforoush
 
PPTX
Mobile application testing
Softheme
 
DOC
Manoj resume
tekwissen
 
DOC
Niyati_Manual_Testing_ISTQB_Certified_Resume
Niyati Madad
 
PPTX
How to implement a simple dalvik virtual machine
Chun-Yu Wang
 
Bridging the gap - Security and Software Testing
Roberto Suggi Liverani
 
Rajasekar R_resume_Mobile Testing
Rajasekar Dpi
 
Security Testing Mobile Applications
Denim Group
 
Mobile Security
Xavier Mertens
 
Hijack rat android malware
Hamid Shekarforoush
 
Mobile application testing
Softheme
 
Manoj resume
tekwissen
 
Niyati_Manual_Testing_ISTQB_Certified_Resume
Niyati Madad
 
How to implement a simple dalvik virtual machine
Chun-Yu Wang
 
Ad

Similar to Security testing in mobile applications (20)

PPTX
Pentesting Android Apps
Abdelhamid Limami
 
PDF
Android Application Security from consumer and developer perspectives
Ayoma Wijethunga
 
PPTX
Untitled 1
Sergey Kochergan
 
PPTX
Security testing of mobile applications
GTestClub
 
PPT
Mobile code mining for discovery and exploits nullcongoa2013
Blueinfy Solutions
 
PPTX
Virtue Security - The Art of Mobile Security 2013
Virtue Security
 
PDF
CNIT 128 9. Writing Secure Android Applications
Sam Bowne
 
PDF
Android App Hacking - Erez Metula, AppSec
DroidConTLV
 
PPTX
Mobile security
Stefaan
 
PDF
9 Writing Secure Android Applications
Sam Bowne
 
PPTX
Building a Mobile Security Program
Denim Group
 
PDF
CNIT 128 9. Writing Secure Android Applications
Sam Bowne
 
PPTX
Secure Android Development
Shaul Rosenzwieg
 
ODP
Dos and Don'ts of Android Application Security (Security Professional Perspec...
Bijay Senihang
 
PDF
Getting Started With Hacking Android & iOS Apps? Tools, Techniques and resources
OWASP Delhi
 
PDF
Getting started with hacking android &amp; i os apps tools, techniques and re...
n|u - The Open Security Community
 
PDF
Smart Bombs: Mobile Vulnerability and Exploitation
Tom Eston
 
PDF
IRJET- Secure Android Application Development and Security Assessment
IRJET Journal
 
PPT
Analysis and research of system security based on android
Ravishankar Kumar
 
PPTX
Droidcon mobile security
Judy Ngure
 
Pentesting Android Apps
Abdelhamid Limami
 
Android Application Security from consumer and developer perspectives
Ayoma Wijethunga
 
Untitled 1
Sergey Kochergan
 
Security testing of mobile applications
GTestClub
 
Mobile code mining for discovery and exploits nullcongoa2013
Blueinfy Solutions
 
Virtue Security - The Art of Mobile Security 2013
Virtue Security
 
CNIT 128 9. Writing Secure Android Applications
Sam Bowne
 
Android App Hacking - Erez Metula, AppSec
DroidConTLV
 
Mobile security
Stefaan
 
9 Writing Secure Android Applications
Sam Bowne
 
Building a Mobile Security Program
Denim Group
 
CNIT 128 9. Writing Secure Android Applications
Sam Bowne
 
Secure Android Development
Shaul Rosenzwieg
 
Dos and Don'ts of Android Application Security (Security Professional Perspec...
Bijay Senihang
 
Getting Started With Hacking Android & iOS Apps? Tools, Techniques and resources
OWASP Delhi
 
Getting started with hacking android &amp; i os apps tools, techniques and re...
n|u - The Open Security Community
 
Smart Bombs: Mobile Vulnerability and Exploitation
Tom Eston
 
IRJET- Secure Android Application Development and Security Assessment
IRJET Journal
 
Analysis and research of system security based on android
Ravishankar Kumar
 
Droidcon mobile security
Judy Ngure
 
Ad

More from Jose Manuel Ortega Candel (20)

PDF
Seguridad y auditorías en Modelos grandes del lenguaje (LLM).pdf
Jose Manuel Ortega Candel
 
PDF
Beyond the hype: The reality of AI security.pdf
Jose Manuel Ortega Candel
 
PDF
Seguridad de APIs en Drupal_ herramientas, mejores prácticas y estrategias pa...
Jose Manuel Ortega Candel
 
PDF
Security and auditing tools in Large Language Models (LLM).pdf
Jose Manuel Ortega Candel
 
PDF
Herramientas de benchmarks para evaluar el rendimiento en máquinas y aplicaci...
Jose Manuel Ortega Candel
 
PDF
Asegurando tus APIs Explorando el OWASP Top 10 de Seguridad en APIs.pdf
Jose Manuel Ortega Candel
 
PDF
PyGoat Analizando la seguridad en aplicaciones Django.pdf
Jose Manuel Ortega Candel
 
PDF
Ciberseguridad en Blockchain y Smart Contracts: Explorando los Desafíos y Sol...
Jose Manuel Ortega Candel
 
PDF
Evolution of security strategies in K8s environments- All day devops
Jose Manuel Ortega Candel
 
PDF
Evolution of security strategies in K8s environments.pdf
Jose Manuel Ortega Candel
 
PDF
Implementing Observability for Kubernetes.pdf
Jose Manuel Ortega Candel
 
PDF
Computación distribuida usando Python
Jose Manuel Ortega Candel
 
PDF
Seguridad en arquitecturas serverless y entornos cloud
Jose Manuel Ortega Candel
 
PDF
Construyendo arquitecturas zero trust sobre entornos cloud
Jose Manuel Ortega Candel
 
PDF
Tips and tricks for data science projects with Python
Jose Manuel Ortega Candel
 
PDF
Sharing secret keys in Docker containers and K8s
Jose Manuel Ortega Candel
 
PDF
Implementing cert-manager in K8s
Jose Manuel Ortega Candel
 
PDF
Python para equipos de ciberseguridad(pycones)
Jose Manuel Ortega Candel
 
PDF
Python para equipos de ciberseguridad
Jose Manuel Ortega Candel
 
PDF
Shodan Tips and tricks. Automatiza y maximiza las búsquedas shodan
Jose Manuel Ortega Candel
 
Seguridad y auditorías en Modelos grandes del lenguaje (LLM).pdf
Jose Manuel Ortega Candel
 
Beyond the hype: The reality of AI security.pdf
Jose Manuel Ortega Candel
 
Seguridad de APIs en Drupal_ herramientas, mejores prácticas y estrategias pa...
Jose Manuel Ortega Candel
 
Security and auditing tools in Large Language Models (LLM).pdf
Jose Manuel Ortega Candel
 
Herramientas de benchmarks para evaluar el rendimiento en máquinas y aplicaci...
Jose Manuel Ortega Candel
 
Asegurando tus APIs Explorando el OWASP Top 10 de Seguridad en APIs.pdf
Jose Manuel Ortega Candel
 
PyGoat Analizando la seguridad en aplicaciones Django.pdf
Jose Manuel Ortega Candel
 
Ciberseguridad en Blockchain y Smart Contracts: Explorando los Desafíos y Sol...
Jose Manuel Ortega Candel
 
Evolution of security strategies in K8s environments- All day devops
Jose Manuel Ortega Candel
 
Evolution of security strategies in K8s environments.pdf
Jose Manuel Ortega Candel
 
Implementing Observability for Kubernetes.pdf
Jose Manuel Ortega Candel
 
Computación distribuida usando Python
Jose Manuel Ortega Candel
 
Seguridad en arquitecturas serverless y entornos cloud
Jose Manuel Ortega Candel
 
Construyendo arquitecturas zero trust sobre entornos cloud
Jose Manuel Ortega Candel
 
Tips and tricks for data science projects with Python
Jose Manuel Ortega Candel
 
Sharing secret keys in Docker containers and K8s
Jose Manuel Ortega Candel
 
Implementing cert-manager in K8s
Jose Manuel Ortega Candel
 
Python para equipos de ciberseguridad(pycones)
Jose Manuel Ortega Candel
 
Python para equipos de ciberseguridad
Jose Manuel Ortega Candel
 
Shodan Tips and tricks. Automatiza y maximiza las búsquedas shodan
Jose Manuel Ortega Candel
 

Recently uploaded (20)

PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Tally software_Introduction_Presentation
AditiBansal54083
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Human Resources Information System (HRIS)
Amity University, Patna
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 

Security testing in mobile applications

  • 1. Security testing in mobile applications José Manuel Ortega Candel
  • 2. About me  Centers Technician at Everis  Computer engineer by Alicante University  Frontend and backend developer in Java/J2EE  Speaker site with some presentations in mobile and security https://speakerdeck.com/jmortega
  • 3. Index Security Testing for Mobile Apps Risk Management & Security Threads Vulnerabilities & Mobile Security Risks Testing Components Security & Tools Security Test Plan & Best Practices
  • 4. Security Testing for Mobile Apps
  • 5. Security Testing for Mobile Apps White Box Testing Static Analysis Code Black Box Testing Dinamyc Analysis at Runtime
  • 6. Static Application Security Testing Source code Review Reverse engineering Lint for Android Studio Sonar Plugins for mobile http://www.sonarqube.org
  • 8. Static Application Security Testing https://github.com/SonarCommunity/sonar-android
  • 9. Static Application Security Testing http://sourceforge.net/projects/agnitiotool You can decompile APKs and search calls dangerous functions.
  • 10. Reverse engineering on Android APK Tool /Dex2jar/Java Decompiler
  • 11. Static analysis on iOS Xcode Development environment Apple Developer Tools ‘otool’ command provided by XCode can be used to get information from iOS application binaries and can be used to support security analysis.
  • 12. Static analysis on iOS Detect memory leaks with XCode Clang Static Analyzer http://clang-analyzer.llvm.org Flawfinder(Security weakness in C/C++) http://www.dwheeler.com/flawfinder
  • 13. Dynamic Application Security Testing Analyze Network Traffic at runtime Analyze Remote Services DroidBox for Android Instruments for iOS Discovering logical vulnerabilities
  • 14. Dynamic Application Security Testing  https://code.google.com/p/droidbox Monitoring Actions  Information leaks Network IO and File IO  Cryptography operations SMS and Phone calls
  • 16. Instruments for iOS applications File Activity Monitoring Memory Monitoring Process Monitoring Network Monitoring
  • 17. Application Security Analyser python androwarn.py -i my_apk.apk -r html -v 3 Telephony identifiers exfiltration: IMEI, IMSI, MCC, MNC, LAC, CID, operator's name... Device settings exfiltration: software version, usage statistics, system settings, logs... Geolocation information leakage: GPS/WiFi geolocation... Connection interfaces information exfiltration: WiFi credentials, Bluetooth MAC adress... Telephony services abuse: premium SMS sending, phone call composition... Audio/video flow interception: call recording, video capture... Remote connection establishment: socket open call, Bluetooth pairing, APN settings edit... PIM data leakage: contacts, calendar, SMS, mails... External memory operations: file access on SD card... PIM data modification: add/delete contacts, calendar events... Arbitrary code execution: native code using JNI, UNIX command, privilege escalation... Denial of Service: event notification deactivation, file deletion, process killing, virtual keyboard disable, terminal shutdown/reboot...
  • 19. Intelligence Gathering Environmental Analysis Architectural Analysis Analyze internal processes and structures App [network interfaces, used data, communication with other resources, session management] Runtime environment [MDM, jailbreak/rooting, OS version] Backend services [application server, databases]
  • 20. Intelligence Gathering What type of device is it? Determine Operating System version Is the device already rooted? Is the device passcode enabled? What key applications are installed? Is the device connected to network?
  • 21. Thread model in Mobile applications
  • 22. Functional Security threads Authentication Session Management Access Control Input Validation Cryptography Error Handling and Logging Data Protection Communication Security
  • 23. Security issues Malicious Applications – Rooting Exploits – SMS Fraud – Rapid Malware Production Dynamic Analysis – Sandbox – Real-time Monitoring – Mobile Specific Features Static Analysis – Permissions – Data Flow – Control Flow Browser Attacks – Phishing – Click Through Mobile Botnets – Epidemic Spread – Attacking Network Services – Tracking Uninfected Devices User Education – Ignoring Permissions – Phishing – Improperly Rooting Devices – Alternative Markets
  • 25. Vulnerabilities 1. Activity monitoring and data retrieval 2. Unauthorized dialing, SMS, and payments 3. Unauthorized network connectivity (exfiltration or command & control) 4. UI Impersonation 5. System modification (rootkit, APN proxy config) 6. Logic or Time bomb 7. Sensitive data leakage (inadvertent or side channel) 8. Unsafe sensitive data storage 9. Unsafe sensitive data transmission 10. Hardcoded password/keys
  • 26. Vulnerabilities Analysis Static methods Dynamic methods Automatic and manual source code analysis Reverse Engineering Forensic methods Network monitoring and trafic analyzing Runtime analysis Log analysis File permission analysis File content analysis
  • 27. Dynamic methods tools Network monitoring and traffic analyzing Runtime analysis Wireshark, BurpSuite GNU debugger, Snoop-it, Cycript Mercury, Intent Sniffer, Intent Fuzzer File analysis androidAuditTools
  • 28. Testing vulnerabilities Data flow Data Storage Data leakage Authentication Authorization Server-side
  • 29. OWASP Mobile Security Risks Insecure Data Storage Transport Layer Protection, HTTP/SSL Authorization and Authentication Cryptography / Encrypting data Session handling Weak Server Side Controls in backend services Sensitive information [passwords,API keys,code ofuscation] Data Leakage [cache, logging, temp directories]
  • 30. Testing components security Content Providers Data Storage WebViewServices NetWork Connections [HTTP / SSL] Certificates Data Encryption SQLite Shared Preferences File storage
  • 31. HTTPS and SSL can protect against Man in the Middle attacks and prevent casual snooping
  • 32. Data Storage Encrypt data Never store user credentials Tools like SQLCipher for storing database in applications No global permissions granted to applications, using the principle of "least privilege".
  • 33. Secure Storage on Android The access permission of the created file was set to WORLD_READABLE / WORLD_WRITABLE Other app could read /write the file if the file path is known. Application data (private files) should be created with the access permission MODE_PRIVATE FileOutputStream fos = openFileOutput(“MyFile", Context.MODE_PRIVATE); fos.write(“contenido”.getBytes()); fos.close();
  • 34. Insecure Data on Android Look for file open operations using Context.MODE_WORLD_READABLE (translates to “1”)
  • 35. Secure Storage on iOS NSFileManager class NSFileProtectionKey attribute  NSFileProtectionNone – Always accessible  NSFileProtectionComplete – Encrypted on disk when device is locked or booting [[NSFileManager defaultManager] createFileAtPath:[self filePath] contents:[@"super secret file contents“ dataUsingEncoding:NSUTF8StringEncoding] attributes:[NSDictionary dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey]];
  • 36. DataBase Storage Support iOS / Android https://www.zetetic.net/sqlcipher/open-source 256-bit AES Encrypt SQLite database Secure Preferences on Android https://github.com/scottyab/secure-preferences 3rd-party extensions
  • 38. Cryptography Android and iOS implement standard crypto libraries such as AES algorithm try{ PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt, PBE_ITERATION_COUNT, 256); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(PBE_ALGORITHM); SecretKey tmp = keyFactory.generateSecret(keySpec); // Encrypt SecretKey secret = new SecretKeySpec(tmp.getEncoded(), "AES"); Cipher encryptionCipher = Cipher.getInstance(CIPHER_ALGORITHM); IvParameterSpec ivspec = new IvParameterSpec(initVector); encryptionCipher.init(Cipher.ENCRYPT_MODE, secret, ivspec); encryptedText = encryptionCipher.doFinal(cleartext.getBytes()); // Encode encrypted bytes to Base64 text to save in text file result = Base64.encodeToString(encryptedText, Base64.DEFAULT); } catch (Exception e) { e.printStackTrace() } Android provides the javax.crypto.spec.PBEKeySpec and javax.crypto.SecretKeyFactory classes to facilitate the generation of the password-based encryption key.
  • 39. Avoid Data Leackage on Android public static final boolean SHOW_LOG = BuildConfig.DEBUG; public static void d(final String tag, final String msg) { if (SHOW_LOG) Log.d(tag, msg); } Don't expose data through logcat on production -assumenosideeffects class android.util.Log { public static *** d(...); public static *** v(...); public static *** i(...); public static *** e(...); } Proguard configuration
  • 40. Permissions in mobile apps AndroidManifest.xml on Android  Try to minimize permissions <manifest package="com.example.android" …> <uses-permission android:name=“android.permission. ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> … </manifest>
  • 41. Permissions in mobile apps info.plist on iOS
  • 46. Security test plan Test cases Example Test Title /level Encryption /critical Test Description When connections are used encryption is used for sending / receiving sensitive data. Details and tools All sensitive information (personal data, credit card & banking information etc.) must be encrypted during transmission over any network or communication link. Expected result It has been declared that the Application uses encryption when communicating sensitive data.
  • 47. Security test plan Test cases Example Test Title /level Passwords /critical Test Description Passwords and sensitive data are not stored in the device and not echoed when entered into the App, sensitive data is always protected by password. Details and tools The objective of the test is to minimize the risk of access to sensitive information should the device be lost, by ensuring that no authentication data can be re-used by simply re-opening the application
  • 48. Security test plan Test cases Example Test Title /level Passwords /critical Expected result 1. Entering a password or other sensitive data will not leave it in clear text if completion of the fields is interrupted but not exited. 2. Passwords, credit card details, or other sensitive data do not remain in clear text in the fields where they were previously entered, when the application is reentered. 3. Sensitive personal data should always need entry of a password before it can be accessed.
  • 49. Best Practices Integrate security in Continuous Integration (CI) process Apply encryption /decryption techniques used for sensitive data communication Detect areas in tested application that have more risks to detect vulnerabilities Install an automated security vulnerability scanner, integrated with your continuous integration tool
  • 51. Attacker vs Defenders Defenders Attackers Often have limited time to put defences in place Can take time to plan their attack Have limited opportunities to improve their defences Can invent new ways to attack Need to defend against a range of possible attacks Need only pick the most effective one Need to defend all entry points Can choose where to attack Has limited resources to defend Can be multiple attackers
  • 53. References https://github.com/secmobi/wiki.secmobi.com Tools IOS Application Security Testing https://www.owasp.org/index.php/IOS_Application_Security_ Testing_Cheat_Sheet
  • 54. Books