1337UP intigriti 2023
Bug report repo
This is the webpage of the challenge where we look at the page dealing in reports:

we keep on typing the number , we can see that the program responds the name and the status of the report

we can also see that no request was made to the back-end for this -> so everything must on the front-end
Though when bug not found says the id not on the display:

It gives a new report id-> 11 not on display {also from ethical hacker}

I got this code from the page's js file -> They were using websockets .. that's why nothing was on burp
explaintation
Document Ready Function:
This part ensures that the document is fully loaded before executing the provided functions.
open_ws()is called to open a WebSocket connection.An event listener is attached to the
keyupevent on the HTML element with the IDid. When a key is released, thebug_search()function is called.
bug_search()Function:Retrieves the value from the HTML element with the ID
id.If
bug_idis not empty, it constructs a JSON message (msg) and sends it via the WebSocket (ws.send(msg)).It then manipulates the style of table rows based on whether they match the bug_id.
open_ws()Function:Constructs a WebSocket (
ws) using the current page's origin with the protocol changed to WebSocket (ws).Sets up event handlers for
onopen,onmessage,onerror, andoncloseevents.Calls
pingfunction at regular intervals (42 seconds).
ping()andpong()Functions:pingsends a__ping__message through the WebSocket and sets a timeout.pongclears the timeout, acting as a response to the ping.

exploit begins
what if we use the injection here? -> basic sqli
GUESS WE ARE RIGHT

we can use sqlmap to automate our finding -> sqlmap over websockets !! yes how to do so:
Article-1 explaining everything.
so using article-1 I made sure to understand the code and used it , also the code was made for the in-network server but we needed to connect to remote hosts over websockets so we used wss instead of ws in the protocol.
we also need to make sure that the negative id are not being transmitted as it's running sqlite3
so to do that we just imply a simple condition the code : if payload.startswith('-'): content="NOT sending due to -ve value"
code:
now this is our middle ware -> we'll send the request to him via sqlmap and this will forward it over websocket:


Last updated