// module connect const express = require('express'); const protobuf = require('protobufjs'); const app = express(); const port = 3000; app.use(express.json()); app.post('/create_user', (request, response) => { const descriptor = request.body; // JSON-дескриптор из тела запроса console.log('[*] Received descriptor:', JSON.stringify(descriptor)); try { const root = protobuf.Root.fromJSON(descriptor); const UserType = root.lookupType('User'); const userBytes = Buffer.from([0x08, 0x01, 0x12, 0x07, 0x0a, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f]); try { const user = UserType.decode(userBytes); // <- code execution } catch (e) { } } catch (err) { console.error('[!] Error:', err.message); response.status(500).json({ status: 'error', message: err.message }); } }) app.listen(port, () => { console.log('[*] Server listening on port ${port}'); });