Giter VIP home page Giter VIP logo

wssip's Introduction

WSSiP: A WebSocket Manipulation Proxy

Travis-CI Appveyor npm version npm github github release dependency outdated

Short for "WebSocket/Socket.io Proxy", this tool, written in Node.js, provides a user interface to capture, intercept, send custom messages and view all WebSocket and Socket.IO communications between the client and server.

Upstream proxy support also means you can forward HTTP/HTTPS traffic to an intercepting proxy of your choice (e.g. Burp Suite or Pappy Proxy) but view WebSocket traffic in WSSiP. More information can be found on the blog post.

There is an outward bridge via HTTP to write a fuzzer in any language you choose to debug and fuzz for security vulnerabilities. See Fuzzing for more details.

Written and maintained by Samantha Chalker (@thekettu). Icon for WSSiP release provided by @dragonfoxing.

Installation

From Packaged Application

See Releases.

From npx via npm (for CLI commands)

Run the following in your command line:

npx wssip

From Source

Using a command line:

# Clone repository locally
git clone https://github.com/nccgroup/wssip

# Change to the directory
cd wssip

# If you are developing for WSSiP:
# npm i

# If not... (as to minimize disk space):
npm i electron
npm i --production

# Yarn version:
# yarn add electron
# yarn install --production

# Start application:
npm start
# or yarn:
# yarn start

Usage

  1. Open the WSSiP application.
  2. WSSiP will start listening automatically. This will default to localhost on port 8080.
  3. Optionally, use Tools > Use Upstream Proxy to use another intercepting proxy to view web traffic.
  4. Configure the browser to point to http://localhost:8080/ as the HTTP Proxy.
  5. Navigate to a page using WebSockets. A good example is the WS Echo Demonstration.
  6. ???
  7. Potato.

Fuzzing

WSSiP provides an HTTP bridge via the man-in-the-middle proxy for custom applications to help fuzz a connection. These are accessed over the proxy server.

A few of the simple CA certificate downloads are:

Get WebSocket Connection Info

Returns whether the WebSocket id is connected to a web server, and if so, return information.

  • URL

    GET http://mitm/ws/:id

  • URL Params

    id=[integer]

  • Success Response (Not Connected)

    • Code: 200
      Content: {connected: false}
  • Success Response (Connected)

    • Code: 200
      Content: {connected: true, url: 'ws://echo.websocket.org', bytesReceived: 0, extensions: {}, readyState: 3, protocol: '', protocolVersion: 13}

Send WebSocket Data

Send WebSocket data.

  • URL

    POST http://mitm/ws/:id/:sender/:mode/:type?log=:log

  • URL Params

    Required:

    id=[integer]

    sender one of client or server

    mode one of message, ping or pong

    type one of ascii or binary (text is an alias of ascii)

    Optional:

    log either true or y to log in the WSSiP application. Errors will be logged in the WSSiP application instead of being returned via the REST API.

  • Data Params

    Raw data in the POST field will be sent to the WebSocket server.

  • Success Response:

    • Code: 200
      Content: {success: true}
  • Error Response:

    • Code: 500
      Content: {success: false, reason: 'Error message'}

Development

Pull requests are welcomed and encouraged. WSSiP supports the debug npm package, and setting the environment variable DEBUG=wssip:* will output debug information to console.

There are two commands depending on how you want to compile the Webpack bundle: for development, that is npm run compile:dev and for production is npm run compile. React will also log errors depending on whether development or production is specified.

Currently working on:

  • Exposed API for external scripts for fuzzing (99% complete, it is live but need to test more data)
  • Saving/Resuming Connections from File (35% complete, exporting works sans active connections)
  • Using WSSiP in browser without Electron (likely 1.1.0)
  • Rewrite in TypeScript (likely 1.2.0)
  • Using something other than Appbar for Custom/Intercept tabs, and styling the options to center better

For information on using the mitmengine class, see: npm, yarn, or mitmengine/README.md

wssip's People

Contributors

danieltimlee avatar erezrokah avatar ladyisatis avatar xwuevernote avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wssip's Issues

WSSiP v1.0.9 Windows Binary was shut down sliently

I launched WSSiP v1.0.9 on Windows 10, and tried to connect wss://echo.websocket.org at websocket.org. Then, WSSiP v1.0.9 was shut down silently. No error was not recorded at Windows Event log. Please let me know if you need more information to investigate this issue.

My environments:

  • Windows 10 (64 bit)
  • Google Chrome 59.0.3071.115

My procedures:

  1. Download wssip-1.0.9-win32.zip
  2. Unzip the wssip-1.0.9-win32.zip, and launch WSSiP.exe
  3. Run [Options] > [Start/Stop server] on WSSiP UI
  4. Open https://www.websocket.org/echo.html on Google Chrome
  5. Set localhost:8080 as proxy on Google Chrome
  6. Press [Connect] button at websocket.org on Google Chrome
  7. Then, WSSiP is shut down silently

"undefined is not a function" under "alerts" tag, service does not start (Windows portable)

I downloaded the latest release as Windows portable package. I used Options => Start/Stop Server, but nothing happened, it hangs with "starting..." in the toolbar. Looking in the alert tab, I see a message "undefined is not a function", unfortunately no stack.

Running on latest Windows 10.

image

EDIT: Tried the ZIP now. New behavior: It says "listening" and I can connect, but after sending the first message, it simply closes (crashes without message).

EDIT2: ...and when installing deps and running "npm start", I just get a white window...

ELIFECYCLE

When I wanted to open a window, the wssip caught the request and died immediately.
screenshot from 2018-04-19 10-52-04

Similar issue encountered on interacting with a live web connection.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/mttat/Documents/wssip/node_modules/.bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle [email protected]~start: CWD: /home/mttat/Documents/wssip
10 silly lifecycle [email protected]~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `electron .`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:283:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/mttat/Documents/wssip
16 verbose Linux 4.18.0-kali2-amd64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v8.11.2
19 verbose npm  v5.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `electron .`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Originally posted by @mttat in https://github.com/_render_node/MDEyOklzc3VlQ29tbWVudDQ0NzU1NDU5Mg==/timeline/issue_comment#issuecomment-447554592

v1.1.0 CLOSED

WHEN start and listen after short time app window closed automatically . without error on windows 7 64 bit (version wssip zip for windows 64bit)

Electron fails to start

I can't get wssip to run, I followed both the yarn instructions, as well as running from the source. When I try to execute the npm start command, I get this:

9 verbose lifecycle [email protected]~start: CWD: /Users/thomas/Code/sec/wssip
10 silly lifecycle [email protected]~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `electron .`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/thomas/.nvm/versions/node/v8.2.1/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/thomas/.nvm/versions/node/v8.2.1/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:921:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/thomas/Code/sec/wssip
16 verbose Darwin 16.1.0
17 verbose argv "/Users/thomas/.nvm/versions/node/v8.2.1/bin/node" "/Users/thomas/.nvm/versions/node/v8.2.1/bin/npm" "start"
18 verbose node v8.2.1
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `electron .`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

versions

λ ~/code/sec/wssip/ master* electron -v
v1.7.5
λ ~/code/sec/wssip/ master* node -v
v8.2.1
λ ~/code/sec/wssip/ master* npm -v
5.3.0

Any advice?

v1.1.0 crashes when connection is interupted

Using Windows version.

If I kill my server while a connection through WSSiP is still open, it takes the proxy with it. This is a huge issue, because I want to use the log to debug my client/server communication.

wssip installation error.

Issue:

I am getting below error while installing the wssip.
Please suggest on this.

sh: 1: node: not found
npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "[email protected]"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! [email protected] postinstall: node install.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/sr/Desktop/wssip/npm-debug.log

logs:

npm-debug.log.tar.gz

Can I use this repo to detect websocket http request header: sec-websocket-key?

Hello:
I need some code sample on how to detect WebSocket (wss) requests.
Basically, I can visit this URL with Chrome: https://www.websocket.org/echo.html
And click on “Connect” button to connect with the WebSocket server: wss://echo.websocket.org
Then type something in the message box, or using the default text in the message box “Rock it with HTML5 WebSocket”, then click on “Send” button, then I can see the messages on the “log” textbox, like this:
CONNECTED
SENT: Rock it with HTML5 WebSocket
RECEIVED: Rock it with HTML5 WebSocket
Then open Developer Tools from Chrome, on “Network” tab, I can see there is only one WS (WebSocket) request with the following headers:
Request URL:
wss://echo.websocket.org/?encoding=text

Request Method:
GET
Status Code:
101 Web Socket Protocol Handshake
I can use Chrome developer tools to convert the WebSocket request to Node.JS fetch:
fetch("wss://echo.websocket.org/?encoding=text", {
"headers": {
"accept-language": "en-US,en;q=0.9,fr;q=0.8,nl;q=0.7,zh-CN;q=0.6,zh;q=0.5,zh-TW;q=0.4",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-websocket-extensions": "permessage-deflate; client_max_window_bits",
"sec-websocket-key": "PVg+yYO5Q3EVgtPLLV2QXQ==",
"sec-websocket-version": "13"
},
"body": null,
"method": "GET",
"mode": "cors"
});
Let me know how I can use this repo to get all the headers, actually, there is only one header I need to get is: "sec-websocket-key": "PVg+yYO5Q3EVgtPLLV2QXQ=="
In my real-world job, I have to detect webscoket request from one specific web site. Using Chrome devtools, I can see that the web page uses rather complicated JavaScript to generate a websocket request, and sends it to the server. I want to write some kind of browser extension to detect the websocket request headers, actually, I only need this header: "sec-websocket-key".
Please advise,
Thanks,

Not correctly running with 'npx wssip' command. missing electron.

Not correctly running with only npx wssip.

$ npx wssip
npx: installed 71 in 1.929s
Cannot find module 'electron'

Seems dependency 'electron' is missing in package.json

wssip/package.json

Lines 55 to 62 in 90b1950

"dependencies": {
"conf": "^1.3.1",
"electron-window-state": "^4.1.1",
"hexy": "^0.2.10",
"node-forge": "^0.7.1",
"ws": "^3.3.2",
"yargs": "^10.0.3"
},

electron is included in devDependency though, but not in dependency list.

ps. Really enjoying this tool !

missing blog post link

The README says:

More information can be found on the blog post.

But there is no link to the post.

Where does portable windows edition store configuration?

There is a "autostart server" configuration which persists between sessions. Could you please tell me where this config is stored? Is there an alternative way to pass command line arguments to (auto)start or even start the proxy on a certain port?

v 1.1.0 broken

The version 1.1.0 is broken, gui is not working, not showing web socket connections, menu do no not execute any of the actions beside starting/stopping the proxy (es. upstream proxy, change host/port and so on).

Was tested on windows 10:
windows32-portable
windows_x64

gui

if you need more details please let me know

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.