Skip to content

Instantly share code, notes, and snippets.

@FlorianWendelborn
Last active December 23, 2018 00:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianWendelborn/ef119ca3960f939cac7d56df8e248378 to your computer and use it in GitHub Desktop.
Save FlorianWendelborn/ef119ca3960f939cac7d56df8e248378 to your computer and use it in GitHub Desktop.
Exploiting https://button.mohsh.com to make the Illuminati the Top Country
#!/usr/bin/env node
const WebSocketClient = require('websocket').client
const attempt = () =>
new Promise((resolve, reject) => {
const client = new WebSocketClient()
client.on('connectFailed', error => {
console.log('Connect Error: ' + error.toString())
resolve()
})
client.on('connect', connection => {
console.log('WebSocket Client Connected')
connection.on('error', error => {
console.log('Connection Error: ' + error.toString())
resolve()
})
connection.on('close', () => {
resolve()
})
connection.on('message', message => {
if (message.type === 'utf8') {
const json = JSON.parse(message.utf8Data)
console.log(json)
}
})
setTimeout(() => {
setInterval(() => {
connection.sendUTF(
JSON.stringify({
user: 'BsePGryA_l7t3mhu~EFU~',
country: 'Illuminati',
flag:
'https://www.shareicon.net/data/128x128/2015/11/29/679740_triangle_512x512.png',
add: 1,
})
)
}, 200)
}, 1000)
})
client.connect('wss://mohsh.com:8999')
})
//
;(async () => {
while (true) await attempt()
})()
{
"name": "ws",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"websocket": "^1.0.28"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment