Last active
December 23, 2018 00:04
-
-
Save FlorianWendelborn/ef119ca3960f939cac7d56df8e248378 to your computer and use it in GitHub Desktop.
Exploiting https://button.mohsh.com to make the Illuminati the Top Country
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() | |
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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