SlideShare a Scribd company logo
WANNA BREAK
JAVASCRIPT AND
ANDY FREEBORN
ME
▸Penetration Tester at Union Pacific
▸Previous jobs also tested security in all the things
▸Explorer of CPU architectures
▸Loves dank memes
2
AGENDA
▸Why
▸Tools to identify and break things
▸Thing to break
▸Demo of thing to break
3
WHY
▸There’s too many versions of JavaScript:
http://www.zdnet.com/article/an-insecure-mess-how-flawed-javascript-is-turning-web-into-a-hackers-playground/
4
WHAT DOES ALL OF THAT MEAN?
▸JavaScript is evil
5
WHAT DOES IT REALLY MEAN?
▸Many JavaScripts versions out there work, why update it?
▸Because security
▸Is it really a problem if so many other people use the same thing?
▸Just ask WordPress administrators
▸Unrelated low risk vulnerabilities can be exploited and chained to
provide an easy way into your organization
▸ http://buer.haus/2017/03/08/airbnb-when-bypassing-json-encoding-xss-filter-waf-csp-and-
auditor-turns-into-eight-vulnerabilities/
6
NO REST FOR THE API’S
▸Rest APIs are becoming more available and used
▸Companies are querying data from APIs of various
products to make their own aggregated view of data
▸APIs also have a myriad of challenges and can be insecure
▸http://www.zdnet.com/article/apis-examined/
▸OWASP Top 10 for 2017 (RC1)
▸A10 - Under protected APIs
7
TOOLS TO BREAK THINGS
▸Chrome and Firefox developer tools
▸Retire.js
▸Node Security Platform and Snyk
▸Postman
▸Burp Suite
8
CHROME AND FIREFOX DEV TOOLS
▸Both are free, powerful, and easy to use
▸Many free resources available to help you use it
▸https://developers.google.com/web/tools/chrome-devtools/
▸http://discover-devtools.codeschool.com/
▸Why use it?
▸Easy to test for a variety of potential security issues
9
CHROME DEV TOOLS: SHOW ME YOUR
SECRETS… OR SOURCE▸URL/route to the administrative page (dirbuster works too)
▸Commented out link to the score-board
10
CHROME DEV TOOLS: ALWAYS PRETTY-
PRINT LUKE, ALWAYS
▸Click the {} symbol
11
RETIRE.JS
▸Retire.js detects vulnerable JavaScript libraries and/or
Node.JS modules
▸Free
▸https://github.com/RetireJS/retire.js
▸Regularly updated as JavaScript and NPM packages age
▸Provides the exact vulnerability associated with a specific
version and includes helpful URLs
12
RETIRE.JS
▸Retire.js can be used in a variety of situations:
▸Chrome extension
▸Firefox extension
▸Standalone to scan a website or file directory
▸Add-on for OWASP Zap (free)
▸Add-on for Burp Suite (requires Pro) in the BApp Store
13
RETIRE.JS: VULNERABILITIES FOUND
WITH THE EXTENSION
14
RETIRE.JS: VULNERABILITIES FOUND
WITH THE CLI
▸sequelize has known vulnerabilities such as SQLi
15
NODE SECURITY PLATFORM AND SNYK
▸Node Security Platform (project from ^Lift)
▸Free: https://github.com/nodesecurity/nsp
▸Scan a directory to identify issues with Node.JS packages
▸Snyk
▸Free tier available: https://snyk.io/
▸Checks JavaScript, Ruby, and Java GitHub repositories,
public NPM packages, and can scan directories as well
16
POSTMAN
▸Quickly probe/poke/destroy APIs
▸Free
▸https://www.getpostman.com/
▸Why not SoapUI? curl? Python requests library?
▸SoapUI works great! Postman is just another option
▸Really why though: History, easily import/export tests to
other formats, share tests among team members
17
POSTMAN DEMO
▸Bypass those silly restrictions in the UI. This could have
been done in ZAP, Burp, etc. as well.
18
BURP SUITE
▸A great tool to proxy network traffic, change it to an unexpected
value, and assess platforms like web, mobile, etc.
▸https://portswigger.net/burp/
▸Does active and passive scanning and has great plugins
▸Specialized plugins require the paid version of Burp
▸$399, but worth it!
▸An excellent alternative is OWASP Zap
19
BURP SUITE DEMO
▸Get paid!
20
THING TO BREAK: OWASP JUICE SHOP
▸“OWASP Juice Shop is an intentionally insecure webapp for security
trainings written entirely in Javascript which encompasses the entire
OWASP Top Ten and other severe security flaws.”
▸https://github.com/bkimminich/juice-shop
▸Has a CTF version based on CTFd!!!11!
▸https://github.com/bkimminich/juice-shop-ctf
▸Continually updated with new vulnerabilities, content, languages
▸Author recommends not cheating, but bad guys do!
21
OWASP JUICE SHOP: WHERE CAN IT
RUN?
▸Heroku dyno (Run small web apps online for free)
▸Docker container
▸Someone else’s computer (Amazon Web Services)
▸Your VM or machine
▸Online right now!
▸ https://juice-shop.herokuapp.com/
22
OWASP JUICE SHOP: DEMO MACHINE
▸1 VM running Ubuntu 16.04 LTS
▸Download the ISO, boot up, do all the regular updates
▸Install Docker with quick and clear Ubuntu instructions:
▸https://docs.docker.com/engine/installation/linux/ubuntu/
#install-using-the-repository
▸docker pull bkimminich/juice-shop
▸docker run -d -p 3000:3000 bkimminich/juice-shop
23
OWASP JUICE SHOP: VULNERABILITIES
▸Includes a book to introduce, tackle, and solve the challenges
▸https://www.gitbook.com/book/bkimminich/pwning-owasp-juice-
shop/details
▸Examples of vulnerabilities
▸“Log in with the administrator's user credentials without previously
changing them or applying SQL Injection.”
▸“XSS Tier 3: Perform a persisted XSS attack with
<script>alert("XSS3")</script> without using the frontend
application at all.”
24
OWASP JUICE SHOP: DEMO
▸Walkthrough of the application and see how it works
▸Vulnerabilities to tackle
▸Start with the score board
▸SQLi exploitation flaw in a JavaScript library
▸Insert a XSS payload with the API
▸Manipulate an order request
25
WHERE ELSE CAN YOU USE THESE
SKILLS?▸Automated tools won’t help you here:
https://www.offensive-security.com/information-security-training/cracking-the-perimeter/
26
THANKS!
▸http://vivirytech.blogspot.com/
▸@vivirytech
▸OWASP Juice Shop
▸https://github.com/bkimminich/juice-shop
27

More Related Content

PDF
Node básico para front end developers
PPT
DevstackPY
PPTX
Evading anti virus detection in downloader scripts - zusy
PPT
PDF
Advances in BeEF - AthCon2012
PPTX
Containers explained as for cook and a mecanics
PDF
Vagrant up-and-running
PDF
DevOps: Using Vagrant to Enhance Your Day to Day Development
Node básico para front end developers
DevstackPY
Evading anti virus detection in downloader scripts - zusy
Advances in BeEF - AthCon2012
Containers explained as for cook and a mecanics
Vagrant up-and-running
DevOps: Using Vagrant to Enhance Your Day to Day Development

What's hot (20)

PPTX
Typescript - a JS superset
KEY
Cloudbusting 2012: All out on the cloud
PDF
CRaSH the shell for the Java Virtual Machine
PDF
Vagrant for Development
PDF
Ignite talks - 自動化的關鍵
PDF
Local development environment through virtualisation
PPTX
Python - A Mobile Perspective
PDF
Charm City Linux - Jan 2014 - Web Dev Made Easy - Shell Revolution
PDF
העתיד כבר כאן - שימוש בטכנולוגיות החדשות כבר היום
PDF
VCCW - Vagrant based WordPress development environment
PDF
Keep calm and vagrant up
PPTX
CRaSH the shell for the JVM
PPTX
Vagrant step-by-step guide for Beginners
PDF
Installing OpenCV 4 on Ubuntu 18.x
PDF
Easy WP Dev environments with VVV
PPTX
PPTX
Node.js, Vagrant, Chef, and Mathoid @ Benetech
PDF
Pip + virtualenv
PDF
Minicurso de Vagrant
PDF
Commit on day one thanks to vagrant & puppet!
Typescript - a JS superset
Cloudbusting 2012: All out on the cloud
CRaSH the shell for the Java Virtual Machine
Vagrant for Development
Ignite talks - 自動化的關鍵
Local development environment through virtualisation
Python - A Mobile Perspective
Charm City Linux - Jan 2014 - Web Dev Made Easy - Shell Revolution
העתיד כבר כאן - שימוש בטכנולוגיות החדשות כבר היום
VCCW - Vagrant based WordPress development environment
Keep calm and vagrant up
CRaSH the shell for the JVM
Vagrant step-by-step guide for Beginners
Installing OpenCV 4 on Ubuntu 18.x
Easy WP Dev environments with VVV
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Pip + virtualenv
Minicurso de Vagrant
Commit on day one thanks to vagrant & puppet!
Ad

Similar to BSides Iowa 2017 Wanna break JavaScript and APIs in web apps? (20)

PDF
SecDevOps for API Security
PDF
Jonathan Singer - Wheezing The Juice.pdf
PPTX
Web application Security tools
PDF
6 ways to hack your JavaScript application by Viktor Turskyi
PDF
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
PPTX
2022 APIsecure_Go Hack Yourself: API Hacking for Beginners
PDF
Including security in devops
PDF
Web Security
PPTX
Javascript Security
PDF
Web Security... Level Up
PPTX
OWASP TOP 10
PDF
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
PDF
APIDays Paris Security Workshop
PPTX
2022 APIsecure_Are your APIs Rugged Enough?
PDF
Better API Security with Automation
PDF
Better API Security With A SecDevOps Approach
PDF
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
PDF
New Era of Software with modern Application Security v1.0
PDF
Problems with parameters b sides-msp
PDF
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
SecDevOps for API Security
Jonathan Singer - Wheezing The Juice.pdf
Web application Security tools
6 ways to hack your JavaScript application by Viktor Turskyi
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
2022 APIsecure_Go Hack Yourself: API Hacking for Beginners
Including security in devops
Web Security
Javascript Security
Web Security... Level Up
OWASP TOP 10
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
APIDays Paris Security Workshop
2022 APIsecure_Are your APIs Rugged Enough?
Better API Security with Automation
Better API Security With A SecDevOps Approach
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
New Era of Software with modern Application Security v1.0
Problems with parameters b sides-msp
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
Ad

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Understanding_Digital_Forensics_Presentation.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The AUB Centre for AI in Media Proposal.docx
Encapsulation_ Review paper, used for researhc scholars
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

BSides Iowa 2017 Wanna break JavaScript and APIs in web apps?

  • 2. ME ▸Penetration Tester at Union Pacific ▸Previous jobs also tested security in all the things ▸Explorer of CPU architectures ▸Loves dank memes 2
  • 3. AGENDA ▸Why ▸Tools to identify and break things ▸Thing to break ▸Demo of thing to break 3
  • 4. WHY ▸There’s too many versions of JavaScript: http://www.zdnet.com/article/an-insecure-mess-how-flawed-javascript-is-turning-web-into-a-hackers-playground/ 4
  • 5. WHAT DOES ALL OF THAT MEAN? ▸JavaScript is evil 5
  • 6. WHAT DOES IT REALLY MEAN? ▸Many JavaScripts versions out there work, why update it? ▸Because security ▸Is it really a problem if so many other people use the same thing? ▸Just ask WordPress administrators ▸Unrelated low risk vulnerabilities can be exploited and chained to provide an easy way into your organization ▸ http://buer.haus/2017/03/08/airbnb-when-bypassing-json-encoding-xss-filter-waf-csp-and- auditor-turns-into-eight-vulnerabilities/ 6
  • 7. NO REST FOR THE API’S ▸Rest APIs are becoming more available and used ▸Companies are querying data from APIs of various products to make their own aggregated view of data ▸APIs also have a myriad of challenges and can be insecure ▸http://www.zdnet.com/article/apis-examined/ ▸OWASP Top 10 for 2017 (RC1) ▸A10 - Under protected APIs 7
  • 8. TOOLS TO BREAK THINGS ▸Chrome and Firefox developer tools ▸Retire.js ▸Node Security Platform and Snyk ▸Postman ▸Burp Suite 8
  • 9. CHROME AND FIREFOX DEV TOOLS ▸Both are free, powerful, and easy to use ▸Many free resources available to help you use it ▸https://developers.google.com/web/tools/chrome-devtools/ ▸http://discover-devtools.codeschool.com/ ▸Why use it? ▸Easy to test for a variety of potential security issues 9
  • 10. CHROME DEV TOOLS: SHOW ME YOUR SECRETS… OR SOURCE▸URL/route to the administrative page (dirbuster works too) ▸Commented out link to the score-board 10
  • 11. CHROME DEV TOOLS: ALWAYS PRETTY- PRINT LUKE, ALWAYS ▸Click the {} symbol 11
  • 12. RETIRE.JS ▸Retire.js detects vulnerable JavaScript libraries and/or Node.JS modules ▸Free ▸https://github.com/RetireJS/retire.js ▸Regularly updated as JavaScript and NPM packages age ▸Provides the exact vulnerability associated with a specific version and includes helpful URLs 12
  • 13. RETIRE.JS ▸Retire.js can be used in a variety of situations: ▸Chrome extension ▸Firefox extension ▸Standalone to scan a website or file directory ▸Add-on for OWASP Zap (free) ▸Add-on for Burp Suite (requires Pro) in the BApp Store 13
  • 15. RETIRE.JS: VULNERABILITIES FOUND WITH THE CLI ▸sequelize has known vulnerabilities such as SQLi 15
  • 16. NODE SECURITY PLATFORM AND SNYK ▸Node Security Platform (project from ^Lift) ▸Free: https://github.com/nodesecurity/nsp ▸Scan a directory to identify issues with Node.JS packages ▸Snyk ▸Free tier available: https://snyk.io/ ▸Checks JavaScript, Ruby, and Java GitHub repositories, public NPM packages, and can scan directories as well 16
  • 17. POSTMAN ▸Quickly probe/poke/destroy APIs ▸Free ▸https://www.getpostman.com/ ▸Why not SoapUI? curl? Python requests library? ▸SoapUI works great! Postman is just another option ▸Really why though: History, easily import/export tests to other formats, share tests among team members 17
  • 18. POSTMAN DEMO ▸Bypass those silly restrictions in the UI. This could have been done in ZAP, Burp, etc. as well. 18
  • 19. BURP SUITE ▸A great tool to proxy network traffic, change it to an unexpected value, and assess platforms like web, mobile, etc. ▸https://portswigger.net/burp/ ▸Does active and passive scanning and has great plugins ▸Specialized plugins require the paid version of Burp ▸$399, but worth it! ▸An excellent alternative is OWASP Zap 19
  • 21. THING TO BREAK: OWASP JUICE SHOP ▸“OWASP Juice Shop is an intentionally insecure webapp for security trainings written entirely in Javascript which encompasses the entire OWASP Top Ten and other severe security flaws.” ▸https://github.com/bkimminich/juice-shop ▸Has a CTF version based on CTFd!!!11! ▸https://github.com/bkimminich/juice-shop-ctf ▸Continually updated with new vulnerabilities, content, languages ▸Author recommends not cheating, but bad guys do! 21
  • 22. OWASP JUICE SHOP: WHERE CAN IT RUN? ▸Heroku dyno (Run small web apps online for free) ▸Docker container ▸Someone else’s computer (Amazon Web Services) ▸Your VM or machine ▸Online right now! ▸ https://juice-shop.herokuapp.com/ 22
  • 23. OWASP JUICE SHOP: DEMO MACHINE ▸1 VM running Ubuntu 16.04 LTS ▸Download the ISO, boot up, do all the regular updates ▸Install Docker with quick and clear Ubuntu instructions: ▸https://docs.docker.com/engine/installation/linux/ubuntu/ #install-using-the-repository ▸docker pull bkimminich/juice-shop ▸docker run -d -p 3000:3000 bkimminich/juice-shop 23
  • 24. OWASP JUICE SHOP: VULNERABILITIES ▸Includes a book to introduce, tackle, and solve the challenges ▸https://www.gitbook.com/book/bkimminich/pwning-owasp-juice- shop/details ▸Examples of vulnerabilities ▸“Log in with the administrator's user credentials without previously changing them or applying SQL Injection.” ▸“XSS Tier 3: Perform a persisted XSS attack with <script>alert("XSS3")</script> without using the frontend application at all.” 24
  • 25. OWASP JUICE SHOP: DEMO ▸Walkthrough of the application and see how it works ▸Vulnerabilities to tackle ▸Start with the score board ▸SQLi exploitation flaw in a JavaScript library ▸Insert a XSS payload with the API ▸Manipulate an order request 25
  • 26. WHERE ELSE CAN YOU USE THESE SKILLS?▸Automated tools won’t help you here: https://www.offensive-security.com/information-security-training/cracking-the-perimeter/ 26