SlideShare una empresa de Scribd logo
1 de 55
Descargar para leer sin conexión
DenimGroup Auth Example

Using TruClient in WebInspect 9.2

 Technical study to show WebInspect capabilities




Hans Enders, HP Presales
 May 1, 2012


©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
Background

•   This document details how to use the WebInspect 9.20 new TruClient
    Web Macro Recorder (WMR) against a simple Challenge-Response
    authentication app.


•   This document is meant to demonstrate that WebInspect can manage
    these scenarios out-of-the-box as well as to show the user many
    advanced capabilities it offers to maintain session state.


•   Since TruClient records user actions and not simple sessions, it includes
    the ability to handle advanced Q&A without needing changes to the
    application under test.
Background

•   Vendor Challenge:
    •   http://diniscruz.blogspot.co.uk/2012/04/small-step-for-appsec-large-step-for.html


•   Discussion centered around this DenimGroup blog entry:
    •   http://blog.denimgroup.com/denim_group/2012/04/automated-application-scanning-
        handling-complicated-logins-with-appscan-and-burp-suite.html


•   The sample app was provided by DenimGroup:
    –   https://github.com/denimgroup/authexamples
Agenda:
    Overview & Configuration

   Demo app walk-through
   Macro for demo app

   Customized demo app
   Macro for customized app
   Finalizing the macro




©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
Overview

•   Auth example application provided by DenimGroup
    –   All Responses are “apple”
    –   Hosting app to local instance of XAMPP


•   Initial recording


•   Editing the example app for differing Answers: “apple, CEO, White”
Demo app - Authexamples
https://github.com/denimgroup/authexamples

•   What - A simple Challenge-Response app in PHP, using a single answer
    for all questions.


•   Description:
    –   This is a simple project that is intended to demonstrate a couple of different non-standard
        authentication scenarios for folks to train their scanners and scanner operators on.
        Currently based on a single scenario in PHP, we'd love to add more scenarios.
        Questions/comments/updates? Please contact dan _at_ denimgroup.com
Demo app – posting to XAMPP
http://www.apachefriends.org/en/xampp-windows.html

•   What - A simple web server suite for Windows.
•   OS used – Windows 7 64-bit
•   Installed path: C:Websitesxampp



•   XAMPP 1.7.7, including:
    –   Apache 2.2.21
    –   MySQL 5.5.16
    –   PHP 5.3.8
    –   phpMyAdmin 3.4.5
    –   FileZilla FTP Server 0.9.39
    –   Tomcat 7.0.21 (with mod_proxy_ajp as connector)
Demo app – posting to XAMPP
http://www.apachefriends.org/en/xampp-windows.html

•   Extracted AuthExample to XAMPP htdocs folder:
    –   C:Websitesxampphtdocsdenimgroup-authexamples-5059b6f
    –   URL: http://localhost/denimgroup-authexamples-5059b6f/index.php
Agenda:
    Overview & Configuration

   Demo app walk-through
   Macro for demo app

   Customized demo app
   Macro for customized app
   Finalizing the macro




©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
Demo app – normal walk through
Login screens
Demo app – default Answers
C:Websitesxampphtdocsdenimgroup-authexamples-
5059b6floginplusquestionlogin.php

•   Answers are all set to “apple” inside login.php


//        Set up some page data
$second_stage_questions[0] = array( '1234', 'What is your favorite fruit',
  'apple' );
$second_stage_questions[1] = array( '817', 'What is your favorite Jobs
  job', 'apple' );
$second_stage_questions[2] = array( '423', 'What is your favorite Beatles
  record label', 'apple' );
Demo app – normal walk through
Challenge screens – all “apple”
Demo app – normal walk through
Login, browse, logout
Agenda:
    Overview & Configuration

   Demo app walk-through
   Macro for demo app

   Customized demo app
   Macro for customized app
   Finalizing the macro




©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
TruClient WMR
Web Macro Recorder for WebInspect 9.20

•    HP TruClient is the latest iteration of HP WebInspect’s Web Macro
     Recorder tool (WMR).


•    TruClient is an Event-based UI recorder.


•    The two prior WMR tools are still present in WebInspect:
     •   Event-based WMR
     •   Session-based (Traffic-based) WMR.




15   Enterprise Security – HP Confidential
WMR – simple recording
Raw recorded steps




16   Enterprise Security – HP Confidential
WMR – simple recording
Playback successful
Notice that Step #8 is the Challenge-Response (Q&A) session.




17   Enterprise Security – HP Confidential
WMR - simple recording
Once Playback is successful, browse to get logged out




                                         1




                                             2




                                                 3
18   Enterprise Security – HP Confidential
WMR – simple recording
Once logged out, click Select button – highlight identifying element
                                                            1          2




                                                  3a




                                             3b


19   Enterprise Security – HP Confidential
WMR – simple recording
Review the Logout Condition




20   Enterprise Security – HP Confidential
WMR – simple recording is Done
Works out-of-the-box




21   Enterprise Security – HP Confidential
Agenda:
    Overview & Configuration

   Demo app walk-through
   Macro for demo app

   Customized demo app
   Macro for customized app
   Finalizing the macro




©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
Demo app – custom Answers
C:Websitesxampphtdocsdenimgroup-authexamples-
5059b6floginplusquestionlogin.php

•   Edited the answers to “apple”, “CEO”, and “White” inside login.php.


//        Set up some page data
$second_stage_questions[0] = array( '1234', 'What is your favorite fruit',
  'apple' );
$second_stage_questions[1] = array( '817', 'What is your favorite Jobs
  job', ‘CEO' );
$second_stage_questions[2] = array( '423', 'What is your favorite Beatles
  record label', ‘White' );
Demo app – custom Answers
Challenge screens – now different
Agenda:
    Overview & Configuration

   Demo app walk-through
   Macro for demo app

   Customized demo app
   Macro for customized app
   Finalizing the macro




©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
WMR – custom Answers
Initial recording. Press Stop, ignore the follow-up Play button, we will need
some Q&A code added




26   Enterprise Security – HP Confidential
WMR – custom Answers
Final Goal

•    To manage dynamic Challenge-Response, the TruClient user will need to
     insert three new steps into the recorded steps.


     1.     Evaluate JavaScript code – Dynamic Security Questions
     2.     Evaluate JavaScript – setSecurityQuestion
     3.     Evaluate JavaScript - getDynamicAnswer


•    For Q&A involving more than one field, each field will need its own pair
     of setSecurityQuestion and getDynamicAnswer steps, but may be able to
     all share a single step for the Dynamic Security Questions.




27   Enterprise Security – HP Confidential
WMR – custom Answers
Sneak peek - Final Goal




28   Enterprise Security – HP Confidential
WMR - custom Answers
Insert new Step #7 – “Evaluate JavaScript” from Toolbox sidebar




29   Enterprise Security – HP Confidential
Code – Dynamic Security Question
Open the JavaScript Editor window

•    Expand the new Javascript step > click on “[Code]” > expand
     “Arguments” > “JS” button




30   Enterprise Security – HP Confidential
Code – Dynamic Security Question
Sample code

•    Build your raw JS, or steal this basic script framework shown below.
     –   Edit the questionAnswer lines to match your situation.
     –   Note that variable names created here must be kept the same elsewhere as we continue.

     //dynamic security questions

     var questionAnswer = [];
     questionAnswer["What is your favorite fruit"] = "apple";
     questionAnswer["What is your favorite Jobs job"] = "CEO";
     questionAnswer["What is your favorite Beatles record label"] = "White";

     var currentQ;
     function setSecurityQuestion(q)
     {
       currentQ = q.replace(/^ss*/, '').replace(/ss*$/, '');
     }

     function getDynamicAnswer()
     {
       return questionAnswer[currentQ];
     }

31   Enterprise Security – HP Confidential
Code – Dynamic Security Question
Sample code




32   Enterprise Security – HP Confidential
Code – Dynamic Security Question
Sample code

•    User simply pastes in this code sample, then edits the “questionAnswer”
     lines to match their situation.
     •   Update the question inside quotes
     •   Update the answer at the end, also in quotes


•    Note that variable names used in this script will be used elsewhere, so
     the user must keep them the same.




33   Enterprise Security – HP Confidential
Code – Dynamic Security Question
Sample code

•    Here is what Step #7 has become.




34   Enterprise Security – HP Confidential
Code – setSecurityQuestion
Insert new Step #8 – “Evaluate JS on Object” from Toolbox sidebar




35   Enterprise Security – HP Confidential
Code – setSecurityQuestion
Choose the Question object

•    Play this step alone, then high-light the JavaScript Object in the browser.
     –   Right-click step, or high-light and press F7
     –   “!” icon simply indicates an error on Playback, offering details with mouseover.




36   Enterprise Security – HP Confidential
Code – setSecurityQuestion
Choose the Question object

•    For this example app, we cannot just select the Question text because
     the text is not contained within an element of its own (see green block
     below). Because of this we need to do some additional regular
     expression parsing. On most sites this step would not be necessary.




37   Enterprise Security – HP Confidential
Code – setSecurityQuestion
Identify the Question object

•    Sample of the raw text offered:
     –   Hint: apple is a pretty good choice for all the questions
     –   Question: What is your favorite fruit
•    Used included Regular Expression Editor tool to work up regex:
     –   Question:s(.*)


•    Open the JavaScript Editor for this new step




38   Enterprise Security – HP Confidential
Code – setSecurityQuestion
Identify the Question object

•    Useful test code to verify proper regex working in JS:
     –   basic >> window.alert(object.textContent)
     –   This test app >> window.alert(object.textContent.match(/Question:s(.*)/)[1])
•    Play this Step to check pop-up – does it match your desired Question
     text? yes




39   Enterprise Security – HP Confidential
Code – setSecurityQuestion
Identify the Question object

•    With the Alert pop-up verification, we are secure our regex works.


•    Here is our regex inserted into our standard setSecurityQuestion code:
     –   setSecurityQuestion(object.textContent.match(/Question:s(.*)/)[1])


•    Paste this into the JS Editor window
     –   Recall that this variable name “setSecurityQuestion” must match what we created for the
         Q&A code back in Step #7.




40   Enterprise Security – HP Confidential
Code – element location
Quick edit for the setSecurityQuestion step

•    TruClient by default will locate a text object by doing an exact match on
     the text. For security questions, we want to locate the text object by
     position instead. To do this we must change the ID Method from
     "Automatic" to "XPath".




41   Enterprise Security – HP Confidential
Code – element location
Quick edit for the setSecurityQuestion step

•    Expand the drop down menu for "XPath:" and choose the second XPath
     expression “/html/body/width” to find the question by its position.
     –   Verify this new entry in the browser by using the Highlight button




42   Enterprise Security – HP Confidential
Code – getDynamicAnswer
Connect the Question back to the Javascript Q&A code

•    We have now added to the macro our Q&A code and code to identify
     the Question.
•    Now to edit Step #9 so the Answer matches the Question…




43   Enterprise Security – HP Confidential
Code – getDynamicAnswer
Connect the Answer back to the Javascript Q&A code in Step #7

•    Open the JS Editor windows for Step #9’s Argument and enter in our
     standard code:
     –   getDynamicAnswer()




44   Enterprise Security – HP Confidential
Agenda:
    Overview & Configuration

   Demo app walk-through
   Macro for demo app

   Customized demo app
   Macro for customized app
   Finalizing the macro




©2011 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
WMR final steps
Play the finished macro from the beginning




46   Enterprise Security – HP Confidential
WMR final steps
Playback successful, select Logout Condition for WebInspect




47   Enterprise Security – HP Confidential
Logout Conditions
Wait, what are these again?

•       A logout condition is an indicator for WebInspect to know when it has
        gotten logged out while scanning


•       Every Login Macro must have one or more logout conditions
    •    Whether or not it involved Challenge-Response questions



•       Three Types of logout conditions
         •   Regular Expression - Supported for all three Web Macro Recorders
         •   Object - TruClient, UI event-based WMR only
         •   URL - TruClient, UI event-based WMR only
WMR final steps
Browse to Logout, then click Select button – highlight element
                                                             1   2




                                                  3a




                                             3b


49   Enterprise Security – HP Confidential
WMR final steps
Review the Logout Condition – add more as needed




50   Enterprise Security – HP Confidential
WMR – custom Answers
Final Macro




51   Enterprise Security – HP Confidential
WMR – custom Answers
Final Macro - closer




52   Enterprise Security – HP Confidential
WMR – custom Answers
Final Macro – with Comments added from the Toolbox sidebar




53   Enterprise Security – HP Confidential
Denouement

•    Apologies for the length of this study. This technology is sufficiently new
     that I wanted our customers to fully understand the steps.
     –   Future studies should be able to skip well-known steps.




•    My thanks go to:


•    Steve Hardeman for his JS coaching and internal training
•    Jeremy Brooks for guidance in setting up this study and the optimal macro
•    The HP Fortify Dev team for their tremendous work on this new WMR tool




54   Enterprise Security – HP Confidential
Outcomes That Matter




Enterprise Security – HP Confidential
  55

Más contenido relacionado

Más de Denim Group

Using Collaboration to Make Application Vulnerability Management a Team Sport
Using Collaboration to Make Application Vulnerability Management a Team SportUsing Collaboration to Make Application Vulnerability Management a Team Sport
Using Collaboration to Make Application Vulnerability Management a Team SportDenim Group
 
Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...
Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...
Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...Denim Group
 
Security Champions: Pushing Security Expertise to the Edges of Your Organization
Security Champions: Pushing Security Expertise to the Edges of Your OrganizationSecurity Champions: Pushing Security Expertise to the Edges of Your Organization
Security Champions: Pushing Security Expertise to the Edges of Your OrganizationDenim Group
 
The As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native ApplicationsThe As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native ApplicationsDenim Group
 
An Updated Take: Threat Modeling for IoT Systems
An Updated Take: Threat Modeling for IoT SystemsAn Updated Take: Threat Modeling for IoT Systems
An Updated Take: Threat Modeling for IoT SystemsDenim Group
 
Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...
Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...
Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...Denim Group
 
A New View of Your Application Security Program with Snyk and ThreadFix
A New View of Your Application Security Program with Snyk and ThreadFixA New View of Your Application Security Program with Snyk and ThreadFix
A New View of Your Application Security Program with Snyk and ThreadFixDenim Group
 
Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...Denim Group
 
AppSec in a World of Digital Transformation
AppSec in a World of Digital TransformationAppSec in a World of Digital Transformation
AppSec in a World of Digital TransformationDenim Group
 
The As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native ApplicationsThe As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native ApplicationsDenim Group
 
Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...Denim Group
 
AppSec in a World of Digital Transformation
 AppSec in a World of Digital Transformation AppSec in a World of Digital Transformation
AppSec in a World of Digital TransformationDenim Group
 
Enumerating Enterprise Attack Surface
Enumerating Enterprise Attack SurfaceEnumerating Enterprise Attack Surface
Enumerating Enterprise Attack SurfaceDenim Group
 
Enumerating Enterprise Attack Surface
Enumerating Enterprise Attack SurfaceEnumerating Enterprise Attack Surface
Enumerating Enterprise Attack SurfaceDenim Group
 
Assessing Business Operations Risk With Unified Vulnerability Management in T...
Assessing Business Operations Risk With Unified Vulnerability Management in T...Assessing Business Operations Risk With Unified Vulnerability Management in T...
Assessing Business Operations Risk With Unified Vulnerability Management in T...Denim Group
 
An OWASP SAMM Perspective on Serverless Computing
An OWASP SAMM Perspective on Serverless ComputingAn OWASP SAMM Perspective on Serverless Computing
An OWASP SAMM Perspective on Serverless ComputingDenim Group
 
Optimize Your Security Program with ThreadFix 2.7
Optimize Your Security Program with ThreadFix 2.7Optimize Your Security Program with ThreadFix 2.7
Optimize Your Security Program with ThreadFix 2.7Denim Group
 
Application Security Testing for a DevOps Mindset
Application Security Testing for a DevOps Mindset  Application Security Testing for a DevOps Mindset
Application Security Testing for a DevOps Mindset Denim Group
 
Reducing Attack Surface in Budget Constrained Environments
Reducing Attack Surface in Budget Constrained EnvironmentsReducing Attack Surface in Budget Constrained Environments
Reducing Attack Surface in Budget Constrained EnvironmentsDenim Group
 
Securing Voting Infrastructure before the Mid-Term Elections
Securing Voting Infrastructure before the Mid-Term ElectionsSecuring Voting Infrastructure before the Mid-Term Elections
Securing Voting Infrastructure before the Mid-Term ElectionsDenim Group
 

Más de Denim Group (20)

Using Collaboration to Make Application Vulnerability Management a Team Sport
Using Collaboration to Make Application Vulnerability Management a Team SportUsing Collaboration to Make Application Vulnerability Management a Team Sport
Using Collaboration to Make Application Vulnerability Management a Team Sport
 
Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...
Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...
Managing Penetration Testing Programs and Vulnerability Time to Live with Thr...
 
Security Champions: Pushing Security Expertise to the Edges of Your Organization
Security Champions: Pushing Security Expertise to the Edges of Your OrganizationSecurity Champions: Pushing Security Expertise to the Edges of Your Organization
Security Champions: Pushing Security Expertise to the Edges of Your Organization
 
The As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native ApplicationsThe As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native Applications
 
An Updated Take: Threat Modeling for IoT Systems
An Updated Take: Threat Modeling for IoT SystemsAn Updated Take: Threat Modeling for IoT Systems
An Updated Take: Threat Modeling for IoT Systems
 
Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...
Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...
Continuous Authority to Operate (ATO) with ThreadFix – Bringing Commercial In...
 
A New View of Your Application Security Program with Snyk and ThreadFix
A New View of Your Application Security Program with Snyk and ThreadFixA New View of Your Application Security Program with Snyk and ThreadFix
A New View of Your Application Security Program with Snyk and ThreadFix
 
Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...
 
AppSec in a World of Digital Transformation
AppSec in a World of Digital TransformationAppSec in a World of Digital Transformation
AppSec in a World of Digital Transformation
 
The As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native ApplicationsThe As, Bs, and Four Cs of Testing Cloud-Native Applications
The As, Bs, and Four Cs of Testing Cloud-Native Applications
 
Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...Enabling Developers in Your Application Security Program With Coverity and Th...
Enabling Developers in Your Application Security Program With Coverity and Th...
 
AppSec in a World of Digital Transformation
 AppSec in a World of Digital Transformation AppSec in a World of Digital Transformation
AppSec in a World of Digital Transformation
 
Enumerating Enterprise Attack Surface
Enumerating Enterprise Attack SurfaceEnumerating Enterprise Attack Surface
Enumerating Enterprise Attack Surface
 
Enumerating Enterprise Attack Surface
Enumerating Enterprise Attack SurfaceEnumerating Enterprise Attack Surface
Enumerating Enterprise Attack Surface
 
Assessing Business Operations Risk With Unified Vulnerability Management in T...
Assessing Business Operations Risk With Unified Vulnerability Management in T...Assessing Business Operations Risk With Unified Vulnerability Management in T...
Assessing Business Operations Risk With Unified Vulnerability Management in T...
 
An OWASP SAMM Perspective on Serverless Computing
An OWASP SAMM Perspective on Serverless ComputingAn OWASP SAMM Perspective on Serverless Computing
An OWASP SAMM Perspective on Serverless Computing
 
Optimize Your Security Program with ThreadFix 2.7
Optimize Your Security Program with ThreadFix 2.7Optimize Your Security Program with ThreadFix 2.7
Optimize Your Security Program with ThreadFix 2.7
 
Application Security Testing for a DevOps Mindset
Application Security Testing for a DevOps Mindset  Application Security Testing for a DevOps Mindset
Application Security Testing for a DevOps Mindset
 
Reducing Attack Surface in Budget Constrained Environments
Reducing Attack Surface in Budget Constrained EnvironmentsReducing Attack Surface in Budget Constrained Environments
Reducing Attack Surface in Budget Constrained Environments
 
Securing Voting Infrastructure before the Mid-Term Elections
Securing Voting Infrastructure before the Mid-Term ElectionsSecuring Voting Infrastructure before the Mid-Term Elections
Securing Voting Infrastructure before the Mid-Term Elections
 

Último

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Último (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

WebInspect 9.20 Web Macro Recording with TruClient 2012

  • 1. DenimGroup Auth Example Using TruClient in WebInspect 9.2 Technical study to show WebInspect capabilities Hans Enders, HP Presales May 1, 2012 ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 2. Background • This document details how to use the WebInspect 9.20 new TruClient Web Macro Recorder (WMR) against a simple Challenge-Response authentication app. • This document is meant to demonstrate that WebInspect can manage these scenarios out-of-the-box as well as to show the user many advanced capabilities it offers to maintain session state. • Since TruClient records user actions and not simple sessions, it includes the ability to handle advanced Q&A without needing changes to the application under test.
  • 3. Background • Vendor Challenge: • http://diniscruz.blogspot.co.uk/2012/04/small-step-for-appsec-large-step-for.html • Discussion centered around this DenimGroup blog entry: • http://blog.denimgroup.com/denim_group/2012/04/automated-application-scanning- handling-complicated-logins-with-appscan-and-burp-suite.html • The sample app was provided by DenimGroup: – https://github.com/denimgroup/authexamples
  • 4. Agenda: Overview & Configuration Demo app walk-through Macro for demo app Customized demo app Macro for customized app Finalizing the macro ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 5. Overview • Auth example application provided by DenimGroup – All Responses are “apple” – Hosting app to local instance of XAMPP • Initial recording • Editing the example app for differing Answers: “apple, CEO, White”
  • 6. Demo app - Authexamples https://github.com/denimgroup/authexamples • What - A simple Challenge-Response app in PHP, using a single answer for all questions. • Description: – This is a simple project that is intended to demonstrate a couple of different non-standard authentication scenarios for folks to train their scanners and scanner operators on. Currently based on a single scenario in PHP, we'd love to add more scenarios. Questions/comments/updates? Please contact dan _at_ denimgroup.com
  • 7. Demo app – posting to XAMPP http://www.apachefriends.org/en/xampp-windows.html • What - A simple web server suite for Windows. • OS used – Windows 7 64-bit • Installed path: C:Websitesxampp • XAMPP 1.7.7, including: – Apache 2.2.21 – MySQL 5.5.16 – PHP 5.3.8 – phpMyAdmin 3.4.5 – FileZilla FTP Server 0.9.39 – Tomcat 7.0.21 (with mod_proxy_ajp as connector)
  • 8. Demo app – posting to XAMPP http://www.apachefriends.org/en/xampp-windows.html • Extracted AuthExample to XAMPP htdocs folder: – C:Websitesxampphtdocsdenimgroup-authexamples-5059b6f – URL: http://localhost/denimgroup-authexamples-5059b6f/index.php
  • 9. Agenda: Overview & Configuration Demo app walk-through Macro for demo app Customized demo app Macro for customized app Finalizing the macro ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 10. Demo app – normal walk through Login screens
  • 11. Demo app – default Answers C:Websitesxampphtdocsdenimgroup-authexamples- 5059b6floginplusquestionlogin.php • Answers are all set to “apple” inside login.php // Set up some page data $second_stage_questions[0] = array( '1234', 'What is your favorite fruit', 'apple' ); $second_stage_questions[1] = array( '817', 'What is your favorite Jobs job', 'apple' ); $second_stage_questions[2] = array( '423', 'What is your favorite Beatles record label', 'apple' );
  • 12. Demo app – normal walk through Challenge screens – all “apple”
  • 13. Demo app – normal walk through Login, browse, logout
  • 14. Agenda: Overview & Configuration Demo app walk-through Macro for demo app Customized demo app Macro for customized app Finalizing the macro ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 15. TruClient WMR Web Macro Recorder for WebInspect 9.20 • HP TruClient is the latest iteration of HP WebInspect’s Web Macro Recorder tool (WMR). • TruClient is an Event-based UI recorder. • The two prior WMR tools are still present in WebInspect: • Event-based WMR • Session-based (Traffic-based) WMR. 15 Enterprise Security – HP Confidential
  • 16. WMR – simple recording Raw recorded steps 16 Enterprise Security – HP Confidential
  • 17. WMR – simple recording Playback successful Notice that Step #8 is the Challenge-Response (Q&A) session. 17 Enterprise Security – HP Confidential
  • 18. WMR - simple recording Once Playback is successful, browse to get logged out 1 2 3 18 Enterprise Security – HP Confidential
  • 19. WMR – simple recording Once logged out, click Select button – highlight identifying element 1 2 3a 3b 19 Enterprise Security – HP Confidential
  • 20. WMR – simple recording Review the Logout Condition 20 Enterprise Security – HP Confidential
  • 21. WMR – simple recording is Done Works out-of-the-box 21 Enterprise Security – HP Confidential
  • 22. Agenda: Overview & Configuration Demo app walk-through Macro for demo app Customized demo app Macro for customized app Finalizing the macro ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 23. Demo app – custom Answers C:Websitesxampphtdocsdenimgroup-authexamples- 5059b6floginplusquestionlogin.php • Edited the answers to “apple”, “CEO”, and “White” inside login.php. // Set up some page data $second_stage_questions[0] = array( '1234', 'What is your favorite fruit', 'apple' ); $second_stage_questions[1] = array( '817', 'What is your favorite Jobs job', ‘CEO' ); $second_stage_questions[2] = array( '423', 'What is your favorite Beatles record label', ‘White' );
  • 24. Demo app – custom Answers Challenge screens – now different
  • 25. Agenda: Overview & Configuration Demo app walk-through Macro for demo app Customized demo app Macro for customized app Finalizing the macro ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 26. WMR – custom Answers Initial recording. Press Stop, ignore the follow-up Play button, we will need some Q&A code added 26 Enterprise Security – HP Confidential
  • 27. WMR – custom Answers Final Goal • To manage dynamic Challenge-Response, the TruClient user will need to insert three new steps into the recorded steps. 1. Evaluate JavaScript code – Dynamic Security Questions 2. Evaluate JavaScript – setSecurityQuestion 3. Evaluate JavaScript - getDynamicAnswer • For Q&A involving more than one field, each field will need its own pair of setSecurityQuestion and getDynamicAnswer steps, but may be able to all share a single step for the Dynamic Security Questions. 27 Enterprise Security – HP Confidential
  • 28. WMR – custom Answers Sneak peek - Final Goal 28 Enterprise Security – HP Confidential
  • 29. WMR - custom Answers Insert new Step #7 – “Evaluate JavaScript” from Toolbox sidebar 29 Enterprise Security – HP Confidential
  • 30. Code – Dynamic Security Question Open the JavaScript Editor window • Expand the new Javascript step > click on “[Code]” > expand “Arguments” > “JS” button 30 Enterprise Security – HP Confidential
  • 31. Code – Dynamic Security Question Sample code • Build your raw JS, or steal this basic script framework shown below. – Edit the questionAnswer lines to match your situation. – Note that variable names created here must be kept the same elsewhere as we continue. //dynamic security questions var questionAnswer = []; questionAnswer["What is your favorite fruit"] = "apple"; questionAnswer["What is your favorite Jobs job"] = "CEO"; questionAnswer["What is your favorite Beatles record label"] = "White"; var currentQ; function setSecurityQuestion(q) { currentQ = q.replace(/^ss*/, '').replace(/ss*$/, ''); } function getDynamicAnswer() { return questionAnswer[currentQ]; } 31 Enterprise Security – HP Confidential
  • 32. Code – Dynamic Security Question Sample code 32 Enterprise Security – HP Confidential
  • 33. Code – Dynamic Security Question Sample code • User simply pastes in this code sample, then edits the “questionAnswer” lines to match their situation. • Update the question inside quotes • Update the answer at the end, also in quotes • Note that variable names used in this script will be used elsewhere, so the user must keep them the same. 33 Enterprise Security – HP Confidential
  • 34. Code – Dynamic Security Question Sample code • Here is what Step #7 has become. 34 Enterprise Security – HP Confidential
  • 35. Code – setSecurityQuestion Insert new Step #8 – “Evaluate JS on Object” from Toolbox sidebar 35 Enterprise Security – HP Confidential
  • 36. Code – setSecurityQuestion Choose the Question object • Play this step alone, then high-light the JavaScript Object in the browser. – Right-click step, or high-light and press F7 – “!” icon simply indicates an error on Playback, offering details with mouseover. 36 Enterprise Security – HP Confidential
  • 37. Code – setSecurityQuestion Choose the Question object • For this example app, we cannot just select the Question text because the text is not contained within an element of its own (see green block below). Because of this we need to do some additional regular expression parsing. On most sites this step would not be necessary. 37 Enterprise Security – HP Confidential
  • 38. Code – setSecurityQuestion Identify the Question object • Sample of the raw text offered: – Hint: apple is a pretty good choice for all the questions – Question: What is your favorite fruit • Used included Regular Expression Editor tool to work up regex: – Question:s(.*) • Open the JavaScript Editor for this new step 38 Enterprise Security – HP Confidential
  • 39. Code – setSecurityQuestion Identify the Question object • Useful test code to verify proper regex working in JS: – basic >> window.alert(object.textContent) – This test app >> window.alert(object.textContent.match(/Question:s(.*)/)[1]) • Play this Step to check pop-up – does it match your desired Question text? yes 39 Enterprise Security – HP Confidential
  • 40. Code – setSecurityQuestion Identify the Question object • With the Alert pop-up verification, we are secure our regex works. • Here is our regex inserted into our standard setSecurityQuestion code: – setSecurityQuestion(object.textContent.match(/Question:s(.*)/)[1]) • Paste this into the JS Editor window – Recall that this variable name “setSecurityQuestion” must match what we created for the Q&A code back in Step #7. 40 Enterprise Security – HP Confidential
  • 41. Code – element location Quick edit for the setSecurityQuestion step • TruClient by default will locate a text object by doing an exact match on the text. For security questions, we want to locate the text object by position instead. To do this we must change the ID Method from "Automatic" to "XPath". 41 Enterprise Security – HP Confidential
  • 42. Code – element location Quick edit for the setSecurityQuestion step • Expand the drop down menu for "XPath:" and choose the second XPath expression “/html/body/width” to find the question by its position. – Verify this new entry in the browser by using the Highlight button 42 Enterprise Security – HP Confidential
  • 43. Code – getDynamicAnswer Connect the Question back to the Javascript Q&A code • We have now added to the macro our Q&A code and code to identify the Question. • Now to edit Step #9 so the Answer matches the Question… 43 Enterprise Security – HP Confidential
  • 44. Code – getDynamicAnswer Connect the Answer back to the Javascript Q&A code in Step #7 • Open the JS Editor windows for Step #9’s Argument and enter in our standard code: – getDynamicAnswer() 44 Enterprise Security – HP Confidential
  • 45. Agenda: Overview & Configuration Demo app walk-through Macro for demo app Customized demo app Macro for customized app Finalizing the macro ©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice
  • 46. WMR final steps Play the finished macro from the beginning 46 Enterprise Security – HP Confidential
  • 47. WMR final steps Playback successful, select Logout Condition for WebInspect 47 Enterprise Security – HP Confidential
  • 48. Logout Conditions Wait, what are these again? • A logout condition is an indicator for WebInspect to know when it has gotten logged out while scanning • Every Login Macro must have one or more logout conditions • Whether or not it involved Challenge-Response questions • Three Types of logout conditions • Regular Expression - Supported for all three Web Macro Recorders • Object - TruClient, UI event-based WMR only • URL - TruClient, UI event-based WMR only
  • 49. WMR final steps Browse to Logout, then click Select button – highlight element 1 2 3a 3b 49 Enterprise Security – HP Confidential
  • 50. WMR final steps Review the Logout Condition – add more as needed 50 Enterprise Security – HP Confidential
  • 51. WMR – custom Answers Final Macro 51 Enterprise Security – HP Confidential
  • 52. WMR – custom Answers Final Macro - closer 52 Enterprise Security – HP Confidential
  • 53. WMR – custom Answers Final Macro – with Comments added from the Toolbox sidebar 53 Enterprise Security – HP Confidential
  • 54. Denouement • Apologies for the length of this study. This technology is sufficiently new that I wanted our customers to fully understand the steps. – Future studies should be able to skip well-known steps. • My thanks go to: • Steve Hardeman for his JS coaching and internal training • Jeremy Brooks for guidance in setting up this study and the optimal macro • The HP Fortify Dev team for their tremendous work on this new WMR tool 54 Enterprise Security – HP Confidential
  • 55. Outcomes That Matter Enterprise Security – HP Confidential 55