Tracing User Input Through JS is for Tools Jake Heath and Michael - - PowerPoint PPT Presentation

tracing user input through js is for tools
SMART_READER_LITE
LIVE PREVIEW

Tracing User Input Through JS is for Tools Jake Heath and Michael - - PowerPoint PPT Presentation

Tracing User Input Through JS is for Tools Jake Heath and Michael Roberts bio Jake Heath Penetration Tester @ NCC Group San Francisco, CA Beard Bread Michael Roberts Penetration Tester @ NCC Group San


slide-1
SLIDE 1

Tracing User Input Through JS is for Tools

Jake Heath and Michael Roberts

slide-2
SLIDE 2

bio

Jake Heath

  • Penetration Tester @ NCC Group
  • San Francisco, CA
  • Beard
  • Bread

Michael Roberts

  • Penetration Tester @ NCC Group
  • San Francisco, CA
  • Can’t grow a beard
  • Less bread
slide-3
SLIDE 3

goal tools tracy

  • verview
slide-4
SLIDE 4

...to eliminate all XSS goal

slide-5
SLIDE 5

...to eliminate all XSS goal ...with the DOM ...with human interaction

slide-6
SLIDE 6

...to eliminate all XSS anti-goals ...with AI ...with automated scanning ...with static analysis ...with blockchain$$

slide-7
SLIDE 7

existing tools

manual testing & intercepting proxies static analysis

  • ther
slide-8
SLIDE 8
  • Burp Suite
  • spray app with payloads

○ <script>alert(n)</script>

  • navigate app until alert fires
  • identify which input triggered the alert
  • document the bug

manual testing - a shotgun approach

slide-9
SLIDE 9

manual testing - a shotgun approach

  • pros

○ super easy ○ requires very little setup or knowledge ○ fast

  • cons

○ simple input validation can slow down testing ○ no easy way to track origin ○ can get annoying ○ potentially poor coverage ○ Burp has no concept of the DOM

slide-10
SLIDE 10

static analysis

  • Burp Active Scanner or Checkmarx
  • attempts to map sinks to sources

○ input field value -> dangerouslySetHTML()

  • uses an AST to try to resolve paths
slide-11
SLIDE 11

static analysis

  • pros

○ very little user interaction ○ could find hidden logic ○ non-intrusive ○ low learning curve

  • cons

  • ften cost $$$

○ >> false positive/false negatives ○ time intensive ○ no DOM context ○ misses server side logic

slide-12
SLIDE 12
  • ther
  • browser forks

○ has the ability to monitor call stack of potential input sources ○ follow all sources to potential sinks

  • headless browser
slide-13
SLIDE 13
  • ther
  • pros

○ has a deep understanding of the JavaScript and DOM ○ can understand how to unlock new paths ○ complete tracing of input

  • cons

○ hard to keep up to date ○ $$ ○ learning curve

slide-14
SLIDE 14

tracy

MutationObserver browser extension proxy

slide-15
SLIDE 15

How is this possible?

slide-16
SLIDE 16
slide-17
SLIDE 17

Tracy Workflow

slide-18
SLIDE 18

Tracy Workflow

slide-19
SLIDE 19

Using DOM Mutations to Detect XSS

slide-20
SLIDE 20

demo!

slide-21
SLIDE 21

What can tracy do?

  • eliminates all XSS...well, at least the easy XSS for now.
  • maps all inputs to outputs.
  • automatically discover vulnerable cases of XSS.
  • automatically generate reproduction steps for XSS...soon
slide-22
SLIDE 22

future work

  • stability
  • automatic generation of reproduction steps (NEXT COMMIT!)
  • verification of XSS (NEXT COMMIT!)

○ PhantomJS - replay recorded flows

  • js method hooking

○ granular view of different functions that execute with tainted sources ○ capturing events for eval, setTimeout, setInterval, etc.

  • frontend fuzzing (NEXT COMMIT!)

  • ffline bruteforcing

○ 0 network requests

slide-23
SLIDE 23

https://github.com/nccgroup/tracy Questions @JacobRHeath

slide-24
SLIDE 24
  • https://chrome.google.com/webstore/detail/tracy/lcgbimfijafcjjijgjoodgpblgmkckhn
  • https://addons.mozilla.org/en-US/firefox/addon/tracyplugin/
  • https://portswigger.net/burp
  • https://www.checkmarx.com/
  • http://phantomjs.org/

Sources