stegdoc 5.4.0 → 5.6.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.
- package/package.json +1 -1
- package/src/commands/encode.js +4 -2
- package/src/index.js +1 -1
- package/src/lib/log-generator.js +16 -17
package/package.json
CHANGED
package/src/commands/encode.js
CHANGED
|
@@ -30,12 +30,14 @@ function zipFolder(folderPath) {
|
|
|
30
30
|
*/
|
|
31
31
|
async function detectFileType(filePath) {
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
33
|
+
const fileType = await import('file-type');
|
|
34
|
+
const fromBuffer = fileType.fileTypeFromBuffer || fileType.default?.fromBuffer;
|
|
35
|
+
if (!fromBuffer) return null;
|
|
34
36
|
const fd = await fs.promises.open(filePath, 'r');
|
|
35
37
|
const buf = Buffer.alloc(4100);
|
|
36
38
|
await fd.read(buf, 0, 4100, 0);
|
|
37
39
|
await fd.close();
|
|
38
|
-
return await
|
|
40
|
+
return await fromBuffer(buf);
|
|
39
41
|
} catch {
|
|
40
42
|
return null;
|
|
41
43
|
}
|
package/src/index.js
CHANGED
package/src/lib/log-generator.js
CHANGED
|
@@ -46,23 +46,22 @@ const IP_POOL_RARE = [
|
|
|
46
46
|
// ─── User-Agent Pool ────────────────────────────────────────────────────────
|
|
47
47
|
|
|
48
48
|
const USER_AGENTS = [
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
|
|
60
|
-
'
|
|
61
|
-
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
|
|
49
|
+
'node-fetch/3.3.2',
|
|
50
|
+
'axios/1.7.2',
|
|
51
|
+
'python-httpx/0.27.0',
|
|
52
|
+
'Go-http-client/2.0',
|
|
53
|
+
'curl/8.5.0',
|
|
54
|
+
'python-requests/2.31.0',
|
|
55
|
+
'okhttp/4.12.0',
|
|
56
|
+
'got/14.2.1',
|
|
57
|
+
'undici/6.13.0',
|
|
58
|
+
'httpie/3.2.2',
|
|
59
|
+
'wget/1.21.4',
|
|
60
|
+
'PostmanRuntime/7.36.3',
|
|
62
61
|
];
|
|
63
62
|
|
|
64
|
-
// Weights for UA selection (
|
|
65
|
-
const UA_WEIGHTS = [20, 15, 12, 10, 8,
|
|
63
|
+
// Weights for UA selection (common API clients appear more)
|
|
64
|
+
const UA_WEIGHTS = [20, 18, 15, 12, 10, 8, 6, 4, 3, 2, 1, 1];
|
|
66
65
|
|
|
67
66
|
// ─── URL Path Templates (for data lines) ───────────────────────────────────
|
|
68
67
|
|
|
@@ -620,8 +619,8 @@ function encodePayloadToLogLines(payloadBuffer, metadataJson, encryptionMeta) {
|
|
|
620
619
|
dataRows.push(generateDataLogLine(chunk));
|
|
621
620
|
}
|
|
622
621
|
|
|
623
|
-
// Generate filler lines for realism
|
|
624
|
-
const fillerCount = Math.max(
|
|
622
|
+
// Generate filler lines for realism (3% — enough for variation, minimal overhead)
|
|
623
|
+
const fillerCount = Math.max(10, Math.floor(dataLineCount * 0.03));
|
|
625
624
|
const fillerRows = [];
|
|
626
625
|
for (let i = 0; i < fillerCount; i++) {
|
|
627
626
|
fillerRows.push(generateFillerLogLine());
|