@cyberstrike-io/cyberstrike 1.1.16 → 1.1.17-beta.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/hackbrowser-worker.js +144 -15
- package/package.json +12 -12
- package/web/assets/{ghostty-web-Bz-51D_V.js → ghostty-web-B-qs2pcP.js} +1 -1
- package/web/assets/{home-BlWhTEfQ.js → home-CQIMTgaN.js} +1 -1
- package/web/assets/{index-BYRKQold.js → index-4k4BrL6l.js} +2 -2
- package/web/assets/{session-kfyLO2d_.js → session-CkTzv4ki.js} +3 -3
- package/web/index.html +1 -1
package/hackbrowser-worker.js
CHANGED
|
@@ -106252,11 +106252,137 @@ var BUNDLED_PROVIDERS = {
|
|
|
106252
106252
|
|
|
106253
106253
|
// ../hackbrowser/src/api.ts
|
|
106254
106254
|
import path4 from "path";
|
|
106255
|
-
import { existsSync as
|
|
106255
|
+
import { existsSync as existsSync3 } from "fs";
|
|
106256
106256
|
import { chromium as chromium2 } from "playwright";
|
|
106257
106257
|
|
|
106258
|
-
// ../hackbrowser/src/
|
|
106258
|
+
// ../hackbrowser/src/stealth.ts
|
|
106259
|
+
import { existsSync as existsSync2 } from "fs";
|
|
106259
106260
|
import { chromium } from "playwright";
|
|
106261
|
+
var LAUNCH_ARGS = [
|
|
106262
|
+
"--disable-blink-features=AutomationControlled",
|
|
106263
|
+
"--disable-features=IsolateOrigins,site-per-process",
|
|
106264
|
+
"--no-sandbox",
|
|
106265
|
+
"--disable-setuid-sandbox",
|
|
106266
|
+
"--disable-dev-shm-usage",
|
|
106267
|
+
"--no-first-run",
|
|
106268
|
+
"--no-zygote"
|
|
106269
|
+
];
|
|
106270
|
+
function launchOptions(headless) {
|
|
106271
|
+
return { headless, args: LAUNCH_ARGS };
|
|
106272
|
+
}
|
|
106273
|
+
function userAgent(version3) {
|
|
106274
|
+
return `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${version3} Safari/537.36`;
|
|
106275
|
+
}
|
|
106276
|
+
function findSystemChrome() {
|
|
106277
|
+
const candidates = process.platform === "darwin" ? ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"] : process.platform === "win32" ? [
|
|
106278
|
+
`${process.env.PROGRAMFILES}\\Google\\Chrome\\Application\\chrome.exe`,
|
|
106279
|
+
`${process.env["PROGRAMFILES(X86)"]}\\Google\\Chrome\\Application\\chrome.exe`,
|
|
106280
|
+
`${process.env.LOCALAPPDATA}\\Google\\Chrome\\Application\\chrome.exe`
|
|
106281
|
+
] : ["/usr/bin/google-chrome", "/usr/bin/google-chrome-stable", "/usr/bin/chromium-browser", "/usr/bin/chromium"];
|
|
106282
|
+
return candidates.find((p) => existsSync2(p));
|
|
106283
|
+
}
|
|
106284
|
+
async function connect(opts) {
|
|
106285
|
+
if (opts.cdp)
|
|
106286
|
+
return chromium.connectOverCDP(opts.cdp);
|
|
106287
|
+
const chrome = findSystemChrome();
|
|
106288
|
+
if (chrome)
|
|
106289
|
+
return chromium.launch({ ...launchOptions(opts.headless), executablePath: chrome });
|
|
106290
|
+
return chromium.launch(launchOptions(opts.headless));
|
|
106291
|
+
}
|
|
106292
|
+
function contextOptions(version3) {
|
|
106293
|
+
return {
|
|
106294
|
+
userAgent: userAgent(version3),
|
|
106295
|
+
viewport: { width: 1920, height: 1080 },
|
|
106296
|
+
screen: { width: 1920, height: 1080 },
|
|
106297
|
+
locale: "en-US",
|
|
106298
|
+
timezoneId: "America/New_York",
|
|
106299
|
+
extraHTTPHeaders: { "Accept-Language": "en-US,en;q=0.9" }
|
|
106300
|
+
};
|
|
106301
|
+
}
|
|
106302
|
+
var INIT_SCRIPT = `
|
|
106303
|
+
Object.defineProperty(navigator, 'webdriver', { get: () => false });
|
|
106304
|
+
|
|
106305
|
+
for (const key of Object.keys(window)) {
|
|
106306
|
+
if (/^cdc_/.test(key)) delete window[key];
|
|
106307
|
+
}
|
|
106308
|
+
|
|
106309
|
+
if (navigator.plugins.length === 0) {
|
|
106310
|
+
Object.defineProperty(navigator, 'plugins', {
|
|
106311
|
+
get: () => [
|
|
106312
|
+
{ name: 'Chrome PDF Plugin', filename: 'internal-pdf-viewer', description: 'Portable Document Format' },
|
|
106313
|
+
{ name: 'Chrome PDF Viewer', filename: 'mhjfbmdgcfjbbpaeojofohoefgiehjai', description: '' },
|
|
106314
|
+
{ name: 'Native Client', filename: 'internal-nacl-plugin', description: '' },
|
|
106315
|
+
],
|
|
106316
|
+
});
|
|
106317
|
+
}
|
|
106318
|
+
|
|
106319
|
+
if (!navigator.languages || navigator.languages.length === 0) {
|
|
106320
|
+
Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'en'] });
|
|
106321
|
+
}
|
|
106322
|
+
|
|
106323
|
+
Object.defineProperty(navigator, 'hardwareConcurrency', { get: () => 8 });
|
|
106324
|
+
Object.defineProperty(navigator, 'deviceMemory', { get: () => 8 });
|
|
106325
|
+
Object.defineProperty(navigator, 'maxTouchPoints', { get: () => 0 });
|
|
106326
|
+
|
|
106327
|
+
if (!navigator.connection) {
|
|
106328
|
+
Object.defineProperty(navigator, 'connection', {
|
|
106329
|
+
get: () => ({
|
|
106330
|
+
effectiveType: '4g',
|
|
106331
|
+
rtt: 50,
|
|
106332
|
+
downlink: 10,
|
|
106333
|
+
saveData: false,
|
|
106334
|
+
}),
|
|
106335
|
+
});
|
|
106336
|
+
}
|
|
106337
|
+
|
|
106338
|
+
Object.defineProperty(screen, 'width', { get: () => 1920 });
|
|
106339
|
+
Object.defineProperty(screen, 'height', { get: () => 1080 });
|
|
106340
|
+
Object.defineProperty(screen, 'availWidth', { get: () => 1920 });
|
|
106341
|
+
Object.defineProperty(screen, 'availHeight', { get: () => 1040 });
|
|
106342
|
+
Object.defineProperty(screen, 'colorDepth', { get: () => 24 });
|
|
106343
|
+
Object.defineProperty(screen, 'pixelDepth', { get: () => 24 });
|
|
106344
|
+
window.outerWidth = 1920;
|
|
106345
|
+
window.outerHeight = 1080;
|
|
106346
|
+
window.innerWidth = 1920;
|
|
106347
|
+
window.innerHeight = 969;
|
|
106348
|
+
|
|
106349
|
+
const origGetParameter = WebGLRenderingContext.prototype.getParameter;
|
|
106350
|
+
WebGLRenderingContext.prototype.getParameter = function(param) {
|
|
106351
|
+
if (param === 37445) return 'Intel Inc.';
|
|
106352
|
+
if (param === 37446) return 'Intel Iris OpenGL Engine';
|
|
106353
|
+
return origGetParameter.call(this, param);
|
|
106354
|
+
};
|
|
106355
|
+
const origGetParameter2 = WebGL2RenderingContext.prototype.getParameter;
|
|
106356
|
+
WebGL2RenderingContext.prototype.getParameter = function(param) {
|
|
106357
|
+
if (param === 37445) return 'Intel Inc.';
|
|
106358
|
+
if (param === 37446) return 'Intel Iris OpenGL Engine';
|
|
106359
|
+
return origGetParameter2.call(this, param);
|
|
106360
|
+
};
|
|
106361
|
+
|
|
106362
|
+
const origToDataURL = HTMLCanvasElement.prototype.toDataURL;
|
|
106363
|
+
HTMLCanvasElement.prototype.toDataURL = function(type, quality) {
|
|
106364
|
+
const ctx = this.getContext('2d');
|
|
106365
|
+
if (ctx) {
|
|
106366
|
+
const pixel = ctx.getImageData(0, 0, 1, 1);
|
|
106367
|
+
pixel.data[3] = pixel.data[3] ^ 1;
|
|
106368
|
+
ctx.putImageData(pixel, 0, 0);
|
|
106369
|
+
}
|
|
106370
|
+
return origToDataURL.call(this, type, quality);
|
|
106371
|
+
};
|
|
106372
|
+
|
|
106373
|
+
const origQuery = window.Permissions?.prototype?.query;
|
|
106374
|
+
if (origQuery) {
|
|
106375
|
+
window.Permissions.prototype.query = function(params) {
|
|
106376
|
+
if (params.name === 'notifications') {
|
|
106377
|
+
return Promise.resolve({ state: Notification.permission, onchange: null });
|
|
106378
|
+
}
|
|
106379
|
+
return origQuery.call(this, params);
|
|
106380
|
+
};
|
|
106381
|
+
}
|
|
106382
|
+
|
|
106383
|
+
if (!window.chrome) window.chrome = {};
|
|
106384
|
+
if (!window.chrome.runtime) window.chrome.runtime = { connect: () => {}, sendMessage: () => {} };
|
|
106385
|
+
`;
|
|
106260
106386
|
|
|
106261
106387
|
// ../hackbrowser/src/log.ts
|
|
106262
106388
|
var LEVEL_PRIORITY = {
|
|
@@ -129063,7 +129189,7 @@ async function runMultiCredential(config3, credentials) {
|
|
|
129063
129189
|
} catch (err) {
|
|
129064
129190
|
throw new Error(`AI model required: ${String(err)}`);
|
|
129065
129191
|
}
|
|
129066
|
-
const browser = await
|
|
129192
|
+
const browser = await connect({ cdp: config3.cdp, headless: config3.headless ?? false });
|
|
129067
129193
|
let sessionId = config3.cyberstrike.sessionID ?? "";
|
|
129068
129194
|
if (!dryRun && !sessionId) {
|
|
129069
129195
|
const created = await initSession(serverUrl, targetUrl, undefined);
|
|
@@ -129077,9 +129203,8 @@ async function runMultiCredential(config3, credentials) {
|
|
|
129077
129203
|
const captureQueues = new Map;
|
|
129078
129204
|
const lastAuthHeaders = new Map;
|
|
129079
129205
|
for (const [credIndex, cred] of credentials.entries()) {
|
|
129080
|
-
const browserContext = await browser.newContext(
|
|
129081
|
-
|
|
129082
|
-
});
|
|
129206
|
+
const browserContext = await browser.newContext(contextOptions(browser.version()));
|
|
129207
|
+
await browserContext.addInitScript(INIT_SCRIPT);
|
|
129083
129208
|
if (panelOn)
|
|
129084
129209
|
await browserContext.addInitScript(PANEL_INIT_SCRIPT);
|
|
129085
129210
|
const page = await browserContext.newPage();
|
|
@@ -129330,10 +129455,9 @@ async function run(config3) {
|
|
|
129330
129455
|
}
|
|
129331
129456
|
sessionID = created;
|
|
129332
129457
|
}
|
|
129333
|
-
const browser = await
|
|
129334
|
-
const context = await browser.newContext(
|
|
129335
|
-
|
|
129336
|
-
});
|
|
129458
|
+
const browser = await connect({ cdp: config3.cdp, headless: config3.headless ?? false });
|
|
129459
|
+
const context = await browser.newContext(contextOptions(browser.version()));
|
|
129460
|
+
await context.addInitScript(INIT_SCRIPT);
|
|
129337
129461
|
if (panelOn)
|
|
129338
129462
|
await context.addInitScript(PANEL_INIT_SCRIPT);
|
|
129339
129463
|
const page = await context.newPage();
|
|
@@ -129551,11 +129675,13 @@ async function run(config3) {
|
|
|
129551
129675
|
// ../hackbrowser/src/api.ts
|
|
129552
129676
|
var log8 = Log.create({ service: "hackbrowser:api" });
|
|
129553
129677
|
function preflightCheck() {
|
|
129678
|
+
if (findSystemChrome())
|
|
129679
|
+
return;
|
|
129554
129680
|
const chromiumPath = chromium2.executablePath();
|
|
129555
|
-
if (!
|
|
129556
|
-
throw new Error(`
|
|
129557
|
-
` + `
|
|
129558
|
-
` + `(or: npx playwright install chromium
|
|
129681
|
+
if (!existsSync3(chromiumPath)) {
|
|
129682
|
+
throw new Error(`No browser found. Install Google Chrome or run:
|
|
129683
|
+
` + ` bunx playwright install chromium
|
|
129684
|
+
` + `(or: npx playwright install chromium)`);
|
|
129559
129685
|
}
|
|
129560
129686
|
}
|
|
129561
129687
|
function validate(opts) {
|
|
@@ -129589,12 +129715,14 @@ function toAgentConfig(opts) {
|
|
|
129589
129715
|
dryRun: opts.dryRun,
|
|
129590
129716
|
panel: opts.panel,
|
|
129591
129717
|
model: opts.model,
|
|
129718
|
+
cdp: opts.cdp,
|
|
129592
129719
|
signal: opts.signal
|
|
129593
129720
|
};
|
|
129594
129721
|
}
|
|
129595
129722
|
async function runCrawl(opts) {
|
|
129596
129723
|
validate(opts);
|
|
129597
|
-
|
|
129724
|
+
if (!opts.cdp)
|
|
129725
|
+
preflightCheck();
|
|
129598
129726
|
if (opts.logLevel)
|
|
129599
129727
|
Log.init({ level: opts.logLevel });
|
|
129600
129728
|
if (opts.logSink)
|
|
@@ -129800,6 +129928,7 @@ function buildCrawlOptions(opts, signal) {
|
|
|
129800
129928
|
panel: opts.panel,
|
|
129801
129929
|
cyberstrikeUrl: opts.cyberstrikeUrl,
|
|
129802
129930
|
model,
|
|
129931
|
+
cdp: opts.cdp,
|
|
129803
129932
|
logSink,
|
|
129804
129933
|
eventSink: eventSink2,
|
|
129805
129934
|
signal,
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs",
|
|
9
9
|
"preuninstall": "bun ./preuninstall.mjs || node ./preuninstall.mjs || true"
|
|
10
10
|
},
|
|
11
|
-
"version": "1.1.
|
|
11
|
+
"version": "1.1.17-beta.0",
|
|
12
12
|
"license": "AGPL-3.0-only",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"cyberstrike",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"playwright": "1.58.2"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@cyberstrike-io/cyberstrike-darwin-arm64": "1.1.
|
|
45
|
-
"@cyberstrike-io/cyberstrike-linux-x64-baseline-musl": "1.1.
|
|
46
|
-
"@cyberstrike-io/cyberstrike-linux-arm64-musl": "1.1.
|
|
47
|
-
"@cyberstrike-io/cyberstrike-linux-x64": "1.1.
|
|
48
|
-
"@cyberstrike-io/cyberstrike-darwin-x64-baseline": "1.1.
|
|
49
|
-
"@cyberstrike-io/cyberstrike-darwin-x64": "1.1.
|
|
50
|
-
"@cyberstrike-io/cyberstrike-windows-x64": "1.1.
|
|
51
|
-
"@cyberstrike-io/cyberstrike-linux-x64-baseline": "1.1.
|
|
52
|
-
"@cyberstrike-io/cyberstrike-linux-x64-musl": "1.1.
|
|
53
|
-
"@cyberstrike-io/cyberstrike-windows-x64-baseline": "1.1.
|
|
54
|
-
"@cyberstrike-io/cyberstrike-linux-arm64": "1.1.
|
|
44
|
+
"@cyberstrike-io/cyberstrike-darwin-arm64": "1.1.17-beta.0",
|
|
45
|
+
"@cyberstrike-io/cyberstrike-linux-x64-baseline-musl": "1.1.17-beta.0",
|
|
46
|
+
"@cyberstrike-io/cyberstrike-linux-arm64-musl": "1.1.17-beta.0",
|
|
47
|
+
"@cyberstrike-io/cyberstrike-linux-x64": "1.1.17-beta.0",
|
|
48
|
+
"@cyberstrike-io/cyberstrike-darwin-x64-baseline": "1.1.17-beta.0",
|
|
49
|
+
"@cyberstrike-io/cyberstrike-darwin-x64": "1.1.17-beta.0",
|
|
50
|
+
"@cyberstrike-io/cyberstrike-windows-x64": "1.1.17-beta.0",
|
|
51
|
+
"@cyberstrike-io/cyberstrike-linux-x64-baseline": "1.1.17-beta.0",
|
|
52
|
+
"@cyberstrike-io/cyberstrike-linux-x64-musl": "1.1.17-beta.0",
|
|
53
|
+
"@cyberstrike-io/cyberstrike-windows-x64-baseline": "1.1.17-beta.0",
|
|
54
|
+
"@cyberstrike-io/cyberstrike-linux-arm64": "1.1.17-beta.0"
|
|
55
55
|
}
|
|
56
56
|
}
|