Add CTF Workspace and Artifact Analyzer (binary analysis, transforms, detectors)#17
Add CTF Workspace and Artifact Analyzer (binary analysis, transforms, detectors)#17T3pp31 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9527f5b371
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| pub network: NetworkConfig, | ||
| pub feature_flags: FeatureFlagsConfig, | ||
| pub paths: PathsConfig, | ||
| pub binary_analysis: BinaryAnalysisConfig, |
There was a problem hiding this comment.
Make new config section optional
When an installed app is upgraded with an existing config/default.toml that lacks the new [binary_analysis] table, this required field makes toml::from_str fail with a missing-field error; run() then falls back to AppConfig::default(), silently discarding all user-tuned scan/vendor/path settings. Add a serde default for this field (and the nested struct) or merge defaults so older config files keep loading.
Useful? React with 👍 / 👎.
|
確認しましたが、この PR は現状マージしません。 理由:
対応案:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e3774edaf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let decoded_slice = &data[..data.len().min(config.decoded_text_preview_bytes)]; | ||
| let decoded_text = String::from_utf8_lossy(decoded_slice).to_string(); | ||
| let magic_bytes = format_magic_bytes(&data); | ||
| let file_type_guess = guess_file_type(&data); |
There was a problem hiding this comment.
Hash the full artifact before truncating analysis input
When a selected file exceeds max_read_bytes, data contains only the prefix read through Take, but this line still reports that digest in the UI as SHA256 for the file. Large challenge artifacts will therefore show a hash that does not match the actual file even though file_size is the full size; either compute the digest from the full stream or clearly label it as a truncated-prefix hash.
Useful? React with 👍 / 👎.
|
|
||
| const makeResult = (label: string, output: string, note?: string): CtfTransformResult => ({ | ||
| label, | ||
| output: toPreview(output), |
There was a problem hiding this comment.
Preserve full transform output separately from previews
For any transform result longer than 4000 characters, this stores the truncated preview string as the actual output. Chaining the result back into the input, collecting flags from operation outputs, and exporting the writeup will all use the shortened text with the ...省略 marker, so multi-step decoding of larger blobs silently corrupts the workspace state; keep the full output and truncate only at render/preview boundaries.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94b7ea66e8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| pub max_read_bytes: usize, | ||
| pub hex_preview_bytes: usize, | ||
| pub decoded_text_preview_bytes: usize, | ||
| pub max_strings: usize, | ||
| pub min_string_length: usize, |
There was a problem hiding this comment.
Default missing binary analysis fields
The current code defaults the binary_analysis table itself, but these nested fields are still required once the table is present. If a user adds only one documented override such as [binary_analysis] max_read_bytes = ..., toml::from_str fails on the other missing keys and run() falls back to AppConfig::default(), discarding the rest of the user's scan/vendor/path settings; add per-field serde defaults or deserialize this section by merging with BinaryAnalysisConfig::default().
Useful? React with 👍 / 👎.
Motivation
Description
binary_analysis, dependencysha2, updatedsrc-tauriconfig andCargo.toml/Cargo.lock, andread_binary_fileTauri command now takesAppStateand passes analysis config toutils::binary::read_file.src-tauri/src/utils/binary.rsto stream-read up tomax_read_bytes, produce hex preview, decoded text preview, magic bytes, file type guess, SHA256, printable strings, flag candidate extraction, entropy calculation and warnings.src/features/ctfwith types, transforms (CTF_TRANSFORMS), detectors, flag patterns, operation history helpers and writeup Markdown generator, and wire new UI pages/components (CtfPage, enhancedBinaryPage, updatedHomePageandSidebar) to expose the workbench workflow.src/typesfor the richerBinaryContentshape and add unit tests that exercise detectors, transforms and writeup generation, plus adjust an existing Tauri invoke test to the new binary response shape.Testing
vitestunit test suite which includes the newtests/ctfWorkbench.test.tsand adjustedtests/tauriInvokeArgs.test.tsx, and all tests passed.npx vite/TypeScript compile) with no reported type errors.Codex Task