@jshookmcp/jshook 0.2.5 → 0.2.6
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/README.md +5 -5
- package/README.zh.md +5 -5
- package/dist/packages/extension-sdk/src/workflow.d.ts +17 -2
- package/dist/packages/extension-sdk/src/workflow.js +36 -0
- package/dist/src/modules/browser/BrowserPool.d.ts +49 -0
- package/dist/src/modules/browser/BrowserPool.js +288 -0
- package/dist/src/modules/deobfuscator/AdvancedDeobfuscator.d.ts +5 -0
- package/dist/src/modules/deobfuscator/AdvancedDeobfuscator.js +43 -2
- package/dist/src/modules/deobfuscator/Deobfuscator.js +5 -0
- package/dist/src/modules/external/ExternalToolRunner.js +1 -1
- package/dist/src/server/MCPServer.context.d.ts +1 -0
- package/dist/src/server/domains/browser/handlers/stealth-injection.d.ts +1 -0
- package/dist/src/server/domains/browser/handlers/stealth-injection.js +3 -0
- package/dist/src/server/domains/shared-state-board/definitions.d.ts +2 -0
- package/dist/src/server/domains/shared-state-board/definitions.js +78 -0
- package/dist/src/server/domains/shared-state-board/handlers.impl.d.ts +58 -0
- package/dist/src/server/domains/shared-state-board/handlers.impl.js +419 -0
- package/dist/src/server/domains/shared-state-board/index.d.ts +2 -0
- package/dist/src/server/domains/shared-state-board/index.js +2 -0
- package/dist/src/server/domains/shared-state-board/manifest.d.ts +57 -0
- package/dist/src/server/domains/shared-state-board/manifest.js +74 -0
- package/dist/src/server/http/SseStream.d.ts +21 -0
- package/dist/src/server/http/SseStream.js +129 -0
- package/dist/src/server/teams/TeamManager.d.ts +43 -0
- package/dist/src/server/teams/TeamManager.js +238 -0
- package/dist/src/server/teams/index.d.ts +1 -0
- package/dist/src/server/teams/index.js +1 -0
- package/dist/src/server/workflows/WorkflowContract.d.ts +20 -4
- package/dist/src/server/workflows/WorkflowContract.js +40 -0
- package/dist/src/server/workflows/WorkflowEngine.js +190 -13
- package/dist/src/types/deobfuscator.d.ts +1 -0
- package/dist/src/utils/cache/CachedDecorator.d.ts +8 -0
- package/dist/src/utils/cache/CachedDecorator.js +55 -0
- package/dist/src/utils/cache/PersistentCache.d.ts +33 -0
- package/dist/src/utils/cache/PersistentCache.js +246 -0
- package/dist/src/utils/cache/index.d.ts +2 -0
- package/dist/src/utils/cache/index.js +2 -0
- package/package.json +11 -12
- package/scripts/postinstall.cjs +54 -27
- package/workflows/anti-bot-diagnoser/.jshook-install.json +14 -0
- package/workflows/anti-bot-diagnoser/LICENSE +21 -0
- package/workflows/anti-bot-diagnoser/README.md +105 -0
- package/workflows/anti-bot-diagnoser/docs/agent-recipes.md +44 -0
- package/workflows/anti-bot-diagnoser/meta.yaml +6 -0
- package/workflows/anti-bot-diagnoser/package.json +22 -0
- package/workflows/anti-bot-diagnoser/tsconfig.json +15 -0
- package/workflows/anti-bot-diagnoser/workflow.ts +224 -0
- package/workflows/api-openapi-probe/.jshook-install.json +14 -0
- package/workflows/api-openapi-probe/meta.yaml +6 -0
- package/workflows/api-openapi-probe/package.json +22 -0
- package/workflows/api-openapi-probe/pnpm-lock.yaml +819 -0
- package/workflows/api-openapi-probe/tsconfig.json +15 -0
- package/workflows/api-openapi-probe/workflow.ts +40 -0
- package/workflows/api-probe-batch/.jshook-install.json +14 -0
- package/workflows/api-probe-batch/LICENSE +21 -0
- package/workflows/api-probe-batch/README.md +45 -0
- package/workflows/api-probe-batch/meta.yaml +4 -0
- package/workflows/api-probe-batch/package.json +23 -0
- package/workflows/api-probe-batch/tsconfig.json +16 -0
- package/workflows/api-probe-batch/workflow.ts +111 -0
- package/workflows/auth-bootstrap/.jshook-install.json +14 -0
- package/workflows/auth-bootstrap/LICENSE +21 -0
- package/workflows/auth-bootstrap/README.md +74 -0
- package/workflows/auth-bootstrap/meta.yaml +4 -0
- package/workflows/auth-bootstrap/package.json +23 -0
- package/workflows/auth-bootstrap/tsconfig.json +16 -0
- package/workflows/auth-bootstrap/workflow.ts +141 -0
- package/workflows/auth-extract/.jshook-install.json +14 -0
- package/workflows/auth-extract/meta.yaml +6 -0
- package/workflows/auth-extract/package.json +22 -0
- package/workflows/auth-extract/pnpm-lock.yaml +819 -0
- package/workflows/auth-extract/tsconfig.json +15 -0
- package/workflows/auth-extract/workflow.ts +36 -0
- package/workflows/auth-surface-mapper/.jshook-install.json +14 -0
- package/workflows/auth-surface-mapper/meta.yaml +6 -0
- package/workflows/auth-surface-mapper/package.json +22 -0
- package/workflows/auth-surface-mapper/pnpm-lock.yaml +819 -0
- package/workflows/auth-surface-mapper/tsconfig.json +15 -0
- package/workflows/auth-surface-mapper/workflow.ts +104 -0
- package/workflows/batch-register/.jshook-install.json +14 -0
- package/workflows/batch-register/LICENSE +21 -0
- package/workflows/batch-register/README.md +39 -0
- package/workflows/batch-register/meta.yaml +4 -0
- package/workflows/batch-register/package.json +23 -0
- package/workflows/batch-register/tsconfig.json +16 -0
- package/workflows/batch-register/workflow.ts +67 -0
- package/workflows/bundle-recovery/.jshook-install.json +14 -0
- package/workflows/bundle-recovery/LICENSE +21 -0
- package/workflows/bundle-recovery/README.md +105 -0
- package/workflows/bundle-recovery/docs/agent-recipes.md +44 -0
- package/workflows/bundle-recovery/meta.yaml +6 -0
- package/workflows/bundle-recovery/package.json +22 -0
- package/workflows/bundle-recovery/tsconfig.json +15 -0
- package/workflows/bundle-recovery/workflow.ts +179 -0
- package/workflows/challenge-detector/.jshook-install.json +14 -0
- package/workflows/challenge-detector/meta.yaml +14 -0
- package/workflows/challenge-detector/package.json +22 -0
- package/workflows/challenge-detector/pnpm-lock.yaml +819 -0
- package/workflows/challenge-detector/tsconfig.json +15 -0
- package/workflows/challenge-detector/workflow.ts +298 -0
- package/workflows/deobfuscation-pipeline/.jshook-install.json +14 -0
- package/workflows/deobfuscation-pipeline/meta.yaml +6 -0
- package/workflows/deobfuscation-pipeline/package.json +22 -0
- package/workflows/deobfuscation-pipeline/pnpm-lock.yaml +819 -0
- package/workflows/deobfuscation-pipeline/tsconfig.json +15 -0
- package/workflows/deobfuscation-pipeline/workflow.ts +119 -0
- package/workflows/electron-bridge-mapper/.jshook-install.json +14 -0
- package/workflows/electron-bridge-mapper/meta.yaml +6 -0
- package/workflows/electron-bridge-mapper/package.json +22 -0
- package/workflows/electron-bridge-mapper/pnpm-lock.yaml +819 -0
- package/workflows/electron-bridge-mapper/tsconfig.json +15 -0
- package/workflows/electron-bridge-mapper/workflow.ts +125 -0
- package/workflows/evidence-pack/.jshook-install.json +14 -0
- package/workflows/evidence-pack/LICENSE +21 -0
- package/workflows/evidence-pack/README.md +105 -0
- package/workflows/evidence-pack/docs/agent-recipes.md +44 -0
- package/workflows/evidence-pack/meta.yaml +6 -0
- package/workflows/evidence-pack/package.json +22 -0
- package/workflows/evidence-pack/tsconfig.json +15 -0
- package/workflows/evidence-pack/workflow.ts +154 -0
- package/workflows/js-bundle-search/.jshook-install.json +14 -0
- package/workflows/js-bundle-search/LICENSE +21 -0
- package/workflows/js-bundle-search/README.md +46 -0
- package/workflows/js-bundle-search/meta.yaml +4 -0
- package/workflows/js-bundle-search/package.json +23 -0
- package/workflows/js-bundle-search/tsconfig.json +16 -0
- package/workflows/js-bundle-search/workflow.ts +118 -0
- package/workflows/protocol-registry/.jshook-install.json +14 -0
- package/workflows/protocol-registry/meta.yaml +6 -0
- package/workflows/protocol-registry/package.json +22 -0
- package/workflows/protocol-registry/pnpm-lock.yaml +819 -0
- package/workflows/protocol-registry/tsconfig.json +15 -0
- package/workflows/protocol-registry/workflow.ts +107 -0
- package/workflows/qwen-mail-open-latest/meta.yaml +7 -0
- package/workflows/qwen-mail-open-latest/package.json +22 -0
- package/workflows/qwen-mail-open-latest/pnpm-lock.yaml +819 -0
- package/workflows/qwen-mail-open-latest/tsconfig.json +15 -0
- package/workflows/qwen-mail-open-latest/workflow.ts +77 -0
- package/workflows/register-account-flow/.jshook-install.json +14 -0
- package/workflows/register-account-flow/LICENSE +21 -0
- package/workflows/register-account-flow/README.md +64 -0
- package/workflows/register-account-flow/meta.yaml +4 -0
- package/workflows/register-account-flow/package.json +23 -0
- package/workflows/register-account-flow/tsconfig.json +16 -0
- package/workflows/register-account-flow/workflow.ts +127 -0
- package/workflows/replay-lab/.jshook-install.json +14 -0
- package/workflows/replay-lab/meta.yaml +6 -0
- package/workflows/replay-lab/package.json +22 -0
- package/workflows/replay-lab/pnpm-lock.yaml +819 -0
- package/workflows/replay-lab/tsconfig.json +15 -0
- package/workflows/replay-lab/workflow.ts +106 -0
- package/workflows/script-evidence-scan/.jshook-install.json +14 -0
- package/workflows/script-evidence-scan/LICENSE +21 -0
- package/workflows/script-evidence-scan/README.md +61 -0
- package/workflows/script-evidence-scan/meta.yaml +4 -0
- package/workflows/script-evidence-scan/package.json +23 -0
- package/workflows/script-evidence-scan/tsconfig.json +16 -0
- package/workflows/script-evidence-scan/workflow.ts +89 -0
- package/workflows/signature-hunter/.jshook-install.json +14 -0
- package/workflows/signature-hunter/LICENSE +21 -0
- package/workflows/signature-hunter/README.md +105 -0
- package/workflows/signature-hunter/docs/agent-recipes.md +44 -0
- package/workflows/signature-hunter/meta.yaml +6 -0
- package/workflows/signature-hunter/package.json +22 -0
- package/workflows/signature-hunter/tsconfig.json +15 -0
- package/workflows/signature-hunter/workflow.ts +170 -0
- package/workflows/signing-lineage/.jshook-install.json +14 -0
- package/workflows/signing-lineage/meta.yaml +6 -0
- package/workflows/signing-lineage/package.json +22 -0
- package/workflows/signing-lineage/pnpm-lock.yaml +819 -0
- package/workflows/signing-lineage/tsconfig.json +15 -0
- package/workflows/signing-lineage/workflow.ts +120 -0
- package/workflows/temp-mail-extract-link/.jshook-install.json +14 -0
- package/workflows/temp-mail-extract-link/LICENSE +21 -0
- package/workflows/temp-mail-extract-link/README.md +71 -0
- package/workflows/temp-mail-extract-link/meta.yaml +4 -0
- package/workflows/temp-mail-extract-link/package.json +23 -0
- package/workflows/temp-mail-extract-link/tsconfig.json +16 -0
- package/workflows/temp-mail-extract-link/workflow.ts +221 -0
- package/workflows/temp-mail-open-latest/.jshook-install.json +14 -0
- package/workflows/temp-mail-open-latest/LICENSE +21 -0
- package/workflows/temp-mail-open-latest/README.md +61 -0
- package/workflows/temp-mail-open-latest/meta.yaml +4 -0
- package/workflows/temp-mail-open-latest/package.json +23 -0
- package/workflows/temp-mail-open-latest/tsconfig.json +16 -0
- package/workflows/temp-mail-open-latest/workflow.ts +136 -0
- package/workflows/template/.jshook-install.json +14 -0
- package/workflows/template/LICENSE +21 -0
- package/workflows/template/README.md +45 -0
- package/workflows/template/docs/SKILL.md +111 -0
- package/workflows/template/meta.yaml +6 -0
- package/workflows/template/package.json +22 -0
- package/workflows/template/pnpm-lock.yaml +819 -0
- package/workflows/template/tsconfig.json +15 -0
- package/workflows/template/workflow.ts +73 -0
- package/workflows/web-api-capture-session/.jshook-install.json +14 -0
- package/workflows/web-api-capture-session/LICENSE +21 -0
- package/workflows/web-api-capture-session/README.md +64 -0
- package/workflows/web-api-capture-session/meta.yaml +4 -0
- package/workflows/web-api-capture-session/package.json +23 -0
- package/workflows/web-api-capture-session/tsconfig.json +16 -0
- package/workflows/web-api-capture-session/workflow.ts +124 -0
- package/workflows/ws-protocol-lifter/.jshook-install.json +14 -0
- package/workflows/ws-protocol-lifter/LICENSE +21 -0
- package/workflows/ws-protocol-lifter/README.md +105 -0
- package/workflows/ws-protocol-lifter/docs/agent-recipes.md +44 -0
- package/workflows/ws-protocol-lifter/meta.yaml +6 -0
- package/workflows/ws-protocol-lifter/package.json +22 -0
- package/workflows/ws-protocol-lifter/tsconfig.json +15 -0
- package/workflows/ws-protocol-lifter/workflow.ts +163 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"noEmit": false,
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"rootDir": ".",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["workflow.ts"],
|
|
14
|
+
"exclude": ["dist", "node_modules"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createWorkflow,
|
|
3
|
+
type WorkflowExecutionContext,
|
|
4
|
+
SequenceNodeBuilder,
|
|
5
|
+
} from '@jshookmcp/extension-sdk/workflow';
|
|
6
|
+
|
|
7
|
+
const workflowId = 'workflow.deobfuscation-pipeline.v1';
|
|
8
|
+
|
|
9
|
+
export default createWorkflow(workflowId, 'Deobfuscation Pipeline')
|
|
10
|
+
.description(
|
|
11
|
+
'End-to-end deobfuscation pipeline: collects scripts, detects obfuscation type (control flow flattening, string encoding, dead code, packer), runs webcrack unpacking, applies AST transforms (constant folding, dead code removal, control flow recovery), and produces cleaned source with diff report.',
|
|
12
|
+
)
|
|
13
|
+
.tags(['reverse', 'deobfuscation', 'ast', 'webcrack', 'transform', 'obfuscation', 'mission'])
|
|
14
|
+
.timeoutMs(15 * 60_000)
|
|
15
|
+
.defaultMaxConcurrency(3)
|
|
16
|
+
.buildGraph((ctx: WorkflowExecutionContext) => {
|
|
17
|
+
const prefix = 'workflows.deobfuscationPipeline';
|
|
18
|
+
const url = String(ctx.getConfig(`${prefix}.url`, 'https://example.com'));
|
|
19
|
+
const waitUntil = String(ctx.getConfig(`${prefix}.waitUntil`, 'networkidle0'));
|
|
20
|
+
const maxScripts = Number(ctx.getConfig(`${prefix}.maxScripts`, 30));
|
|
21
|
+
const runWebcrack = Boolean(ctx.getConfig(`${prefix}.runWebcrack`, true));
|
|
22
|
+
const runAstTransforms = Boolean(ctx.getConfig(`${prefix}.runAstTransforms`, true));
|
|
23
|
+
const maxConcurrency = Number(ctx.getConfig(`${prefix}.parallel.maxConcurrency`, 3));
|
|
24
|
+
|
|
25
|
+
const root = new SequenceNodeBuilder('deobfuscation-pipeline-root');
|
|
26
|
+
|
|
27
|
+
// Phase 1: Navigate
|
|
28
|
+
root
|
|
29
|
+
.tool('enable-network', 'network_enable', { input: { enableExceptions: true } })
|
|
30
|
+
.tool('navigate', 'page_navigate', { input: { url, waitUntil } })
|
|
31
|
+
|
|
32
|
+
// Phase 2: Collect Scripts
|
|
33
|
+
.tool('collect-scripts', 'collect_code', {
|
|
34
|
+
input: { includeInline: true, limit: maxScripts },
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// Phase 3: Parallel Detection
|
|
38
|
+
.parallel('detect-obfuscation', (p) => {
|
|
39
|
+
p.maxConcurrency(maxConcurrency)
|
|
40
|
+
.failFast(false)
|
|
41
|
+
.tool('detect-obfuscation', 'detect_obfuscation', { input: {} })
|
|
42
|
+
.tool('detect-crypto', 'detect_crypto', { input: {} })
|
|
43
|
+
.tool('search-packer-signatures', 'search_in_scripts', {
|
|
44
|
+
input: { query: 'eval,Function,atob,fromCharCode,charCodeAt,replace,split,reverse,join', matchType: 'any' },
|
|
45
|
+
});
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
// Phase 4: Source Map Recovery (may reveal original source)
|
|
49
|
+
.tool('recover-sourcemaps', 'source_map_extract', { input: {} });
|
|
50
|
+
|
|
51
|
+
// Phase 5: Webcrack Unpacking
|
|
52
|
+
if (runWebcrack) {
|
|
53
|
+
root.tool('webcrack-unpack', 'webcrack_unpack', { input: {} });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Phase 6: AST Transform Pipeline
|
|
57
|
+
if (runAstTransforms) {
|
|
58
|
+
root
|
|
59
|
+
.tool('ast-preview', 'ast_transform_preview', { input: {} })
|
|
60
|
+
.tool('ast-constant-fold', 'ast_transform_apply', {
|
|
61
|
+
input: { transform: 'constant_fold' },
|
|
62
|
+
})
|
|
63
|
+
.tool('ast-dead-code', 'ast_transform_apply', {
|
|
64
|
+
input: { transform: 'dead_code_remove' },
|
|
65
|
+
})
|
|
66
|
+
.tool('ast-control-flow', 'ast_transform_apply', {
|
|
67
|
+
input: { transform: 'control_flow_flatten' },
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Phase 7: Basic Deobfuscation
|
|
72
|
+
root.tool('deobfuscate', 'deobfuscate', { input: {} });
|
|
73
|
+
|
|
74
|
+
// Phase 8: Extract Function Tree from cleaned source
|
|
75
|
+
root.tool('extract-function-tree', 'extract_function_tree', {
|
|
76
|
+
input: { depth: 3 },
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Phase 9: Evidence Recording
|
|
80
|
+
root
|
|
81
|
+
.tool('create-evidence-session', 'instrumentation_session_create', {
|
|
82
|
+
input: {
|
|
83
|
+
name: `deobfuscation-${new Date().toISOString().slice(0, 10)}`,
|
|
84
|
+
metadata: { url, workflowId },
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
.tool('record-artifact', 'instrumentation_artifact_record', {
|
|
88
|
+
input: {
|
|
89
|
+
type: 'deobfuscation_result',
|
|
90
|
+
label: `Deobfuscation for ${url}`,
|
|
91
|
+
metadata: { url, runWebcrack, runAstTransforms },
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// Phase 10: Session Insight
|
|
96
|
+
.tool('emit-insight', 'append_session_insight', {
|
|
97
|
+
input: {
|
|
98
|
+
insight: JSON.stringify({
|
|
99
|
+
status: 'deobfuscation_pipeline_complete',
|
|
100
|
+
workflowId,
|
|
101
|
+
url,
|
|
102
|
+
runWebcrack,
|
|
103
|
+
runAstTransforms,
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
return root;
|
|
109
|
+
})
|
|
110
|
+
.onStart((ctx) => {
|
|
111
|
+
ctx.emitMetric('workflow_runs_total', 1, 'counter', { workflowId, mission: 'deobfuscation_pipeline', stage: 'start' });
|
|
112
|
+
})
|
|
113
|
+
.onFinish((ctx) => {
|
|
114
|
+
ctx.emitMetric('workflow_runs_total', 1, 'counter', { workflowId, mission: 'deobfuscation_pipeline', stage: 'finish' });
|
|
115
|
+
})
|
|
116
|
+
.onError((ctx, error) => {
|
|
117
|
+
ctx.emitMetric('workflow_errors_total', 1, 'counter', { workflowId, mission: 'deobfuscation_pipeline', stage: 'error', error: error.name });
|
|
118
|
+
})
|
|
119
|
+
.build();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"kind": "workflow",
|
|
4
|
+
"slug": "electron-bridge-mapper",
|
|
5
|
+
"id": "workflow.electron-bridge-mapper.v1",
|
|
6
|
+
"source": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"repo": "https://github.com/vmoranv/jshook_workflow_electron_bridge_mapper",
|
|
9
|
+
"ref": "main",
|
|
10
|
+
"commit": "0e2313f0e783f2341ca36dfd164ce7acce17cc32",
|
|
11
|
+
"subpath": ".",
|
|
12
|
+
"entry": "workflow.ts"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jshook-workflow-electron-bridge-mapper",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "jshookmcp workflow: electron-bridge-mapper",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"packageManager": "pnpm@10.28.2",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc -p tsconfig.json",
|
|
10
|
+
"check": "tsc -p tsconfig.json --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@jshookmcp/extension-sdk": "^0.3.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^25.3.0",
|
|
17
|
+
"typescript": "^5.9.3"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20.0.0"
|
|
21
|
+
}
|
|
22
|
+
}
|