Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

target/mmk-js-scope

Warning

This repository is in an archived state. Use caution when evaluating or using this code as its methods or dependencies may be outdated or insecure.

   _
  (_)___       ___  ___ ___  _ __   ___
  | / __|_____/ __|/ __/ _ \| '_ \ / _ \
  | \__ \_____\__ \ (_| (_) | |_) |  __/
 _/ |___/     |___/\___\___/| .__/ \___|
|__/                        |_|
v2.0

About

Enumerates javascript requests and hooks native function calls with Headless Chrome.

Setup

yarn install

Config

redis

The default configs point to localhost for the redis server (scan queue).

puppeteer

Replace default startup arguments as needed (proxy/sandbox)

    "args": [
      "--headless",
      "--no-sandbox",
      "--disable-gpu",
      "--single-process",
      "--no-zygote"
    ],
    "timeout": 300000

Depends on the MerryMaker Scan queue for tasking jobs and queueing results.

Running

yarn start

Building

yarn build

Linting

yarn lint

Testing

Start the test web server

yarn start-test

Run Jest

yarn jest

Events

  • console-message - catches and relays console messages
  • log-message - user defined log message for debugging and tracking state
  • complete - fired once the site flow has completed
  • pageError - the page threw an error
  • pageCookies - tracks cookies
  • workerCreated - tracks web workers
  • scriptRequest - tracks javascript request events
  • responseError - occurs when a request failed
  • requestResponse - contains details of a request and response
  • scanError - fired when the scan itself fails to complete
  • functionCall - tracks hooked native function calls
  • screenshotEvent - contains a base64 encoded screenshot for tracing the site flow

Copyright (c) 2021 Target Brands, Inc.