23 lines
689 B
JavaScript
23 lines
689 B
JavaScript
const fs = require('fs');
|
|
const content = fs.readFileSync('D:/cumin/ghaymah_dns_net_sec_tests/ghaymah_bundle.js', 'utf8');
|
|
|
|
// Find all occurrences of D. or values.
|
|
const matches = content.match(/values\.([a-zA-Z0-9_]+)/g) || [];
|
|
const unique = [...new Set(matches)];
|
|
console.log('values.* occurrences:', unique);
|
|
|
|
// Search for command or entrypoint
|
|
const idxs = [];
|
|
let p = 0;
|
|
while (true) {
|
|
const i = content.indexOf('entrypoint', p);
|
|
if (i === -1) break;
|
|
idxs.push(i);
|
|
p = i + 1;
|
|
}
|
|
console.log('entrypoint matches:', idxs.length);
|
|
for (const i of idxs.slice(0, 5)) {
|
|
console.log('--- snippet at', i, '---');
|
|
console.log(content.substring(Math.max(0, i - 100), i + 200));
|
|
}
|