XBOSoft presents Jon Hagar Mobile Web Security
Oct 28, 2014
XBOSoft presentsJon Hagar
Mobile Web Security
XBOSoft info
l Founded in 2006l Dedicated to software quality
• Software QA consulting• Software testing services
l Offices in San Francisco, Beijing, Oslo and Amsterdam
Housekeeping• Everyone except the speaker is muted
• Questions via the gotowebinar control on the right side of your screen
• Questions can be asked throughout the webinar, we’ll try to fit them in when appropriate
• General Q & A at the end of the webinar
• You will receive info on recording after the webinar
SpeakersFrom XBOSoft:
Sabrina Gasson Jon Hagar
Jan Princen
Jon Hagar Copyright 2013 How to Attack Embedded Software
Mobile
Web
Sec
urity
(con
cepts
and Te
stin
g)
W
hat o
ften
gets
ove
rlook
ed
Jon Hagar
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Agenda
Definitions and Concepts Problem and ContextAttack based testing to find security issues
Specific samples Historic attacks And yet more attacks
Impact to Engineering DomainsSummary
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Mobile, Smart, and Handheld
As the names imply, these are small, hand held devices that are often connected to communication networks, including
Cell and smart phones – apps Tablets Medical devices
Typically these devices have: Many of the features of classic “embedded” systems (and
problems) Many of the power and capabilities of PCs/IT (and problems) More/different user interfaces (UI) and hardware configurations
(1000s) Fast updates Are getting more power, memory, and features (software, e.g.,
apps) Initialization, noise, power up/down, timers, sensors, etc. Often resource constrained: RAM, ROM, stack, power, speed,
time, etc.These are “hot” areas of computers and softwareSecurity and testing rules are “evolving”
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Security
Keep physical and logical system elements safe from harm, compromise, or adverse consequences.
In the Mobile WorldSecurity of internal informationSecurity of transmitted informationSecurity from external threats (usually logical)
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Definition: Fundamental Software Capabilities
Dr. James Whittaker lists these 4 Software accepts inputs from its environment Software produces output and transmits it to its
environment Software stores data internally in one or more data
structures Software performs computations using input or stored data
Mobile software can be refined with Mobile with wireless network connections of variable
strength Many kinds of hardware Many Apps Large amounts of software Features of the embedded world (sensors, control, critical
features…)
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Other Definitions (for this presentation)
Taxonomy - the practice and science of classification. Test – the act of conducting experiments on something to determine the quality and provide informationTest case – One set of inputs, environmental set up, and results (expected and unexpected)Attack – to set up, forcefully, and attempt to “damage” the system or software, using tools, and techniques, may use one or more test cases or proceduresBug (error) – Results that depart from the expected (from requirements, design, standards, user, etc.)Lifecycle – From beginning-to-end, the steps, stages, and activities to create the system (birth-to-death)Procedure – a particular way of accomplishing tests, usually written (one or more test cases)Scenario – a sequence of events with a test plot or storyScript – see procedure, normally uses automationUsers – someone/something that interacts with the system/software (can be human or machine)Quality – Value to someone that they will pay for
Jon Hagar Copyright 2013 How to Attack Embedded Software
The
Prob
lem
and
Con
text
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
The Current SituationMobile and embedded systems are highly integrated hardware–software–system solutions which: Must be highly trustworthy since they handle
sensitive data Often perform critical tasks
Security holes and problems abound - Android
• static analysis test attack found 0.47 defects per 1000 SLOC
• 359 defects in total, 88 of which were considered “high risk” in the security domain
OS hole Andriod with Angry Birds (researchers Jon Oberheide and Zach Lanier)Robots and Drones rumored to be attackedCars and medical devices being hacked
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Other Data Points (scary from the embedded world)
Davis-Besse nuclear plant - AttackOil and Gas industry impacts
Night Dragon Shamoon
Infrastructure Harrisburg water plant attack Texas waste treatment plant hack
Even some reports of criminal “black mail”
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
World Change: Mobile Security
Security remains focused on PC/IT networks (web), and “Traditional” software
More recently with. . . Mobile usage over taking PC/IT Lost or stolen devices Networked/Smart devices and system are open to
hacks • e.g. GPS spoofing• Worms, virus, attacks, etc…..
Physical and logical security concerns will increase
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Design & Code Errors Produce Software Cyber Vulnerabilities
Features/capabilities are known Some might say all features are known but there can be
“undocumented” features
In perfect software, we would not need to be concerned with security vulnerabilities because we could just “build it” secure
But many vulnerabilities come from errors or are “accidently” introduced by new use situations
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Mobile Security Concerns (partial list)
Fraud – Identity TheftWorms, virus, etc
Fault injection Error exploitation
Processing on the runHacks and attacks that impact
Power Memory CPU usage
Eavesdropping – yes everyone can hear you Hijacking Click-jacking Voice/Screen capture
Physical Hacks File snooping Lost phone
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
POLL: Is Mobile Security a Concern for you?
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Security and Vulnerability Actions for Mobile and Embedded Devices
Prepare for theft or loss of devices (encryption, IT controls, memory wipe programs, etc.)
Establish physical control (locked door and limited access to facilities -historic)
IT operations (VPN, network control, access monitors, registry logon)
Prevent development and test processes such as, developers leaving back doors in the code, testers doing something they shouldn’t when they shouldn’t
Software bugs we need to test for (this presentation)
Work third part operating systems and COTS bugs (Use/promote secure OS, encrypted files, authenticated files, trusted software, etc.)
Regulatory and legal constraints (ISO – 12207, 15288, 29119, and IEEE 1012 into government “use”)
Attack test data/file input and output (this presentation)
Attack tests impersonation (this presentation)
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Teams Need to Know the Bug (software error)
Mobile software has similar defects to traditional software
Requirements & Design Logic & Math Control Flow Data Initialization & Mode changes Interfaces Security Game interfaces etc.
l Mobile adds defects/issuesl Fast and “incomplete” development
cyclesl Many many kinds of apps and
hardwarel Small amounts of dense complex
functions l (a BIG one) Performance issues
Do you have a taxonomy of your bugs?
Jon Hagar Copyright 2013 How to Attack Embedded Software
Sec
urity
Test
ing A
ttack
s
Part
of a
Com
plet
e Def
ense
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
What is an Attack
Attacking your software system – In part, the process of attempting to demonstrate that a system (hardware, software, and operations) does not meet requirements or functional and non-functional objectives
Embedded/handheld software testing must include “the system” (hardware, software, servers, operations, users, etc.)
Attacks go after common modes of failure and bugs, attempting to demonstrate that “does not meet” exists
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
An Attack Is. . .
Based on a common mode of failure seen over and over
Maybe seen as a negative, when it is really a positive Goes after the “bugs” Based on or using classic test techniques and test
conceptsTesters learn these after years and form a mental model (most good testers attack)I offer a few embedded attacks
Based on literature research of published bugs Be suspicious
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Attack: Identity Security Fraud
Apply when the device is mobile/embedded and has
Account numbers User ids and passwords Location tags Restricted data
Current authentication approaches in use on embedded/mobile devices
Server based Registry (user/password)
Location-device based Profile based Privacy
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Mobile Software Attacks
Sub-attack: Identity Fraud Spoofing – who am I and where am I, or not
In this sub-attack, the tester is trying to fool or spoof the device/app on identity and/or location
The tester should see if the identity can be “hijacked” Hagerman (Unpublished PhD work) reports how to do
this using Wireshark tool to sniff and decode data being broadcast.
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Next Approach: Attack Location
Location used as part identity?
Check how the location is used – Is authorization temporary or permanent?
If temporary, the attack should check for remnant data files Use development tools and/or the OS to poke around in the file
system Warning, the file may be encrypted, in which case you may need a
file encryption cracker for that type of file/encryption, e.g. pkcrack
If file is not temporary, the tester next needs to determine if any of the permanent information can be accessed, abused, or corrupted In many devices and apps, this data should be encrypted, and here
again apply the cracking encryption tools How hard or easy is it to read the file (text – bad -> encrypted
better)?
.
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Spoofing Location and User
Once you have the location-identity file information, ask yourself “can I spoof the location either inside of the device or what is broadcasting?”
Each system/app will be structured differently
Closely related to location-identify spoofing is the user profile spoof, if used
Here the tester attempts to take over an identity by understanding how user profile checks work (or don’t)
This will require understanding the internal data points of what your system is checking
Use factors to look for are: location, time, where transactions are occurring, types of transactions, money amounts in transactions, provider/store, product, signal location/type, and biometric data
Input them to the system; determine if the server gets confused and gives or uses “the wrong/sensitive” data
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Yet More Attacks (outline) Attack: App configuration update
Attack: Embedded phishing
Attack: Virus/malware embedded in a hijacked apps
Attack: OS and other (NOT) “trusted” COTS software
Ref. Whittaker and Hagerman
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Attack 28 Penetration Attack Test – mobile and embeddedAttack 29.1 Identity Social Engineering Attack 30: Spoofing Attacks Attack 30.1 Location and/or User Profile Spoof Attack 30.2 GPS Spoof Sub–AttackAttack 31: Attacking Viruses on the Run in Factories or PLCs
Software Test Attacks to Break Mobile and Embedded Devices
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Whittaker’s And Thompson’s AttacksNumber
Attack name Applicable to mobile-embedded
1 Block access to libraries and/or OS internals yes
2 Manipulate the application's registry values yes
3 Force the application to use corrupt files yes
4 Manipulate and replace files that the application creates, reads from, writes to, or executes
yes
5 Force the application to operate in low memory, disk-device, and network availability
yes
6 Overflow input buffers yes
7 Examine all common switches and options yes
8 Explore escape characters, character sets, and commands yes
9 Try common default and test account names and passwords yes
10 Use a tool to expose unprotected APIs yes
11 Connect to all ports yes
12 Fake the source of data yes
13 Create loop conditions in any app that interprets script, code, or other user-supplied logic
yes
14 Use alternate routes (in the app) to accomplish the same task yes
15 Force the system to reset values yes
17 Create files with the same name as files protected with a higher classification yes
18 Force all error messages yes
19 Use a tool to look for temporary files and screen their contents for sensitive info yes
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Many More Attacks Exist
Simply doing Verification checking of requirements in testing is not enough
Some say “Wait, let the bad guys find the holes”
But for many mobile-embedded systems this is not a good idea
Progressive organization put forth a good offense as well as defense
Attack testing before the bad guys do
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Bottom line
Defenses should include
Device security – registration, wipe/disable programs, encryption, monitoring, cloudDevelopment - requirements specification, software design, construction, and support processes such as configuration management.Operations/IT - governance, product controls, access limitations, physical security, and cyber-security
Functional and non-functional security testing - Attacks in development and after deployment in operations
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
POLL: Are you testing Mobile Devices/Apps now?
Jon Hagar Copyright 2013 How to Attack Embedded Software
Wra
pping u
p
Wher
e sh
ould
you
go
next?
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Summary of My Favorite AttacksNamed Attack Apply Against Example Considerations
Penetration Attack Account numbers/user ids Use tools to gain access e.g., pkcrack
Passwords Check common passwords that may be vulnerable, using password hacking tools or checklists
Usage profiles The pattern of how the software or device is used to expose vulnerabilities
Location tags for embedded/mobile devices Where is the device, are tags temporary as the device moves, and what is reported to an open network (cellular, Wi-Fi, etc.)?
Fuzz Testing Sub Attack External inputs e.g., user ids passwords Use fuzzing tool to attack the external interfaces
Spoofing Attack “Hijacked” Identity Use spoofing tools in the “sand box” test environments
GPS spoofing for mobile/embedded devices Requires specialized equipment and labs. But for devices dependent on GPS, this may be a “high” risk factor
"Social Engineering" spoof Attack like the hackers who use many sources of information to gain an advantage
File checking attack "Hidden" files with unsecured data Look for hidden or unsecure/non-encrypted files [6]
Encryption (or lack thereof) Is there restricted data perhaps hidden in mobile and embedded file systems which may be “temporary” and/or not encrypted properly?
Good encryption patterns Where did the algorithm(s) come from and how vulnerable is it?
Breaking Software Security Use classic IT/PC/web attacks many of which are applicable to mobile and embedded
See Whittaker’s book [4] for 20 attacks that can be applied to mobile hybrid/web apps
Virus Attack Off-the-shelf software Test for counterfeit logic such as mobile and embedded viruses, malware, etc.
Third party software Many viruses are embedded in fun apps that users download particularly on “bring your own devices”
Operating System Can it be trusted?
Bring your own mobile device Threat from unsecured users
Trojan horses Can the tester use email, hacked apps, or other files to get “inside” of the defenses
Embedded multi-tier system For example Stuxnet and its offspring
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
How to Increase you Security Skills
Testers looking to become cyber-security test warriors need to develop the following skills (not just tool expertise or product knowledge)
- The ability to apply the attacks and synthesize their own attacks
- Critical thinking, including the ability to think like the bad guys
- Exploratory attack testing (my list is only a start)- Following the “smells” of the software bugs (small hints of a
bug or vulnerability) - Automation, modeling, and math - Risk based testing- General test information, processes, techniques, and
documentation
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Test Engineering
Test needs to do the “standard” efforts, and needs to play the “bad guys”
Hacking attacks Vulnerabilities Test to provide information from day one, so the team
can plug the holes based on attack information At the end of a development cycle, get really nasty
Some tester are really good at that
Practice Practice Practice, Learn, and the repeat
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Warnings To Testers Security attacks and testing must be done with the
knowledge and approval of owners of the system and software
Severe legal implications exist in this area
Many of these attacks must be done in a test lab (sandbox) and not in the field
In these attacks I tell you conceptually how to “drive a car very fast (150 miles an hour) but there are places to do this with a car legally (a race track) and places where you will get a ticket (most public streets)”
Be forewarned - Do not go attack you favorite app on your phone or connected server without the right permissions due to the legal implications
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Summary
These attacks are just starting pointsMobile device use, features, and connections will grow meaning that security threats and vulnerabilities will increase
-- I see a great need for mobile security testers
Be careful—there are impacts in all effort domains
Systems Software Hardware Support and Operations
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
POLL: What is the status of your Mobile Security Testing?
Jon Hagar Copyright 2013 How to Attack Embedded Software
Refer
ence
Mat
eria
ls
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Thanks (ideas used from)
James Whittaker (attacks) Elisabeth Hendrickson (sims) Lee Copeland (techniques) Brian Merrick (testing) James Bach (tours and thinking) Cem Kaner (test thinking) Phil Lew (support good testing and this meeting)
Many teachers Generations past and future Books, references, etc.
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Book List (favorites that I use)
Software Test Attacks to Break Mobile and Embedded Devices, Jon D. Hagar 2013
How to Break Software Security, Whittaker & Thompson• And Whittaker’s other “How To Break…” books
A Practitioner’s Guide to Software Test Design , Copeland, 2004
Honorable mentions: “Embedded System and Software Validation” Roychoudhury 2009 “Systems Testing with an Attitude” 2005 “Software System Testing and Quality Assurance” Beizer 1987 “Testing Computer Software” Kaner et. al. 1988 “Systematic Software Testing” Craig & Jaskiel, 2001 “Managing the Testing Process” Black 2002 “Hacking Exposed” McClure, Scambray, Kurtz
Y. Tadjdeh, “Industry, military emphasize need for “Cyberwarrror” training as attacks increase”, National Defense Magazine, Dec. 2013
J Scambray, S. McClure, G. Kurtz, “Hacking Exposed”, McGraw Hill
Jon Hagar Copyright 2014 How to Attack Embedded SoftwareHow to Attack Embedded Software
Resources
• Association of Software Testing
Offers Free Classes on Testing