SlideShare ist ein Scribd-Unternehmen logo
1 von 72
Downloaden Sie, um offline zu lesen
Reverse Engineer Web Applications
How to
First things first
Prerequisites
• node.js ( web tools are made with node first )
• npm ( comes with node )
Nice-to-haves
• Visual Studio code ( or suitable code editor )
• git ( because it's be?er than cvs )
First things first
Lab repository
h5ps://github.com/jsoverson/workshop-reverse-engineering
-or-
Zipfile: h5p://bit.ly/reveng-webapps
Reverse Engineer Web Applications
How to
Challenge #1
1. Web applica,ons have grown extremely complex.
https://github.com/jsoverson/workshop-reverse-engineering
Web 101
https://github.com/jsoverson/workshop-reverse-engineering
Web 101
GET / HTTP/1.1
Host: www.google.com
Connection: keep-alive
User-Agent: Chrome/72.0.3626.96 Safari/537.36 (…)
HTTP/1.1 200 OK
Date: Tue, 19 Feb 2019 21:34:08 GMT
Content-Type: text/html
Content-Length: 1932
<!doctype HTML>(…)
https://github.com/jsoverson/workshop-reverse-engineering
Web 101
https://github.com/jsoverson/workshop-reverse-engineering
Challenge #2
1. Web applica,ons have grown extremely complex.
2. Limited ability to run old versions of resources or use old APIs.
https://github.com/jsoverson/workshop-reverse-engineering
99% of websites assume connecHvity
https://github.com/jsoverson/workshop-reverse-engineering
Challenge #3
1. Web applica,ons have grown extremely complex.
2. Limited ability to run old versions of resources or use old APIs.
3. Web site resources can change frequently.
https://github.com/jsoverson/workshop-reverse-engineering
https://github.com/jsoverson/workshop-reverse-engineering
https://github.com/jsoverson/workshop-reverse-engineering
Challenge #4
1. Web applica,ons have grown extremely complex.
2. Limited ability to run old versions of resources or use old APIs.
3. Web sites and APIs can change frequently.
4. Web browsers change frequently.
https://github.com/jsoverson/workshop-reverse-engineering
A year of
Chrome
A year of
FireFox
https://github.com/jsoverson/workshop-reverse-engineering
Challenge #5
1. Web applica,ons have grown extremely complex.
2. Limited ability to run old versions of resources or use old APIs.
3. Web sites and APIs can change frequently.
4. Web browsers change frequently.
5. Actual aDackers are leading to more effec,ve countermeasures.
https://github.com/jsoverson/workshop-reverse-engineering
Website a?acks are a serious problem
>3 billion a5acks in 1 week for 1 customer on 1 page
https://github.com/jsoverson/workshop-reverse-engineering
And have an industry around protecHng them
https://github.com/jsoverson/workshop-reverse-engineering
And have an industry around protecHng them
That's Me!
https://github.com/jsoverson/workshop-reverse-engineering
So how do you hack web apps?
1. Drive the browser programmaHcally
2. Simulate and intercept "system" calls
3. Reuse as much applicaHon code as possible
Lab work
Lab 0 Lab 1 Lab 2
1. ExtracHng logic
2. ExtracHng logic
resiliently
3. Transforming with
scope awareness
1. AutomaHng a browser
2. IntercepHng requests
3. Modifying responses
4. RewriHng JS on the fly
with a mocked
environment
1. Understanding Intent

in JavaScript
Lab Format
lab-#.#/
├── answer
│   └── answer-#.#.js
├── test
│   └── test.js
├── work
│   └── lab-#.#.js
└── package.json
Node/npm basics
node [script.js]
npm install
npm install [specific package]
h?ps://gitpod.io/
h?ps://try-puppeteer.appspot.com/
Lab 0.1
Understanding Intent in JavaScript
Payload A is the first script of three found in an exploited dependency of npm
package event-stream.
Background
De-obfuscate payload-A.js and idenHfy how it is loading the second payload.
Goal
Lab 0.1
Understanding Intent in JavaScript
• Format your code with ⌘+⇧+P or ^+⇧+P to open command pale?e then
"Format Document"
• Rename variables by pressing F2 when cursor is over an idenHfier.
• There is a helper file that includes addiHonal encoded strings.

(The first and second strings in the helper file are beyond the scope of this lab.)
• process.env contains the environment variables at Hme of execuHon
Tips
Lab Series 1
ProgrammaHcally manipulaHng JavaScript
Lab 1.1
ProgrammaHcally extract logic from JavaScript
Common JavaScript best pracHces and bundlers produce code that has a
minimal public footprint, limiHng the ability to hook into exisHng logic.
Background
Use the Shif parser and code generator to read payload-A.js and extract its
e funcOon and export it as an unhex method in our node script.
Goal
Lab 1.1
Using parsers
parse(originalSource) ! Abstract Syntax Tree (AST)
codegen(AST) ! newSource
Lab 1.1
VariableDeclarationStatement
What is an AST?
Lab 1.1
VariableDeclaration
What is an AST?
Lab 1.1
VariableDeclarator
What is an AST?
Lab 1.1
What is an AST?
BindingIdentifier
LiteralStringExpression
Lab 1.1
What is an AST?
Lab 1.1
What is an AST?
"Hello WOPRs"
Lab 1.1
ProgrammaHcally extract logic from JavaScript
Common JavaScript best pracHces and bundlers produce code that has a
minimal public footprint, limiHng the ability to hook into exisHng logic.
Background
Use the Shif parser and code generator to read payload-A.js and extract its
e funcOon and export it as an unhex method in our node script.
Goal
Lab 1.1
ProgrammaHcally extract logic from JavaScript
• Don't overthink it - you're just deeply accessing a property in an object.
• console.log() as you make your way down the tree, e.g.
console.log(tree.expressions[0]);
• Copy/paste payload-A.js into astexplorer.net for an interacHve UI
Tips
Lab 1.2
Resiliently extract logic from JavaScript
ExtracHng and manipulaHng JavaScript requires that the code be resilient to
changes in the input source.
Background
Use a traversal method to pick out the same funcHon from lab 1.1 by
inspecHng the AST node of the funcHon and idenHfying it by its shape or
a?ributes.
Goal
Lab 1.2
Resiliently extract logic from JavaScript
• allNodes contains a list of all nodes in the AST.
• You can iterate over that list and check every node for properHes that
represent the node you want to target.
• You probably want to check if node.type === 'FunctionDeclaration'
• You can then check the funcHon name to make sure it is equal to 'e'
Tips
Lab 1.3
Rewrite JavaScript taking scope and context into account
RewriHng JavaScript requires tools that are aware of the enHre program's scope
and context.
Background
Use shift-scope to rename global variables "a" and "b" to "first" and
"second"
Goal
Analyzing Scope
Analyzing Scope
const scope = analyzeScope(AST)
Analyzing Scope
Scope
! children
! type
! astNode
! variableList
Child scopes
Global / Script / FuncHon etc
The root node
The variables declared or
referenced in this scope
Analyzing Scope
const lookupTable = new ScopeLookup(scope)
const identifier = /* node from AST */
const lookup = lookupTable.variableMap.get(identifier)
Lab 1.3
Rewrite JavaScript taking scope and context into account
RewriHng JavaScript requires tools that are aware of the enHre program's scope
and context.
Background
Use shift-scope to rename global variables "a" and "b" to "first" and
"second"
Goal
Lab 1.3
Rewrite JavaScript taking scope and context into account
• The argument to lookupTable.variableMap.get() should be the
idenHfier node itself, not a string.
• There are variables already defined that reference the AST nodes.
• Each lookup returns a list of entries with declaraHons and references. You
need to change both declaraHons and references to fully rename an idenHfier.
Tips
Lab Series 2
ProgrammaHcally controlling a browser
Lab Series 2
Notes:
The Puppeteer npm package downloads Chrome on
every install. If internet is flakey, download it once and
copy node_modules/puppeteer from one lab to
another
Lab 2.1
ProgrammaHcally control a browser with Puppeteer
Web applicaHon analysis needs to be completely automated, otherwise
everything depending on a manual step risks breaking when anything changes.
Background
Set up a base environment that controls Chrome with Puppeteer and nodejs.
Goal
What is Puppeteer?
Puppeteer is a nodejs library that provides a high-level API
to control Chrome over the DevTools Protocol.
Puppeteer runs headless by default, but can be configured
to run full (non-headless) Chrome or Chromium.
Puppeteer API
puppeteer.launch();
puppeteer.connect();
browser
Browser instance
browser.pages();
browser.newPage();
page
( Tab )
Page instance
page.goto();
page.evaluate();
element
page.$();
page.$$();
Element instance
element.click();
element.type(…);
element.tap();
Lab 2.1
ProgrammaHcally control a browser with Puppeteer
• The Puppeteer API is fantasHc : h?p://bit.ly/puppeteer-api
• You need to get a browser instance from puppeteer
• You need to get a page instance from browser
• You need to go to a url of your choice, e.g. h?ps://example.com
Tips
Lab 2.2
Intercept requests via the Chrome Devtools Protocol
IntercepHng, inspecHng, and modifying inbound and outbound communicaHon
is a criHcal part of any reverse engineering effort.
Background
Use the Chrome Devtools Protocol directly to intercept all Script resources,
log the URL to the terminal, and then conHnue the request.
Goal
What is Chrome Devtools Protocol?
The Chrome DevTools Protocol allows for tools to
instrument, inspect, debug and profile Chromium, Chrome
and other Blink-based browsers.
@jsoverson
http://bit.ly/chrome-devtools-protocol
IniHaHng a CDP Session
const client = page.target().createCDPSession();
Sending commands
client.send(“command”);
client.send(“command”, {options…});
client.on(“event”, listener);
IntercepHng Network Traffic
(pseudo code)
send(“Network.enable”);
send(“Network.setRequestInterception”, patterns);
on(“Network.requestIntercepted”, (evt) => {
/* modify request or response */
send(
“Network.continueInterceptedRequest”,
request
)
})
Lab 2.2
Intercept requests via the Chrome Devtools Protocol
IntercepHng, inspecHng, and modifying inbound and outbound communicaHon
is a criHcal part of any reverse engineering effort.
Background
Use the Chrome Devtools Protocol directly to intercept all Script resources,
log the URL to the terminal, and then conHnue the request.
Goal
Lab 2.2
Intercept requests via the Chrome Devtools Protocol
• The Puppeteer API is fantasHc : h?p://bit.ly/puppeteer-api
• This is purely in the Network domain
• Remind me to flip back to the pseudo-code if you're stuck.
Tips
Lab 2.3
Modify intercepted requests
Modifying intercepted requests requires recreaHng an enHre HTTP response
and passing it along as the original.
Background
Retrieve the original script body and append a `console.log()` statement to
the end of the script that simply logs a message.
Goal
IntercepHng Network Traffic
(pseudo code)
send(“Network.enable”);
send(“Network.setRequestInterception”, patterns);
on(“Network.requestIntercepted”, (evt) => {
send(
“Network.continueInterceptedRequest”,
request
)
})
const response =
send(“Network.getResponseBodyForInterception”, interceptionId);
Modifying a Response
(pseudo code)
const response =
send('Network.getResponseBodyForInterception', interceptionId);
const body = response.base64Encoded
? atob(response.body)
: response.body;
send('Network.continueInterceptedRequest', {
interceptionId,
rawResponse: btoa( /* Complete HTTP Response */)
});
HTTP Requests & Responses
Lab 2.3
Modify intercepted requests
Modifying intercepted requests requires recreaHng an enHre HTTP response
and passing it along as the original.
Background
Retrieve the original script body and append a `console.log()` statement to
the end of the script that simply logs a message.
Goal
Lab 2.3
Modify intercepted requests
• Rely on the Chrome Devtools Protocol documentaHon : h?ps://bit.ly/chrome-
devtools-protocol
• What you add to each script is up to you, it's user choice as long as it is
observable.
• The last TODO requires reading the CDP documentaHon.
Tips
Final Lab
Meaningfully rewrite a script to intercept its access to browser APIs
IntercepHng a script's access to standard APIs allows you to guide its execuHon
in the direcHon you want without modifying its internals.
Background
Wrap the example site's script to intercept access to document.locaHon to
make the script think it is hosted elsewhere & inject code that exposes the
seed
Goal

Weitere ähnliche Inhalte

Was ist angesagt?

ES6 presentation
ES6 presentationES6 presentation
ES6 presentationritika1
 
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
Reactive Card Magic: Understanding Spring WebFlux and Project ReactorReactive Card Magic: Understanding Spring WebFlux and Project Reactor
Reactive Card Magic: Understanding Spring WebFlux and Project ReactorVMware Tanzu
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥Remo Jansen
 
Chapitre 6 traitement des exceptions
Chapitre 6  traitement des exceptionsChapitre 6  traitement des exceptions
Chapitre 6 traitement des exceptionsAmir Souissi
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug BountiesOWASP Nagpur
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman
 
A Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityMikhail Egorov
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHPVibrant Technologies & Computers
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesAndreas Enbohm
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
 
PHP unserialization vulnerabilities: What are we missing?
PHP unserialization vulnerabilities: What are we missing?PHP unserialization vulnerabilities: What are we missing?
PHP unserialization vulnerabilities: What are we missing?Sam Thomas
 
Exception handling
Exception handlingException handling
Exception handlingAnna Pietras
 

Was ist angesagt? (20)

ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
Reactive Card Magic: Understanding Spring WebFlux and Project ReactorReactive Card Magic: Understanding Spring WebFlux and Project Reactor
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
 
React js t2 - jsx
React js   t2 - jsxReact js   t2 - jsx
React js t2 - jsx
 
Sql Injection Myths and Fallacies
Sql Injection Myths and FallaciesSql Injection Myths and Fallacies
Sql Injection Myths and Fallacies
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
Chapitre 6 traitement des exceptions
Chapitre 6  traitement des exceptionsChapitre 6  traitement des exceptions
Chapitre 6 traitement des exceptions
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
React Hooks
React HooksReact Hooks
React Hooks
 
Java script
Java scriptJava script
Java script
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
 
Les Servlets et JSP
Les Servlets et JSPLes Servlets et JSP
Les Servlets et JSP
 
A Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications security
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
 
PHP unserialization vulnerabilities: What are we missing?
PHP unserialization vulnerabilities: What are we missing?PHP unserialization vulnerabilities: What are we missing?
PHP unserialization vulnerabilities: What are we missing?
 
Exception handling
Exception handlingException handling
Exception handling
 

Ähnlich wie How to Reverse Engineer Web Applications

Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...DroidConTLV
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!Jason Feinstein
 
Practical Chaos Engineering
Practical Chaos EngineeringPractical Chaos Engineering
Practical Chaos EngineeringSIGHUP
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCTim Burks
 
Code transformation With Spoon
Code transformation With SpoonCode transformation With Spoon
Code transformation With SpoonGérard Paligot
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...Codemotion
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworksYuri Visser
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoveragemlilley
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptJohn Stevenson
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongPROIDEA
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScriptOleg Podsechin
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Building Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepBuilding Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepguest9efd1a1
 
Building Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn UstepBuilding Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn Ustepwangii
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudyYusuke Ando
 

Ähnlich wie How to Reverse Engineer Web Applications (20)

Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
 
Practical Chaos Engineering
Practical Chaos EngineeringPractical Chaos Engineering
Practical Chaos Engineering
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
Code transformation With Spoon
Code transformation With SpoonCode transformation With Spoon
Code transformation With Spoon
 
React native
React nativeReact native
React native
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Building Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepBuilding Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstep
 
Building Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn UstepBuilding Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn Ustep
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
 

Mehr von Jarrod Overson

Practical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobusPractical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobusJarrod Overson
 
AppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is EvolvingAppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is EvolvingJarrod Overson
 
How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019Jarrod Overson
 
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...Jarrod Overson
 
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...Jarrod Overson
 
Deepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the futureDeepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the futureJarrod Overson
 
The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.Jarrod Overson
 
The life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleThe life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleJarrod Overson
 
The Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of SecurityThe Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of SecurityJarrod Overson
 
Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16Jarrod Overson
 
Graphics Programming for Web Developers
Graphics Programming for Web DevelopersGraphics Programming for Web Developers
Graphics Programming for Web DevelopersJarrod Overson
 
The Dark Side of Security
The Dark Side of SecurityThe Dark Side of Security
The Dark Side of SecurityJarrod Overson
 
JavaScript and the AST
JavaScript and the ASTJavaScript and the AST
JavaScript and the ASTJarrod Overson
 
Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014 Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014 Jarrod Overson
 
Idiot proofing your code
Idiot proofing your codeIdiot proofing your code
Idiot proofing your codeJarrod Overson
 
Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014Jarrod Overson
 
Managing JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - FluentManaging JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - FluentJarrod Overson
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web componentsJarrod Overson
 
Managing JavaScript Complexity
Managing JavaScript ComplexityManaging JavaScript Complexity
Managing JavaScript ComplexityJarrod Overson
 

Mehr von Jarrod Overson (20)

Practical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobusPractical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobus
 
AppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is EvolvingAppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is Evolving
 
How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019
 
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
 
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
 
Deepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the futureDeepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the future
 
The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.
 
The life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleThe life of breached data and the attack lifecycle
The life of breached data and the attack lifecycle
 
The Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of SecurityThe Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of Security
 
Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16
 
Graphics Programming for Web Developers
Graphics Programming for Web DevelopersGraphics Programming for Web Developers
Graphics Programming for Web Developers
 
The Dark Side of Security
The Dark Side of SecurityThe Dark Side of Security
The Dark Side of Security
 
JavaScript and the AST
JavaScript and the ASTJavaScript and the AST
JavaScript and the AST
 
ES2015 workflows
ES2015 workflowsES2015 workflows
ES2015 workflows
 
Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014 Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014
 
Idiot proofing your code
Idiot proofing your codeIdiot proofing your code
Idiot proofing your code
 
Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014
 
Managing JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - FluentManaging JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - Fluent
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web components
 
Managing JavaScript Complexity
Managing JavaScript ComplexityManaging JavaScript Complexity
Managing JavaScript Complexity
 

Kürzlich hochgeladen

Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 

Kürzlich hochgeladen (20)

Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 

How to Reverse Engineer Web Applications

  • 1. Reverse Engineer Web Applications How to
  • 2. First things first Prerequisites • node.js ( web tools are made with node first ) • npm ( comes with node ) Nice-to-haves • Visual Studio code ( or suitable code editor ) • git ( because it's be?er than cvs )
  • 3. First things first Lab repository h5ps://github.com/jsoverson/workshop-reverse-engineering -or- Zipfile: h5p://bit.ly/reveng-webapps
  • 4. Reverse Engineer Web Applications How to
  • 5. Challenge #1 1. Web applica,ons have grown extremely complex. https://github.com/jsoverson/workshop-reverse-engineering
  • 7. Web 101 GET / HTTP/1.1 Host: www.google.com Connection: keep-alive User-Agent: Chrome/72.0.3626.96 Safari/537.36 (…) HTTP/1.1 200 OK Date: Tue, 19 Feb 2019 21:34:08 GMT Content-Type: text/html Content-Length: 1932 <!doctype HTML>(…) https://github.com/jsoverson/workshop-reverse-engineering
  • 9. Challenge #2 1. Web applica,ons have grown extremely complex. 2. Limited ability to run old versions of resources or use old APIs. https://github.com/jsoverson/workshop-reverse-engineering
  • 10. 99% of websites assume connecHvity https://github.com/jsoverson/workshop-reverse-engineering
  • 11. Challenge #3 1. Web applica,ons have grown extremely complex. 2. Limited ability to run old versions of resources or use old APIs. 3. Web site resources can change frequently. https://github.com/jsoverson/workshop-reverse-engineering
  • 14. Challenge #4 1. Web applica,ons have grown extremely complex. 2. Limited ability to run old versions of resources or use old APIs. 3. Web sites and APIs can change frequently. 4. Web browsers change frequently. https://github.com/jsoverson/workshop-reverse-engineering
  • 15. A year of Chrome A year of FireFox https://github.com/jsoverson/workshop-reverse-engineering
  • 16. Challenge #5 1. Web applica,ons have grown extremely complex. 2. Limited ability to run old versions of resources or use old APIs. 3. Web sites and APIs can change frequently. 4. Web browsers change frequently. 5. Actual aDackers are leading to more effec,ve countermeasures. https://github.com/jsoverson/workshop-reverse-engineering
  • 17. Website a?acks are a serious problem >3 billion a5acks in 1 week for 1 customer on 1 page https://github.com/jsoverson/workshop-reverse-engineering
  • 18. And have an industry around protecHng them https://github.com/jsoverson/workshop-reverse-engineering
  • 19. And have an industry around protecHng them That's Me! https://github.com/jsoverson/workshop-reverse-engineering
  • 20. So how do you hack web apps?
  • 21. 1. Drive the browser programmaHcally 2. Simulate and intercept "system" calls 3. Reuse as much applicaHon code as possible
  • 22. Lab work Lab 0 Lab 1 Lab 2 1. ExtracHng logic 2. ExtracHng logic resiliently 3. Transforming with scope awareness 1. AutomaHng a browser 2. IntercepHng requests 3. Modifying responses 4. RewriHng JS on the fly with a mocked environment 1. Understanding Intent
 in JavaScript
  • 23. Lab Format lab-#.#/ ├── answer │   └── answer-#.#.js ├── test │   └── test.js ├── work │   └── lab-#.#.js └── package.json
  • 24. Node/npm basics node [script.js] npm install npm install [specific package]
  • 27. Lab 0.1 Understanding Intent in JavaScript Payload A is the first script of three found in an exploited dependency of npm package event-stream. Background De-obfuscate payload-A.js and idenHfy how it is loading the second payload. Goal
  • 28. Lab 0.1 Understanding Intent in JavaScript • Format your code with ⌘+⇧+P or ^+⇧+P to open command pale?e then "Format Document" • Rename variables by pressing F2 when cursor is over an idenHfier. • There is a helper file that includes addiHonal encoded strings.
 (The first and second strings in the helper file are beyond the scope of this lab.) • process.env contains the environment variables at Hme of execuHon Tips
  • 29. Lab Series 1 ProgrammaHcally manipulaHng JavaScript
  • 30. Lab 1.1 ProgrammaHcally extract logic from JavaScript Common JavaScript best pracHces and bundlers produce code that has a minimal public footprint, limiHng the ability to hook into exisHng logic. Background Use the Shif parser and code generator to read payload-A.js and extract its e funcOon and export it as an unhex method in our node script. Goal
  • 31. Lab 1.1 Using parsers parse(originalSource) ! Abstract Syntax Tree (AST) codegen(AST) ! newSource
  • 35. Lab 1.1 What is an AST? BindingIdentifier LiteralStringExpression
  • 36. Lab 1.1 What is an AST?
  • 37. Lab 1.1 What is an AST? "Hello WOPRs"
  • 38. Lab 1.1 ProgrammaHcally extract logic from JavaScript Common JavaScript best pracHces and bundlers produce code that has a minimal public footprint, limiHng the ability to hook into exisHng logic. Background Use the Shif parser and code generator to read payload-A.js and extract its e funcOon and export it as an unhex method in our node script. Goal
  • 39. Lab 1.1 ProgrammaHcally extract logic from JavaScript • Don't overthink it - you're just deeply accessing a property in an object. • console.log() as you make your way down the tree, e.g. console.log(tree.expressions[0]); • Copy/paste payload-A.js into astexplorer.net for an interacHve UI Tips
  • 40. Lab 1.2 Resiliently extract logic from JavaScript ExtracHng and manipulaHng JavaScript requires that the code be resilient to changes in the input source. Background Use a traversal method to pick out the same funcHon from lab 1.1 by inspecHng the AST node of the funcHon and idenHfying it by its shape or a?ributes. Goal
  • 41. Lab 1.2 Resiliently extract logic from JavaScript • allNodes contains a list of all nodes in the AST. • You can iterate over that list and check every node for properHes that represent the node you want to target. • You probably want to check if node.type === 'FunctionDeclaration' • You can then check the funcHon name to make sure it is equal to 'e' Tips
  • 42. Lab 1.3 Rewrite JavaScript taking scope and context into account RewriHng JavaScript requires tools that are aware of the enHre program's scope and context. Background Use shift-scope to rename global variables "a" and "b" to "first" and "second" Goal
  • 44. Analyzing Scope const scope = analyzeScope(AST)
  • 45. Analyzing Scope Scope ! children ! type ! astNode ! variableList Child scopes Global / Script / FuncHon etc The root node The variables declared or referenced in this scope
  • 46. Analyzing Scope const lookupTable = new ScopeLookup(scope) const identifier = /* node from AST */ const lookup = lookupTable.variableMap.get(identifier)
  • 47. Lab 1.3 Rewrite JavaScript taking scope and context into account RewriHng JavaScript requires tools that are aware of the enHre program's scope and context. Background Use shift-scope to rename global variables "a" and "b" to "first" and "second" Goal
  • 48. Lab 1.3 Rewrite JavaScript taking scope and context into account • The argument to lookupTable.variableMap.get() should be the idenHfier node itself, not a string. • There are variables already defined that reference the AST nodes. • Each lookup returns a list of entries with declaraHons and references. You need to change both declaraHons and references to fully rename an idenHfier. Tips
  • 49. Lab Series 2 ProgrammaHcally controlling a browser
  • 50. Lab Series 2 Notes: The Puppeteer npm package downloads Chrome on every install. If internet is flakey, download it once and copy node_modules/puppeteer from one lab to another
  • 51. Lab 2.1 ProgrammaHcally control a browser with Puppeteer Web applicaHon analysis needs to be completely automated, otherwise everything depending on a manual step risks breaking when anything changes. Background Set up a base environment that controls Chrome with Puppeteer and nodejs. Goal
  • 52. What is Puppeteer? Puppeteer is a nodejs library that provides a high-level API to control Chrome over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.
  • 57. Lab 2.1 ProgrammaHcally control a browser with Puppeteer • The Puppeteer API is fantasHc : h?p://bit.ly/puppeteer-api • You need to get a browser instance from puppeteer • You need to get a page instance from browser • You need to go to a url of your choice, e.g. h?ps://example.com Tips
  • 58. Lab 2.2 Intercept requests via the Chrome Devtools Protocol IntercepHng, inspecHng, and modifying inbound and outbound communicaHon is a criHcal part of any reverse engineering effort. Background Use the Chrome Devtools Protocol directly to intercept all Script resources, log the URL to the terminal, and then conHnue the request. Goal
  • 59. What is Chrome Devtools Protocol? The Chrome DevTools Protocol allows for tools to instrument, inspect, debug and profile Chromium, Chrome and other Blink-based browsers.
  • 61. IniHaHng a CDP Session const client = page.target().createCDPSession();
  • 63. IntercepHng Network Traffic (pseudo code) send(“Network.enable”); send(“Network.setRequestInterception”, patterns); on(“Network.requestIntercepted”, (evt) => { /* modify request or response */ send( “Network.continueInterceptedRequest”, request ) })
  • 64. Lab 2.2 Intercept requests via the Chrome Devtools Protocol IntercepHng, inspecHng, and modifying inbound and outbound communicaHon is a criHcal part of any reverse engineering effort. Background Use the Chrome Devtools Protocol directly to intercept all Script resources, log the URL to the terminal, and then conHnue the request. Goal
  • 65. Lab 2.2 Intercept requests via the Chrome Devtools Protocol • The Puppeteer API is fantasHc : h?p://bit.ly/puppeteer-api • This is purely in the Network domain • Remind me to flip back to the pseudo-code if you're stuck. Tips
  • 66. Lab 2.3 Modify intercepted requests Modifying intercepted requests requires recreaHng an enHre HTTP response and passing it along as the original. Background Retrieve the original script body and append a `console.log()` statement to the end of the script that simply logs a message. Goal
  • 67. IntercepHng Network Traffic (pseudo code) send(“Network.enable”); send(“Network.setRequestInterception”, patterns); on(“Network.requestIntercepted”, (evt) => { send( “Network.continueInterceptedRequest”, request ) }) const response = send(“Network.getResponseBodyForInterception”, interceptionId);
  • 68. Modifying a Response (pseudo code) const response = send('Network.getResponseBodyForInterception', interceptionId); const body = response.base64Encoded ? atob(response.body) : response.body; send('Network.continueInterceptedRequest', { interceptionId, rawResponse: btoa( /* Complete HTTP Response */) });
  • 69. HTTP Requests & Responses
  • 70. Lab 2.3 Modify intercepted requests Modifying intercepted requests requires recreaHng an enHre HTTP response and passing it along as the original. Background Retrieve the original script body and append a `console.log()` statement to the end of the script that simply logs a message. Goal
  • 71. Lab 2.3 Modify intercepted requests • Rely on the Chrome Devtools Protocol documentaHon : h?ps://bit.ly/chrome- devtools-protocol • What you add to each script is up to you, it's user choice as long as it is observable. • The last TODO requires reading the CDP documentaHon. Tips
  • 72. Final Lab Meaningfully rewrite a script to intercept its access to browser APIs IntercepHng a script's access to standard APIs allows you to guide its execuHon in the direcHon you want without modifying its internals. Background Wrap the example site's script to intercept access to document.locaHon to make the script think it is hosted elsewhere & inject code that exposes the seed Goal