Code Monkey home page Code Monkey logo

posta's Introduction

Posta


enso.security - Posta

Posta is a tool for researching Cross-document Messaging communication. It allows you to track, explore and exploit postMessage vulnerabilities, and includes features such as replaying messages sent between windows within any attached browser.

Main Page

Prerequisites

  • Google Chrome / Chromium
  • Node.js (optional)

Installation

Development Environment

Run Posta in development environment:

  1. Install Posta
    git clone https://github.com/benso-io/posta
    cd posta
    npm install
  2. start devlopment enviroment
npm start

Dev mode includes a local web server that serves a small testing site and the exploit page. When running in dev mode, you can access the exploit page at http://localhost:8080/exploit/

The development environment will rebuild the extension when source code changes. To work on UI, start the development env, make your changes and refresh. Please note that changes to the background page are rebuilt, but will only take effect after the extension restarts (from browser menu)

Chrome Extension

Run Posta as a Chrome / Chromium Extension:

  1. Clone the repo:
    git clone https://github.com/benso-io/posta.git
  2. Navigate to chrome://extensions
  3. Make sure Developer mode is enabled
  4. Click on Load unpacked
  5. Choose the chrome-extension directory inside Posta and upload it to your browser
  6. Load the extension
  7. Pin the extension to your browser
  8. Browse to the website you would like to examine
  9. Click on the Posta extension to navigate to the UI

Tabs

In the Tabs section we can find our main Origin, with the iframes it hosts and communicates with through the session. We can choose the specific frame by clicking on it, and observe the postMessages related to that frame only.

Tabs

Messages

In the Messages section, we can inspect all postMessage traffic being sent from the origin to its iframes, and vice versa. We can select specific communication for further examination by clicking on it. The Listeners area presents the code which is in charge of handling the communication, we can click and copy its contents for JS code observation.

Messages Listeners

Console

In the console section, we can modify the original postMessage traffic, and replay the messages with the tampered values which will be sent from the Origin to its iframe.

We should make tests and see if we can affect the behavior of the website by changing the postMessage content. If we manage to do so, it's time to try and exploit if from a different Origin, by clicking "Simulate exploit".

Console Buttons

Exploit

Click on the "host" button inorder to navigate to the exploitation window.

Host

In the Exploit section, Posta will try and host the specified origin as an iframe in order to initiate postMessage communication. Most of the time we won't be able to do so, due to X-Frame-Options being enabled on the origin website.

Therefore, in order to continue with our exploitation, we'll need to gain communication reference with our Origin by initiating the window.open method, which can be achieved by clicking on "Open as tab".

We have the console to our right which will help us modify and craft our specified payloads and test them in Cross-Origin Communication, initiated by clicking on the Exploit button.

Exploit Content

Authors

posta's People

Contributors

chensos avatar naglienso avatar noamsan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.