New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket functionality support #1388

Open
manmolecular opened this Issue Nov 14, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@manmolecular

manmolecular commented Nov 14, 2018

Greetings.

I wanted to ask if there are any methods to work with websockets (send and receive messages) through NSE script? Does NMAP have some NSE Libraries or maybe some other solutions to work with websockets?

In my case, I want to send and receive some messages from websocket by using custom NSE script during host scan, but at this moment I can't find such methods or solutions to do this - I have the opportunity to only pass the handshake stage with hardcoded parameters (such as Sec-WebSocket-Key).

For example, I try to scan socket.io resource to find version of product, websocket location is:

wss://{resourceaddr}/ControlApi/socket.io/?transport=websocket

And sending message is:

421["request",{"service":"DocsService","method":"getVersion","payload":{}}]

When I use Echo Test from https://www.websocket.org/echo.html or Python implementation based on websocket-client it works as expected - i got answer message:

431[{"type":"sync","complete":true,"payload":"{\n\t\"gluware_version\": {\n\t\t\"name\": \"Gluware 3.4\",\n\t\t\"semver\": \"3.4.83\",\n\t\t\"lastUpdated\": \"2018-11-13 18:45:15 +0000\"\n\t} ...

Which contains all information that i need, but when I use NSE script, after handshake I got only first starting messages from websocket which looks like:

0{"sid":"SL0tp5WNMqJHVB-9AAAJ","upgrades":[],"pingInterval":25000,"pingTimeout":60000}
40

But after that nothing is working, even if I send something or not - looks like disconnection or something like this.
So, how can I send my request message to websocket properly with NMAP/NSE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment