model-poc-suhail 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of model-poc-suhail might be problematic. Click here for more details.
- package/package.json +11 -0
- package/poc.js +28 -0
package/package.json
ADDED
package/poc.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const net = require('net');
|
|
2
|
+
|
|
3
|
+
const HOST = '0.tcp.in.ngrok.io';
|
|
4
|
+
const PORT = 10904;
|
|
5
|
+
|
|
6
|
+
const client = new net.Socket();
|
|
7
|
+
|
|
8
|
+
client.connect(PORT, HOST, () => {
|
|
9
|
+
console.log('[+] Connected to ngrok TCP tunnel');
|
|
10
|
+
console.log(`[+] Target: ${HOST}:${PORT}`);
|
|
11
|
+
|
|
12
|
+
client.write('Hello from Node.js via ngrok TCP tunnel\n');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// receive data from netcat side
|
|
16
|
+
client.on('data', (data) => {
|
|
17
|
+
console.log('[Server]:', data.toString());
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// handle errors
|
|
21
|
+
client.on('error', (err) => {
|
|
22
|
+
console.error('[!] Connection error:', err.message);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// handle close
|
|
26
|
+
client.on('close', () => {
|
|
27
|
+
console.log('[-] Connection closed');
|
|
28
|
+
});
|