SlideShare a Scribd company logo
Zen	
  and	
  the	
  Art	
  of	
  
Security	
  Testing
Testing	
  for	
  security	
  issues	
  as	
  a	
  variation	
  on	
  what	
  you	
  already	
  
do
About Cigital
UK  and  US  consulting  firm  specializing  in  software  security.  Global  
leader  in  helping  organizations  build  security  in.
Over  20  years  of  research  and  successful  software  security  consulting  
engagements  throughout  the  world.
Offers  consulting,  training,  mobile  application  security.  Published  in  
books,  white  papers,  and  articles.
About Me
• Consultant 13 years
• Software security: code, design, risk
• Financial, gaming, retail
• Source code, architecture, security testing
• (ISC)² European Advisory Council
• CISSP and CSSLP exam item author
• Author: 2 books + 1 chapter
• OWASP Mobile Top Ten contributor
• BS and MS in Computer Science
• Passionate about software testers as an untapped
resource in software security
Inspiration
www.eurostarsoftwaretesting.com
The Inspiration
Before one studies Zen, mountains are
mountains and waters are waters;
after a first glimpse into the truth of
Zen, mountains are no longer
mountains and waters are no longer
waters;
Photo: © 2009 Abi Skipp, via Flickr
The Metaphor
Before one learns security testing,
software is software and test cases are
test cases;
after a first glimpse into security
testing, software is no longer software
and test cases are no longer test cases;
Functional Testing vs.
Security Testing
Testing against the design/requirements is not enough:
Design
specification
& requirements
Actual
implementation
Missing features
(found in
functional testing)
Potential security
vulnerabilities
(not found in
functional tests)
Boundary condition
analysis (edge and
corner cases) Security testers
must think
“outside the box”
Goals
• Finding places in the user journey to do security testing
• Working that into user stories
• Working it into tests
• Modifying existing test cases to cover security
• Use tools for intercepting and modifying web requests
www.eurostarsoftwaretesting.com
INJECTING SECURITY
TESTS INTO USER
STORIES
the fundamentals
www.eurostarsoftwaretesting.com
Agile User Story
As a customer,
I want to change my shipping
address
so that packages will come to
my new address
THOUGHTS
UNDER
CONSTRUCTION
CAUTION
www.eurostarsoftwaretesting.com
Security User Stories
User Story
As a customer, I want
to track the shipment
of my order so that I
know when it will
arrive.
Security Story
As a fraudster, I want
to see the details of an
order that is not my
own so that I can learn
another person’s
private information.
12
“Bad Guys” in Security User Stories
Bad Guys
• Competitor
• Misbehaving customer
• Hacker
• Journalist
• Criminal
• Vandal
• Disgruntled employee
Goals
• Learn private
information
• Commit a fraudulent
transaction
• Damage the company’s
brand
• Prevent people from
doing their job
• Sell valuable information
“Bad Guy” User Stories
Acceptance Criterion
Given that the user is logged in
And the session is valid
And the request is for an order that does not
belong to the logged-in user,
When the user requests details
Then display an error message
And ensure the user is no longer logged in
And log an error to the application log.
As a criminal,
I want to see the details of an order that is not mine
So that I can learn private information of another person
“Good Guys” in Security User
Stories
Users
• Fraud Analyst
• Customer Service Rep
• System Operator
• Well-behaved user
• Manager
• Auditor
Goals
• Verify a transaction
• Determine some
important information
• Report on error
conditions
• Display the status of
something 15
“Good Guy” User Stories
As a security analyst,
I want to see a list of sessions with
unusal characteristics
So that I can identify and terminate bot
and fraud sessions
As a registered user,
I want to receive a notification when a
new device is added to my account
So that I know how many devices are
attached to my account
Goals of Security User Stories
• Identify an important actor (developers, security
people, IT people are usually not important)
• Identify an action or activity with tangible
outputs
• An easy tangible output is an error message
• Force the business to be engaged by getting them to
describe these output
• Create test cases that exercise the software that
way
• Can you make the error message appear?
www.eurostarsoftwaretesting.com
SECURITY TESTING
TECHNIQUES
www.eurostarsoftwaretesting.com
Web Security Testing vs.
Network Penetration Testing
Penetration Testing
• Finds services and open
ports
• Checks for vulnerable or
misconfigured
components
• Often targets standard
software, COTS
Web Security Testing
• Focuses on what is
running over HTTP(S)
• System usually contains
custom-built code
• Requires deeper
knowledge of business
processes and rules
The Idea
Functional Testers Know the Most!
• Test data to exercise this
whole flow
• Insert security test data
at each point
o SQL injection
o XML
o Cross-site scripting (XSS)
o JSON
o CSV
www.eurostarsoftwaretesting.com
Old Skool: Boundary Value Testing
Example Scenario
• App allows you to share mobile
minutes
• 1000 minutes across 3 lines
• Inputs are non-negative, integer
minute values
• Must sum to exactly 1000
• 0 and 1000 are valid
Examples
Line 1 250
Line 2 250
Line 3 500
Total 1000
Line 1 0
Line 2 1000
Line 3 0
Total 1000
Line 1 1
Line 2 1
Line 3 998
Total 1000
www.eurostarsoftwaretesting.com
Old Skool: Boundary Value Testing
Boundary Values
• One more, one less, and boundary
value
• -1, 0, 1, 999, 1000, 1001
• This is testing 101
A few other interesting ones
• MAXINT
• MININT
Examples
Line 1 -1
Line 2 0
Line 3 1
Total err
Line 1 999
Line 2 1000
Line 3 1001
Total err
Line 1 -1
Line 2 0
Line 3 1001
Total err
www.eurostarsoftwaretesting.com
Equivalence Class Partitioning
Sampling from Equivalence Classes
• Negative numbers
• Aphabetic characters
• Character set, encoding variations
• Unicode UTF-8
• Unicode UTF-16
• Unicode ISO-8859-1
• Null / missing / empty
Examples
Line 1 ABCD
Line 2 500
Line 3 500
Total err
Line 1 完全な失敗
Line 2 başarısızlık
Line 3 ‫ﻞﺸﻓ‬
Total err
Line 1
Line 2 1
Line 3 998
Total err
www.eurostarsoftwaretesting.com
Security and
Equivalence Class Partitioning
New Equivalence Classes
• SQL Injection
'or  1=1;  -­‐-­‐
'  and  'A'='A';
• Cross-site scripting
<script>
<img  src="http://.../"…>
• Other encoding issues
• URI encoding
• HTTP encoding
• Base64 misalignments
• Etc.
Examples
Line 1 ‘ or 1=1’;
Line 2 ’ and a=a; --
Line 3 ‘ group by --
Total err
Line 1 <script>
Line 2 <body
onload=>
Line 3 <a
onmousover>
Total err
www.eurostarsoftwaretesting.com
Where do I get these
test data?
• Cross-site Scripting (XSS)
• OWASP Cross Site Scripting Cheat Sheet
• https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sh
eet
• http://htmlpurifier.org/live/smoketests/xssAttacks.php
• SQL Injection
• SQLNinja
• SQLMap
• Kali Linux (many security tools built in)
• HTML, XML, JSON
www.eurostarsoftwaretesting.com
SECURITY TOOLS FOR
WEB TESTING
www.eurostarsoftwaretesting.com
Two Important Tools
1.Firebug
2.Burp
(don’t forget Selenium)
www.eurostarsoftwaretesting.com
Firebug
• Add-on for Firefox (http://getfirebug.com/)
• Views the DOM as it really is
• Interactively manipulates the DOM
• Great things to do:
• Undo disabled="true"
• Identify
XPATH
for
Selenium
www.eurostarsoftwaretesting.com
Intercepting Traffic
• Local proxy acts as man-in-
the-middle
• HTTPS traffic is decrypted
and viewable in plain text in
local proxy
• Insert data that you can’t put
into a field via the browser
• See hidden fields, cookies,
etc.
Even HTTPS traffic can be intercepted:
Tester’s Machine
Server
Tester’s Browser
Tester’s Proxy
HTTPS
Tunnel 1
HTTPS
Tunnel 2
Burp Proxy
• Start local proxy and configure
interface and port to listen to
• If necessary, configure
upstream proxy server(s)
You can run a local HTTP proxy on your own machine:
Security Testing
Monitor, intercept, and rewrite traffic in your local proxy:
Modify Parameters
www.eurostarsoftwaretesting.com
Bypassing All Client Side Checks
• After inputs are checked
• Before they’re received by
the server
Works on Mobile Too
Tester’s Machine
Server
Tester’s Browser
Tester’s Proxy
Rewrite
responses?
Wrapping	
  Up
Everyone who
has something to do with
SOFTWARE
has something to do with
SOFTWARE SECURITY
Wrapping Up
• User stories let us describe security behaviour
• Good Guys
• Bad Guys
• Error messages
• Put security test data into standard functional tests
• Get test data ideas from OWASP
• Get free tools and try them
• Use a proxy to intercept and modify HTTP
communication
www.eurostarsoftwaretesting.com
37
The best time to plant an oak
tree was twenty years ago.
The next best time is now.
—Ancient Proverb
Paco Hope, CISSP,CSSLP
paco@cigital.com
Twitter: @pacohope

More Related Content

PDF
The 3 Top Techniques for Web Security Testing Using a Proxy
PPTX
What? Why? Who? How? Of Application Security Testing
PDF
IoT Software Testing Challenges: The IoT World Is Really Different
ODP
Building an Open Source AppSec Pipeline
PDF
New Era of Software with modern Application Security v1.0
PDF
AppSec is Eating Security
PPTX
Security as a new metric for Business, Product and Development Lifecycle
PDF
Building a Modern Security Engineering Organization
The 3 Top Techniques for Web Security Testing Using a Proxy
What? Why? Who? How? Of Application Security Testing
IoT Software Testing Challenges: The IoT World Is Really Different
Building an Open Source AppSec Pipeline
New Era of Software with modern Application Security v1.0
AppSec is Eating Security
Security as a new metric for Business, Product and Development Lifecycle
Building a Modern Security Engineering Organization

What's hot (20)

PDF
DevSecCon Asia 2017 Ofer Maor: AppSec DevOps automation – real world cases
PDF
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
PPTX
Agile and Secure Development
PDF
SecDevOps Risk Workflow - v0.6
PDF
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
PPTX
What Good is this Tool? A Guide to Choosing the Right Application Security Te...
PPTX
OWASP Top 10 practice workshop by Stanislav Breslavskyi
PDF
PPTX
Simplify Dev with Complicated Security Tools
PPTX
The Journey to DevSecOps
PPTX
DevSecCon Singapore 2018 - Pushing left like a boss by Tanya Janca
KEY
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
PDF
Evil User Stories - Improve Your Application Security
PPTX
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
PPTX
Static Analysis Security Testing for Dummies... and You
PDF
Blending Automated and Manual Testing
ODP
Lessons from DevOps: Taking DevOps practices into your AppSec Life
PPTX
Shifting left – embedding security into the devops pipeline by Mike d. Kail
PDF
Integrating DevOps and Security
PPTX
Making Security Agile
DevSecCon Asia 2017 Ofer Maor: AppSec DevOps automation – real world cases
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Agile and Secure Development
SecDevOps Risk Workflow - v0.6
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
What Good is this Tool? A Guide to Choosing the Right Application Security Te...
OWASP Top 10 practice workshop by Stanislav Breslavskyi
Simplify Dev with Complicated Security Tools
The Journey to DevSecOps
DevSecCon Singapore 2018 - Pushing left like a boss by Tanya Janca
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
Evil User Stories - Improve Your Application Security
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
Static Analysis Security Testing for Dummies... and You
Blending Automated and Manual Testing
Lessons from DevOps: Taking DevOps practices into your AppSec Life
Shifting left – embedding security into the devops pipeline by Mike d. Kail
Integrating DevOps and Security
Making Security Agile
Ad

Viewers also liked (17)

PDF
Can virtualization transform your API lifecycle?
PDF
Isabel Evans - Working Ourselves out of a Job: A Passion For Improvement - Eu...
PDF
OWASP Overview of Projects You Can Use Today - DefCamp 2012
PPTX
Testing As A Bottleneck - How Testing Slows Down Modern Development Processes...
PPT
Confess 2013: OWASP Top 10 and Java EE security in practice
PPTX
Digital Transformation, Testing and Automation
PDF
Security Development Lifecycle Tools
PDF
Testing as a Service Model
PDF
The current state of mobile testing by stephen janaway
PPTX
Continuous everything
PPTX
The Evolution of Test Automation for DevOps
PPT
'The Real Agile Testing Quadrants' with Michael Bolton
PPTX
Kanban Testing And Lego
PDF
Are Your Tests Well-Travelled? Thoughts About Test Coverage
PPTX
Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
PDF
Do we need testers on agile teams?
PDF
SlideShare 101
Can virtualization transform your API lifecycle?
Isabel Evans - Working Ourselves out of a Job: A Passion For Improvement - Eu...
OWASP Overview of Projects You Can Use Today - DefCamp 2012
Testing As A Bottleneck - How Testing Slows Down Modern Development Processes...
Confess 2013: OWASP Top 10 and Java EE security in practice
Digital Transformation, Testing and Automation
Security Development Lifecycle Tools
Testing as a Service Model
The current state of mobile testing by stephen janaway
Continuous everything
The Evolution of Test Automation for DevOps
'The Real Agile Testing Quadrants' with Michael Bolton
Kanban Testing And Lego
Are Your Tests Well-Travelled? Thoughts About Test Coverage
Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
Do we need testers on agile teams?
SlideShare 101
Ad

Similar to Zen and the art of Security Testing (20)

PDF
What Every Developer And Tester Should Know About Software Security
PPTX
Java application security the hard way - a workshop for the serious developer
PPTX
How an Attacker "Audits" Your Software Systems
PPTX
Intro to INFOSEC
PDF
How to Destroy a Database
PPTX
Security Testing.pptx
PDF
AppSec in an Agile World
PPTX
How to Test for The OWASP Top Ten
PDF
Crash Course In Brain Surgery
PPTX
Evaluating Web App, Mobile App, and API Security - Matt Cohen
PDF
IBWAS 2010: Web Security From an Auditor's Standpoint
PDF
Luis Grangeia IBWAS
PPTX
Keeping Secrets on the Internet of Things - Mobile Web Application Security
PPTX
Outpost24 webinar - Demystifying Web Application Security with Attack Surface...
PDF
Identifying a Compromised WordPress Site
PDF
iOS Application Security.pdf
PPTX
Tune in for the Ultimate WAF Torture Test: Bots Attack!
PPT
RSA2008: Sins of our Fathers, for which we still are punished
PPTX
Jason Kent - AppSec Without Additional Tools
PDF
Top 20 certified ethical hacker interview questions and answer
What Every Developer And Tester Should Know About Software Security
Java application security the hard way - a workshop for the serious developer
How an Attacker "Audits" Your Software Systems
Intro to INFOSEC
How to Destroy a Database
Security Testing.pptx
AppSec in an Agile World
How to Test for The OWASP Top Ten
Crash Course In Brain Surgery
Evaluating Web App, Mobile App, and API Security - Matt Cohen
IBWAS 2010: Web Security From an Auditor's Standpoint
Luis Grangeia IBWAS
Keeping Secrets on the Internet of Things - Mobile Web Application Security
Outpost24 webinar - Demystifying Web Application Security with Attack Surface...
Identifying a Compromised WordPress Site
iOS Application Security.pdf
Tune in for the Ultimate WAF Torture Test: Bots Attack!
RSA2008: Sins of our Fathers, for which we still are punished
Jason Kent - AppSec Without Additional Tools
Top 20 certified ethical hacker interview questions and answer

More from TEST Huddle (20)

PPTX
Why We Need Diversity in Testing- Accenture
PPTX
Keys to continuous testing for faster delivery euro star webinar
PPTX
Why you Shouldnt Automated But You Will Anyway
PDF
Being a Tester in Scrum
PDF
Leveraging Visual Testing with Your Functional Tests
PPTX
Using Test Trees to get an Overview of Test Work
PPTX
Big Data: The Magic to Attain New Heights
PPTX
Will Robots Replace Testers?
PPTX
TDD For The Rest Of Us
PDF
Scaling Agile with LeSS (Large Scale Scrum)
PPTX
Creating Agile Test Strategies for Larger Enterprises
PPTX
Is There A Risk?
PDF
Growing a Company Test Community: Roles and Paths for Testers
PDF
How to use selenium successfully
PDF
Testers & Teams on the Agile Fluency™ Journey
PDF
Practical Test Strategy Using Heuristics
PDF
Thinking Through Your Role
PDF
Using Selenium 3 0
PPTX
New Model Testing: A New Test Process and Tool
PPTX
The world class webinar series
Why We Need Diversity in Testing- Accenture
Keys to continuous testing for faster delivery euro star webinar
Why you Shouldnt Automated But You Will Anyway
Being a Tester in Scrum
Leveraging Visual Testing with Your Functional Tests
Using Test Trees to get an Overview of Test Work
Big Data: The Magic to Attain New Heights
Will Robots Replace Testers?
TDD For The Rest Of Us
Scaling Agile with LeSS (Large Scale Scrum)
Creating Agile Test Strategies for Larger Enterprises
Is There A Risk?
Growing a Company Test Community: Roles and Paths for Testers
How to use selenium successfully
Testers & Teams on the Agile Fluency™ Journey
Practical Test Strategy Using Heuristics
Thinking Through Your Role
Using Selenium 3 0
New Model Testing: A New Test Process and Tool
The world class webinar series

Recently uploaded (20)

PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Website Design Services for Small Businesses.pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
history of c programming in notes for students .pptx
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
AutoCAD Professional Crack 2025 With License Key
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Cost to Outsource Software Development in 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
Digital Systems & Binary Numbers (comprehensive )
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Website Design Services for Small Businesses.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
history of c programming in notes for students .pptx
Monitoring Stack: Grafana, Loki & Promtail
Download FL Studio Crack Latest version 2025 ?
Designing Intelligence for the Shop Floor.pdf
CHAPTER 2 - PM Management and IT Context
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Reimagine Home Health with the Power of Agentic AI​
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
iTop VPN Crack Latest Version Full Key 2025
AutoCAD Professional Crack 2025 With License Key
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Cost to Outsource Software Development in 2025
Wondershare Filmora 15 Crack With Activation Key [2025

Zen and the art of Security Testing

  • 1. Zen  and  the  Art  of   Security  Testing Testing  for  security  issues  as  a  variation  on  what  you  already   do
  • 2. About Cigital UK  and  US  consulting  firm  specializing  in  software  security.  Global   leader  in  helping  organizations  build  security  in. Over  20  years  of  research  and  successful  software  security  consulting   engagements  throughout  the  world. Offers  consulting,  training,  mobile  application  security.  Published  in   books,  white  papers,  and  articles.
  • 3. About Me • Consultant 13 years • Software security: code, design, risk • Financial, gaming, retail • Source code, architecture, security testing • (ISC)² European Advisory Council • CISSP and CSSLP exam item author • Author: 2 books + 1 chapter • OWASP Mobile Top Ten contributor • BS and MS in Computer Science • Passionate about software testers as an untapped resource in software security
  • 5. The Inspiration Before one studies Zen, mountains are mountains and waters are waters; after a first glimpse into the truth of Zen, mountains are no longer mountains and waters are no longer waters; Photo: © 2009 Abi Skipp, via Flickr
  • 6. The Metaphor Before one learns security testing, software is software and test cases are test cases; after a first glimpse into security testing, software is no longer software and test cases are no longer test cases;
  • 7. Functional Testing vs. Security Testing Testing against the design/requirements is not enough: Design specification & requirements Actual implementation Missing features (found in functional testing) Potential security vulnerabilities (not found in functional tests) Boundary condition analysis (edge and corner cases) Security testers must think “outside the box”
  • 8. Goals • Finding places in the user journey to do security testing • Working that into user stories • Working it into tests • Modifying existing test cases to cover security • Use tools for intercepting and modifying web requests www.eurostarsoftwaretesting.com
  • 9. INJECTING SECURITY TESTS INTO USER STORIES the fundamentals www.eurostarsoftwaretesting.com
  • 10. Agile User Story As a customer, I want to change my shipping address so that packages will come to my new address
  • 12. Security User Stories User Story As a customer, I want to track the shipment of my order so that I know when it will arrive. Security Story As a fraudster, I want to see the details of an order that is not my own so that I can learn another person’s private information. 12
  • 13. “Bad Guys” in Security User Stories Bad Guys • Competitor • Misbehaving customer • Hacker • Journalist • Criminal • Vandal • Disgruntled employee Goals • Learn private information • Commit a fraudulent transaction • Damage the company’s brand • Prevent people from doing their job • Sell valuable information
  • 14. “Bad Guy” User Stories Acceptance Criterion Given that the user is logged in And the session is valid And the request is for an order that does not belong to the logged-in user, When the user requests details Then display an error message And ensure the user is no longer logged in And log an error to the application log. As a criminal, I want to see the details of an order that is not mine So that I can learn private information of another person
  • 15. “Good Guys” in Security User Stories Users • Fraud Analyst • Customer Service Rep • System Operator • Well-behaved user • Manager • Auditor Goals • Verify a transaction • Determine some important information • Report on error conditions • Display the status of something 15
  • 16. “Good Guy” User Stories As a security analyst, I want to see a list of sessions with unusal characteristics So that I can identify and terminate bot and fraud sessions As a registered user, I want to receive a notification when a new device is added to my account So that I know how many devices are attached to my account
  • 17. Goals of Security User Stories • Identify an important actor (developers, security people, IT people are usually not important) • Identify an action or activity with tangible outputs • An easy tangible output is an error message • Force the business to be engaged by getting them to describe these output • Create test cases that exercise the software that way • Can you make the error message appear? www.eurostarsoftwaretesting.com
  • 19. Web Security Testing vs. Network Penetration Testing Penetration Testing • Finds services and open ports • Checks for vulnerable or misconfigured components • Often targets standard software, COTS Web Security Testing • Focuses on what is running over HTTP(S) • System usually contains custom-built code • Requires deeper knowledge of business processes and rules
  • 20. The Idea Functional Testers Know the Most! • Test data to exercise this whole flow • Insert security test data at each point o SQL injection o XML o Cross-site scripting (XSS) o JSON o CSV www.eurostarsoftwaretesting.com
  • 21. Old Skool: Boundary Value Testing Example Scenario • App allows you to share mobile minutes • 1000 minutes across 3 lines • Inputs are non-negative, integer minute values • Must sum to exactly 1000 • 0 and 1000 are valid Examples Line 1 250 Line 2 250 Line 3 500 Total 1000 Line 1 0 Line 2 1000 Line 3 0 Total 1000 Line 1 1 Line 2 1 Line 3 998 Total 1000 www.eurostarsoftwaretesting.com
  • 22. Old Skool: Boundary Value Testing Boundary Values • One more, one less, and boundary value • -1, 0, 1, 999, 1000, 1001 • This is testing 101 A few other interesting ones • MAXINT • MININT Examples Line 1 -1 Line 2 0 Line 3 1 Total err Line 1 999 Line 2 1000 Line 3 1001 Total err Line 1 -1 Line 2 0 Line 3 1001 Total err www.eurostarsoftwaretesting.com
  • 23. Equivalence Class Partitioning Sampling from Equivalence Classes • Negative numbers • Aphabetic characters • Character set, encoding variations • Unicode UTF-8 • Unicode UTF-16 • Unicode ISO-8859-1 • Null / missing / empty Examples Line 1 ABCD Line 2 500 Line 3 500 Total err Line 1 完全な失敗 Line 2 başarısızlık Line 3 ‫ﻞﺸﻓ‬ Total err Line 1 Line 2 1 Line 3 998 Total err www.eurostarsoftwaretesting.com
  • 24. Security and Equivalence Class Partitioning New Equivalence Classes • SQL Injection 'or  1=1;  -­‐-­‐ '  and  'A'='A'; • Cross-site scripting <script> <img  src="http://.../"…> • Other encoding issues • URI encoding • HTTP encoding • Base64 misalignments • Etc. Examples Line 1 ‘ or 1=1’; Line 2 ’ and a=a; -- Line 3 ‘ group by -- Total err Line 1 <script> Line 2 <body onload=> Line 3 <a onmousover> Total err www.eurostarsoftwaretesting.com
  • 25. Where do I get these test data? • Cross-site Scripting (XSS) • OWASP Cross Site Scripting Cheat Sheet • https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sh eet • http://htmlpurifier.org/live/smoketests/xssAttacks.php • SQL Injection • SQLNinja • SQLMap • Kali Linux (many security tools built in) • HTML, XML, JSON www.eurostarsoftwaretesting.com
  • 26. SECURITY TOOLS FOR WEB TESTING www.eurostarsoftwaretesting.com
  • 27. Two Important Tools 1.Firebug 2.Burp (don’t forget Selenium) www.eurostarsoftwaretesting.com
  • 28. Firebug • Add-on for Firefox (http://getfirebug.com/) • Views the DOM as it really is • Interactively manipulates the DOM • Great things to do: • Undo disabled="true" • Identify XPATH for Selenium www.eurostarsoftwaretesting.com
  • 29. Intercepting Traffic • Local proxy acts as man-in- the-middle • HTTPS traffic is decrypted and viewable in plain text in local proxy • Insert data that you can’t put into a field via the browser • See hidden fields, cookies, etc. Even HTTPS traffic can be intercepted: Tester’s Machine Server Tester’s Browser Tester’s Proxy HTTPS Tunnel 1 HTTPS Tunnel 2
  • 30. Burp Proxy • Start local proxy and configure interface and port to listen to • If necessary, configure upstream proxy server(s) You can run a local HTTP proxy on your own machine:
  • 31. Security Testing Monitor, intercept, and rewrite traffic in your local proxy:
  • 33. Bypassing All Client Side Checks • After inputs are checked • Before they’re received by the server Works on Mobile Too Tester’s Machine Server Tester’s Browser Tester’s Proxy Rewrite responses?
  • 35. Everyone who has something to do with SOFTWARE has something to do with SOFTWARE SECURITY
  • 36. Wrapping Up • User stories let us describe security behaviour • Good Guys • Bad Guys • Error messages • Put security test data into standard functional tests • Get test data ideas from OWASP • Get free tools and try them • Use a proxy to intercept and modify HTTP communication www.eurostarsoftwaretesting.com
  • 37. 37 The best time to plant an oak tree was twenty years ago. The next best time is now. —Ancient Proverb Paco Hope, CISSP,CSSLP paco@cigital.com Twitter: @pacohope