icoa-cli 2.19.458 → 2.19.460

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.
Files changed (162) hide show
  1. package/dist/commands/ai4ctf.js +1 -1
  2. package/dist/commands/ctf4ai-demo.js +1 -1
  3. package/dist/commands/ctf4vla.js +1 -1
  4. package/dist/commands/exam.js +1 -1
  5. package/dist/commands/learn.js +1 -1
  6. package/dist/commands/ref.js +1 -1
  7. package/dist/lib/lazy-assets.js +1 -0
  8. package/dist/lib/py-syntax.js +1 -1
  9. package/package.json +1 -2
  10. package/dist/commands/ai4ctf.d.ts +0 -4
  11. package/dist/commands/ai4ioai.d.ts +0 -29
  12. package/dist/commands/aienv.d.ts +0 -23
  13. package/dist/commands/arena-eai.d.ts +0 -37
  14. package/dist/commands/arena.d.ts +0 -8
  15. package/dist/commands/board.d.ts +0 -2
  16. package/dist/commands/challenge.d.ts +0 -9
  17. package/dist/commands/comms.d.ts +0 -2
  18. package/dist/commands/connect.d.ts +0 -15
  19. package/dist/commands/ctf.d.ts +0 -3
  20. package/dist/commands/ctf4ai-demo.d.ts +0 -4
  21. package/dist/commands/ctf4vla.d.ts +0 -34
  22. package/dist/commands/demo2.d.ts +0 -31
  23. package/dist/commands/demo4.d.ts +0 -3
  24. package/dist/commands/demo5.d.ts +0 -3
  25. package/dist/commands/doctor.d.ts +0 -2
  26. package/dist/commands/env.d.ts +0 -5
  27. package/dist/commands/exam.d.ts +0 -13
  28. package/dist/commands/files.d.ts +0 -2
  29. package/dist/commands/ioailab.d.ts +0 -1
  30. package/dist/commands/ipynb.d.ts +0 -20
  31. package/dist/commands/kaggle.d.ts +0 -12
  32. package/dist/commands/lang.d.ts +0 -2
  33. package/dist/commands/learn.d.ts +0 -16
  34. package/dist/commands/log.d.ts +0 -2
  35. package/dist/commands/note.d.ts +0 -25
  36. package/dist/commands/ref.d.ts +0 -2
  37. package/dist/commands/setup.d.ts +0 -2
  38. package/dist/commands/shell.d.ts +0 -35
  39. package/dist/commands/sim.d.ts +0 -32
  40. package/dist/commands/sprint.d.ts +0 -7
  41. package/dist/commands/teleload.d.ts +0 -8
  42. package/dist/commands/theme.d.ts +0 -13
  43. package/dist/commands/view.d.ts +0 -2
  44. package/dist/index.d.ts +0 -2
  45. package/dist/lib/access.d.ts +0 -14
  46. package/dist/lib/aienv.d.ts +0 -118
  47. package/dist/lib/arena-edit-dynamics.d.ts +0 -55
  48. package/dist/lib/arena-submit.d.ts +0 -23
  49. package/dist/lib/banner.d.ts +0 -9
  50. package/dist/lib/bgtasks.d.ts +0 -21
  51. package/dist/lib/board-render.d.ts +0 -14
  52. package/dist/lib/budget.d.ts +0 -1
  53. package/dist/lib/card-engine.d.ts +0 -45
  54. package/dist/lib/challenge-dir.d.ts +0 -1
  55. package/dist/lib/colors.d.ts +0 -11
  56. package/dist/lib/commands.d.ts +0 -53
  57. package/dist/lib/comms.d.ts +0 -40
  58. package/dist/lib/config.d.ts +0 -8
  59. package/dist/lib/countdown.d.ts +0 -4
  60. package/dist/lib/country-lang.d.ts +0 -1
  61. package/dist/lib/ctfd-client.d.ts +0 -33
  62. package/dist/lib/deck-cooldown.d.ts +0 -7
  63. package/dist/lib/demo-exam.d.ts +0 -28
  64. package/dist/lib/demo-flags.d.ts +0 -8
  65. package/dist/lib/demo-stats.d.ts +0 -17
  66. package/dist/lib/docker-probe.d.ts +0 -45
  67. package/dist/lib/drafts.d.ts +0 -11
  68. package/dist/lib/editor-spawn.d.ts +0 -28
  69. package/dist/lib/exam-client.d.ts +0 -15
  70. package/dist/lib/exam-sandbox.d.ts +0 -15
  71. package/dist/lib/exam-setup.d.ts +0 -19
  72. package/dist/lib/exam-state.d.ts +0 -42
  73. package/dist/lib/gemini.d.ts +0 -16
  74. package/dist/lib/gpu.d.ts +0 -51
  75. package/dist/lib/http.d.ts +0 -35
  76. package/dist/lib/i18n.d.ts +0 -215
  77. package/dist/lib/input-dynamics.d.ts +0 -38
  78. package/dist/lib/integrity-snapshot.d.ts +0 -22
  79. package/dist/lib/interactive-spawn.d.ts +0 -25
  80. package/dist/lib/ipynb-input.d.ts +0 -25
  81. package/dist/lib/kaggle.d.ts +0 -115
  82. package/dist/lib/kernel-protocol.d.ts +0 -92
  83. package/dist/lib/kernel.d.ts +0 -81
  84. package/dist/lib/learn-ai.d.ts +0 -159
  85. package/dist/lib/learn-contest.d.ts +0 -141
  86. package/dist/lib/learn-curricula.d.ts +0 -274
  87. package/dist/lib/learn-i18n.d.ts +0 -8
  88. package/dist/lib/learn-input.d.ts +0 -40
  89. package/dist/lib/learn-outcome.d.ts +0 -1
  90. package/dist/lib/learn-render.d.ts +0 -107
  91. package/dist/lib/learn-replies.d.ts +0 -42
  92. package/dist/lib/learn-state.d.ts +0 -66
  93. package/dist/lib/log-sync.d.ts +0 -2
  94. package/dist/lib/logger.d.ts +0 -12
  95. package/dist/lib/main-rl.d.ts +0 -20
  96. package/dist/lib/md-term.d.ts +0 -17
  97. package/dist/lib/menu-nav.d.ts +0 -25
  98. package/dist/lib/notebook-doc.d.ts +0 -38
  99. package/dist/lib/open-file.d.ts +0 -35
  100. package/dist/lib/paper-upgrade.d.ts +0 -27
  101. package/dist/lib/platform.d.ts +0 -110
  102. package/dist/lib/py-syntax.d.ts +0 -36
  103. package/dist/lib/render-card.d.ts +0 -17
  104. package/dist/lib/repl-asker.d.ts +0 -7
  105. package/dist/lib/resume.d.ts +0 -7
  106. package/dist/lib/sample-runner.d.ts +0 -14
  107. package/dist/lib/sandbox.d.ts +0 -30
  108. package/dist/lib/secure-store.d.ts +0 -18
  109. package/dist/lib/shell-split.d.ts +0 -17
  110. package/dist/lib/sim-cooldown.d.ts +0 -14
  111. package/dist/lib/sprint-meta.d.ts +0 -72
  112. package/dist/lib/statusline.d.ts +0 -1
  113. package/dist/lib/terminal-cleanup.d.ts +0 -35
  114. package/dist/lib/theme.d.ts +0 -4
  115. package/dist/lib/token-format.d.ts +0 -41
  116. package/dist/lib/tool-man.d.ts +0 -11
  117. package/dist/lib/toolset-hash.d.ts +0 -15
  118. package/dist/lib/translation.d.ts +0 -1
  119. package/dist/lib/translations-fetcher.d.ts +0 -6
  120. package/dist/lib/ui.d.ts +0 -12
  121. package/dist/lib/update-check.d.ts +0 -1
  122. package/dist/lib/version.d.ts +0 -8
  123. package/dist/repl.d.ts +0 -4
  124. package/dist/types/index.d.ts +0 -221
  125. package/refs/ROPgadget.txt +0 -67
  126. package/refs/base64.txt +0 -63
  127. package/refs/bash.txt +0 -79
  128. package/refs/binwalk.txt +0 -43
  129. package/refs/bs4.txt +0 -61
  130. package/refs/checksec.txt +0 -57
  131. package/refs/curl.txt +0 -73
  132. package/refs/cyberchef.txt +0 -78
  133. package/refs/exiftool.txt +0 -50
  134. package/refs/ffuf.txt +0 -73
  135. package/refs/gcc.txt +0 -66
  136. package/refs/gdb.txt +0 -83
  137. package/refs/hashcat.txt +0 -64
  138. package/refs/hint.txt +0 -48
  139. package/refs/icoa.txt +0 -72
  140. package/refs/john.txt +0 -74
  141. package/refs/linux.txt +0 -58
  142. package/refs/nc.txt +0 -64
  143. package/refs/nmap.txt +0 -57
  144. package/refs/numpy.txt +0 -59
  145. package/refs/openssl.txt +0 -75
  146. package/refs/pillow.txt +0 -67
  147. package/refs/pwntools.txt +0 -79
  148. package/refs/pycrypto.txt +0 -77
  149. package/refs/python.txt +0 -103
  150. package/refs/r2.txt +0 -85
  151. package/refs/regex.txt +0 -73
  152. package/refs/requests.txt +0 -83
  153. package/refs/rules.txt +0 -28
  154. package/refs/scapy.txt +0 -80
  155. package/refs/sqlmap.txt +0 -69
  156. package/refs/steghide.txt +0 -71
  157. package/refs/struct.txt +0 -61
  158. package/refs/sympy.txt +0 -77
  159. package/refs/tshark.txt +0 -65
  160. package/refs/vim.txt +0 -74
  161. package/refs/volatility.txt +0 -41
  162. package/refs/z3.txt +0 -78
@@ -1,17 +0,0 @@
1
- /**
2
- * shellSplit — a minimal, quote-aware tokenizer for REPL commands that forward
3
- * raw args straight to a child process (currently `aienv run` / `aienv python`).
4
- *
5
- * The icoa REPL is NOT a shell: the default command split on /\s+/ turns quotes
6
- * into literal characters and tears spaced args apart, so `aienv run "my file.py"`
7
- * and `aienv python -c "print(1 + 1)"` reach python mangled. This honours
8
- * single/double quotes (and backslash escapes inside double quotes / outside
9
- * quotes) the way a real shell would tokenize them. (Direct-CLI invocation never
10
- * needs this — there the system shell does the tokenization for us.)
11
- *
12
- * Scope is deliberately small: word-splitting + quote removal + backslash
13
- * escapes. No globbing, no variable/`$()` expansion, no `~` expansion — the
14
- * child process / caller handles paths, and we explicitly do not want shell
15
- * metacharacter semantics in the REPL.
16
- */
17
- export declare function shellSplit(input: string): string[];
@@ -1,14 +0,0 @@
1
- export declare const COOLDOWN_SECONDS = 60;
2
- export declare function lastSimAt(): number;
3
- export declare function markSimAt(t: number): void;
4
- /** Seconds remaining (0 if clear). */
5
- export declare function cooldownRemaining(): number;
6
- export declare function lastBundledAt(): number;
7
- export declare function markBundledAt(t: number): void;
8
- export declare function lastArmAt(): number;
9
- export declare function markArmAt(t: number): void;
10
- /**
11
- * Has the user seen any sim render — bundled, server, or arm — at least once?
12
- * Used by demo2 + boot screen to switch from "first time" to "continue" copy.
13
- */
14
- export declare function hasAnySimHistory(): boolean;
@@ -1,72 +0,0 @@
1
- /** Media a task needs that its CSV three-pack does not carry. */
2
- export interface SprintMedia {
3
- /** what the files are — decides which library the guidance names */
4
- kind: 'audio' | 'image' | 'weights' | 'archive';
5
- /** teleload pack id (also the folder it unpacks into) */
6
- pack: string;
7
- /** unpacked size, MB — from the live teleload manifest at authoring time */
8
- mb: number;
9
- /** where the files sit inside the pack, for the "replace this cell" hint */
10
- glob?: string;
11
- }
12
- export interface SprintTaskMeta {
13
- seq: number;
14
- bullseye: string;
15
- title: string;
16
- platform: string;
17
- difficulty: number;
18
- data_mb: number;
19
- needs_gpu: boolean;
20
- cli_mode: string;
21
- dir?: string;
22
- topic_cn?: string;
23
- comp?: string | null;
24
- judged?: boolean;
25
- status?: string;
26
- /**
27
- * What `run all` prints on the shipped starter, measured by actually running
28
- * every notebook (not read off the code). `'none'` = it stops before scoring.
29
- * `'pack'` = the teleload pack ships its own baseline notebook.
30
- */
31
- baseline?: string;
32
- media?: SprintMedia;
33
- }
34
- /** Data files live next to the built JS (copied by the build), fall back to repo layout. */
35
- export declare function sprintDataPath(name: string): string;
36
- export declare function loadSprintTasks(): SprintTaskMeta[];
37
- /** Look a task up by the competition id the student types (`s01-sound-of-nature`). */
38
- export declare function sprintTaskForComp(comp: string | null | undefined): SprintTaskMeta | null;
39
- /**
40
- * The commands to type, in order. A media task is TWO steps and the media comes
41
- * first — pulling the CSVs first only to hit a wall in cell 3 is the dead end
42
- * this function exists to remove.
43
- */
44
- export declare function taskSteps(t: SprintTaskMeta): string[];
45
- /** One-line answer to "will `run all` give me a number?" */
46
- export declare function baselineChip(t: SprintTaskMeta, zh: boolean): string;
47
- /**
48
- * What a student can do RIGHT NOW.
49
- *
50
- * 🔴 The GPU half used to read "⚡ 需 GPU · 排晚场", which sent students to
51
- * `gpu on` — and that path is currently broken for sprint tasks: the box's data
52
- * tree is `/data/aiproblems/<platform>/<source-name>` while the notebook asks
53
- * for `/data/kaggle/<comp_id>`, so the kernel lands on a directory that does not
54
- * exist (and these comps carry no `data_base` fallback either). Meanwhile we
55
- * MEASURED every one of them producing a baseline on a laptop CPU. So the chip
56
- * says the true thing: heavy, GPU optional, starts here. Put "evening window"
57
- * back once the box-side hydration lands.
58
- */
59
- export declare function computeChip(t: SprintTaskMeta, zh: boolean): string;
60
- /**
61
- * The list's legend for the same three marks the cards use. It lives here, next
62
- * to `computeChip`, because the two were written apart and immediately drifted:
63
- * the card said "GPU optional, the baseline runs on your laptop" while the
64
- * legend two screens earlier still said "needs GPU — gpu key → gpu on".
65
- */
66
- export declare function computeLegend(zh: boolean): string;
67
- /**
68
- * The media block: what is missing, the command that fetches it, and the first
69
- * line of code that reads it. Used by the download guide AND baked into the
70
- * starter notebook's stop message, so the two can never disagree.
71
- */
72
- export declare function mediaHelpLines(t: SprintTaskMeta, zh: boolean): string[];
@@ -1 +0,0 @@
1
- export declare function buildStatusLine(width?: number): string | null;
@@ -1,35 +0,0 @@
1
- /**
2
- * When icoa-cli runs inside the ICOA Terminal (Tauri + xterm.js) the host is
3
- * already pre-themed to our exact palette, so theme.ts never sets OSC 10/11/12
4
- * and we must not reset them either — doing so would fight the host.
5
- */
6
- export declare function isIcoaTerminal(): boolean;
7
- export declare function supportsAnsi(): boolean;
8
- /**
9
- * Pure sequence builder — the whole point of splitting it out is that the exit
10
- * path is testable without a TTY. See test/terminal-cleanup.test.js.
11
- *
12
- * Note the two guards differ on purpose: the mode reset is gated on being a
13
- * TTY (bracketed paste is switched on for any TTY, colour support or not),
14
- * while the colour reset is gated on ANSI support so a `TERM=dumb` session
15
- * never gets escape bytes echoed at it.
16
- */
17
- export declare function buildCleanupSequence(opts: {
18
- ansi: boolean;
19
- icoaTerminal: boolean;
20
- }): string;
21
- /** Restore the terminal now. Idempotent, safe to call from any exit path. */
22
- export declare function cleanupTerminal(): void;
23
- /**
24
- * Register cleanup on every exit path. Idempotent: the first caller wins, so
25
- * both theme.ts (colour owner) and input-dynamics.ts (bracketed-paste owner)
26
- * can call it unconditionally without double-registering.
27
- *
28
- * Deliberately NOT called by the supervisor in index.ts — the supervisor must
29
- * survive Ctrl+C so the worker can own SIGINT (exam pause, inquirer cancel).
30
- * It calls cleanupTerminal() directly instead, right before it exits.
31
- *
32
- * Exit codes match the shell convention (128 + signal number) and preserve
33
- * what theme.ts shipped before this module existed.
34
- */
35
- export declare function armTerminalCleanup(): void;
@@ -1,4 +0,0 @@
1
- type ThemeVariant = 'dark' | 'high-contrast';
2
- export declare function setTerminalTheme(variant?: ThemeVariant): void;
3
- export declare function resetTerminalTheme(): void;
4
- export {};
@@ -1,41 +0,0 @@
1
- /**
2
- * Client mirror of panda/token_alphabet.py — the confusable-free token rule.
3
- *
4
- * Tokens are <2-char prefix> + <7 random Crockford chars> + <1 checksum char>.
5
- * Crockford Base32 excludes I, L, O, U (look like 1, 1, 0, V) so a token copied
6
- * off a PDF or dictated aloud can't be mistranscribed.
7
- *
8
- * Two helpers used at token entry:
9
- * - normalizeTokenBody(): fix look-alikes a human typed (O→0, I/L→1, U→V) in
10
- * the BODY only (prefix is a fixed track/country code, may contain I/O).
11
- * - validTokenChecksum(): verify the trailing Crockford checksum.
12
- *
13
- * IMPORTANT backward-compat note: tokens issued before 2026-06-07 used the full
14
- * 36-char alphabet and have NO valid checksum (and ~61% of learn tokens contain
15
- * a real I/L/O/U in the body). So on the LEARN path normalization must be a
16
- * FALLBACK (try literal first) and checksum must NEVER hard-block — the server
17
- * stays authoritative (BUG-001). Exam tokens have always been Crockford+checksum
18
- * so both helpers are safe to apply directly there.
19
- */
20
- export declare const CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
21
- export declare const PREFIX_LEN = 2;
22
- export declare const BODY_RANDOM_LEN = 7;
23
- export declare const TOKEN_LEN: number;
24
- /** Replace confusable letters in a string (uppercased first). */
25
- export declare function normalizeConfusables(s: string): string;
26
- /**
27
- * Normalize a token's BODY only — the 2-char prefix is a fixed track/country
28
- * code (e.g. EI / IO legitimately contain I/O) and must NOT be transformed.
29
- * Returns the trimmed, upper-cased token with body confusables canonicalized.
30
- */
31
- export declare function normalizeTokenBody(token: string): string;
32
- /** 1-char Crockford mod-32 checksum over the payload chars. */
33
- export declare function checksumChar(payload: string): string;
34
- /** True iff `body` is 7 Crockford chars + 1 correct checksum char. */
35
- export declare function validBody(body: string): boolean;
36
- /**
37
- * Whole-token checksum check for a 10-char `<prefix><body>` token. Returns
38
- * false for old (pre-checksum) tokens — only meaningful as a *soft* signal on
39
- * the learn path; authoritative only for exam tokens.
40
- */
41
- export declare function validTokenChecksum(token: string): boolean;
@@ -1,11 +0,0 @@
1
- export interface ToolDoc {
2
- name: string;
3
- aliases?: string[];
4
- cat: string;
5
- summary: string;
6
- /** [command, note] — real CTF invocations */
7
- ex: Array<[string, string]>;
8
- }
9
- export declare const TOOL_DOCS: ToolDoc[];
10
- /** Render `man <query>`: empty/"tools"/"list" → index; a tool → its sheet; else nearest hints. */
11
- export declare function renderToolMan(query: string): void;
@@ -1,15 +0,0 @@
1
- export interface ToolsetHashRecord {
2
- hash: string;
3
- platform: string;
4
- count: number;
5
- computedAt: string;
6
- }
7
- /** Compute the hash over (name=version) pairs, persist it, return the hash.
8
- * Called once at the end of `env setup` so the exam-start path only READS. */
9
- export declare function computeAndCacheToolsetHash(entries: Array<{
10
- name: string;
11
- version: string;
12
- }>): string;
13
- /** Read the cached env-fingerprint hash. Returns undefined if `env setup` has
14
- * not run (so the exam start path never blocks or spawns 30 version probes). */
15
- export declare function getCachedToolsetHash(): string | undefined;
@@ -1 +0,0 @@
1
- export declare function getTranslation(text: string, challengeId: number, targetLang: string): Promise<string>;
@@ -1,6 +0,0 @@
1
- export declare function getLangCacheDir(lang: string): string;
2
- export declare function isLangCached(lang: string): boolean;
3
- export interface EnsureLangCacheOptions {
4
- silent?: boolean;
5
- }
6
- export declare function ensureLangCache(lang: string, opts?: EnsureLangCacheOptions): Promise<boolean>;
package/dist/lib/ui.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export declare function printSuccess(msg: string): void;
2
- export declare function printError(msg: string): void;
3
- export declare function printWarning(msg: string): void;
4
- export declare function printInfo(msg: string): void;
5
- export declare function printTable(headers: string[], rows: string[][]): void;
6
- export declare function printMarkdown(text: string): void;
7
- export declare function printMarkdownYellow(text: string): void;
8
- export declare function setReplMode(enabled: boolean): void;
9
- export declare function createSpinner(text: string): any;
10
- export declare function formatCountdown(targetDate: Date): string;
11
- export declare function printHeader(title: string): void;
12
- export declare function printKeyValue(key: string, value: string): void;
@@ -1 +0,0 @@
1
- export declare function checkForUpdates(): void;
@@ -1,8 +0,0 @@
1
- /**
2
- * Returns the running CLI's package.json version, cached after first call.
3
- * Used by interaction events + log-sync payload so future forensic audits
4
- * can pinpoint which CLI version produced any given event. Added in
5
- * v2.19.185 in response to the Paper E dispatcher bug, where we couldn't
6
- * tell from the data which contestants ran pre-fix vs post-fix code.
7
- */
8
- export declare function getCliVersion(): string;
package/dist/repl.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function nearestCommand(word: string, max?: number): string | null;
3
- export declare function startRepl(program: Command, resumeMode: boolean): Promise<void>;
4
- export declare function mapCommand(input: string): string[];
@@ -1,221 +0,0 @@
1
- export interface CTFdChallenge {
2
- id: number;
3
- name: string;
4
- description: string;
5
- category: string;
6
- value: number;
7
- type: string;
8
- state: string;
9
- max_attempts: number;
10
- tags: string[];
11
- files: string[];
12
- hints: {
13
- id: number;
14
- cost: number;
15
- }[];
16
- solves: number;
17
- solved_by_me: boolean;
18
- connection_info?: string;
19
- }
20
- export interface CTFdChallengeListItem {
21
- id: number;
22
- name: string;
23
- category: string;
24
- value: number;
25
- type: string;
26
- solves: number;
27
- solved_by_me: boolean;
28
- tags: string[];
29
- }
30
- export interface CTFdUser {
31
- id: number;
32
- name: string;
33
- email: string;
34
- team_id: number | null;
35
- country: string | null;
36
- score: number;
37
- place: string | null;
38
- }
39
- export interface CTFdTeam {
40
- id: number;
41
- name: string;
42
- score: number;
43
- place: string | null;
44
- members: {
45
- id: number;
46
- name: string;
47
- }[];
48
- }
49
- export interface CTFdScoreboardEntry {
50
- pos: number;
51
- account_id: number;
52
- account_url: string;
53
- account_type: string;
54
- name: string;
55
- score: number;
56
- members?: {
57
- id: number;
58
- name: string;
59
- }[];
60
- }
61
- export interface CTFdAttemptResponse {
62
- success: boolean;
63
- data: {
64
- status: 'correct' | 'incorrect' | 'already_solved' | 'paused' | 'ratelimited';
65
- message: string;
66
- };
67
- }
68
- export interface CTFdApiResponse<T> {
69
- success: boolean;
70
- data: T;
71
- errors?: string[];
72
- }
73
- export interface IcoaConfig {
74
- ctfdUrl: string;
75
- token: string;
76
- language: string;
77
- sessionId: string;
78
- competitionCode: string;
79
- teamId: number | null;
80
- userId: number | null;
81
- userName: string;
82
- teamName: string;
83
- currentChallengeId: number | null;
84
- currentChallengeName: string;
85
- currentChallengeCategory: string;
86
- competitionState: CompetitionState;
87
- competitionStartsAt: string;
88
- competitionEndsAt: string;
89
- geminiApiKey: string;
90
- geminiModel: string;
91
- ai4ioaiEndpoint?: string;
92
- ai4ioaiApiKey?: string;
93
- ai4ioaiModel?: string;
94
- accessToken: string;
95
- deviceFingerprint: string;
96
- installSalt?: string;
97
- lastVersion: string;
98
- demoCleanedForVersion?: string;
99
- sessionCookie: string;
100
- joinedAt?: string;
101
- country: string;
102
- mode: IcoaMode | '';
103
- demoIntroSeen: boolean;
104
- themeVariant?: 'dark' | 'high-contrast';
105
- leaderToken?: string;
106
- leaderTeam?: string;
107
- bracketedPaste?: boolean;
108
- learnWidth?: LearnWidthMode;
109
- learnWide?: boolean;
110
- }
111
- export type LearnWidthMode = 'normal' | 'wide' | 'wider';
112
- export type CompetitionState = 'pre_competition' | 'demo' | 'live' | 'finished' | 'unknown';
113
- export type IcoaMode = 'instant' | 'learn' | 'selection' | 'olympiad' | 'organizer' | 'embodied';
114
- export type HintLevel = 'A' | 'B' | 'C';
115
- export interface HintBudget {
116
- a: number;
117
- b: number;
118
- c: number;
119
- tokensUsed: number;
120
- tokenCap: number;
121
- }
122
- export interface LogEntry {
123
- timestamp: string;
124
- level: 'A' | 'B' | 'C' | 'command' | 'submit';
125
- input: string;
126
- challengeId?: number;
127
- sessionId: string;
128
- _mac?: string;
129
- dyn?: InputDynamics;
130
- }
131
- export interface InputDynamics {
132
- ms: number;
133
- keys: number;
134
- backspaces: number;
135
- pastes: number;
136
- pasteChars: number;
137
- maxBurst: number;
138
- suspectPaste: boolean;
139
- }
140
- export interface ChallengeContext {
141
- name: string;
142
- category: string;
143
- description?: string;
144
- }
145
- export declare const DEFAULT_BUDGET: HintBudget;
146
- export declare const DEFAULT_CONFIG: IcoaConfig;
147
- export declare const SUPPORTED_LANGUAGES: readonly ["en", "zh", "ja", "ko", "es", "ar", "fr", "pt", "ru", "hi", "de", "id", "th", "vi", "tr", "uk", "ht", "sw", "uz", "lo"];
148
- export interface ExamListItem {
149
- id: string;
150
- name: string;
151
- country: string;
152
- questionCount: number;
153
- durationMinutes: number;
154
- status: 'available' | 'in_progress' | 'submitted';
155
- }
156
- export interface ExamQuestion {
157
- number: number;
158
- text: string;
159
- category?: string;
160
- options: {
161
- A: string;
162
- B: string;
163
- C: string;
164
- D: string;
165
- };
166
- answer?: 'A' | 'B' | 'C' | 'D';
167
- explanation?: string;
168
- sourceNumber?: number;
169
- sourceOrder?: ('A' | 'B' | 'C' | 'D')[];
170
- }
171
- export interface ExamSession {
172
- examId: string;
173
- examName: string;
174
- startedAt: string;
175
- confirmedAt?: string;
176
- durationMinutes: number;
177
- questionCount: number;
178
- totalScore?: number;
179
- passingScore?: number;
180
- country: string;
181
- token?: string;
182
- sessionNonce?: string;
183
- clockOffsetMs?: number;
184
- deadlineServerMs?: number;
185
- workspaceDir?: string;
186
- }
187
- export interface ExamInteraction {
188
- ts: string;
189
- q: number;
190
- type: 'prompt_attempt' | 'hint_used' | 'help_used' | 'ai_hint' | 'answer_submitted' | 'answer_changed';
191
- input?: string;
192
- result?: string;
193
- tokens?: number;
194
- }
195
- export interface ExamNote {
196
- ts: string;
197
- q?: number;
198
- text: string;
199
- }
200
- export interface ExamState {
201
- session: ExamSession;
202
- questions: ExamQuestion[];
203
- answers: Record<number, string>;
204
- interactions?: ExamInteraction[];
205
- aiUsage?: {
206
- ai4ctf: number;
207
- ctf4ai: number;
208
- };
209
- bookmarks?: number[];
210
- shownWarnings?: string[];
211
- notes?: ExamNote[];
212
- }
213
- export interface ExamResult {
214
- examId: string;
215
- examName: string;
216
- score: number;
217
- total: number;
218
- percentage: number;
219
- passed: boolean;
220
- submittedAt: string;
221
- }
@@ -1,67 +0,0 @@
1
- ROPgadget Quick Reference
2
- =========================
3
-
4
- BASIC USAGE
5
- ROPgadget --binary binary Find all gadgets
6
- ROPgadget --binary binary --depth 10 Deeper search
7
-
8
- FILTERING
9
- ROPgadget --binary binary --only "pop|ret" Only pop/ret
10
- ROPgadget --binary binary --only "mov|ret" Only mov/ret
11
- ROPgadget --binary binary --filter "leave" Exclude leave
12
-
13
- SEARCHING
14
- ROPgadget --binary binary --string "/bin/sh" Find string
15
- ROPgadget --binary binary --opcode "c3" Find by opcode
16
- ROPgadget --binary binary --re "pop .* ; ret" Regex search
17
-
18
- AUTO ROP CHAIN
19
- ROPgadget --binary binary --ropchain Auto-generate chain
20
-
21
- COMMON GADGETS TO FIND
22
- # x86-64 function call setup
23
- pop rdi ; ret # 1st argument
24
- pop rsi ; ret # 2nd argument
25
- pop rdx ; ret # 3rd argument
26
- pop rax ; ret # syscall number
27
- syscall ; ret # syscall
28
-
29
- # x86 (32-bit)
30
- pop eax ; ret
31
- pop ebx ; ret
32
- int 0x80 # syscall
33
-
34
- # Stack pivot
35
- xchg rax, rsp ; ret
36
- leave ; ret
37
-
38
- # Write-what-where
39
- mov [rdi], rax ; ret
40
- mov qword ptr [rsi], rdi ; ret
41
-
42
- ROPPER (alternative tool)
43
- ropper -f binary Find gadgets
44
- ropper -f binary --search "pop rdi" Search specific
45
- ropper -f binary --chain execve Auto chain
46
-
47
- PWNTOOLS ROP
48
- from pwn import *
49
- e = ELF("./binary")
50
- rop = ROP(e)
51
-
52
- rop.find_gadget(["pop rdi", "ret"])
53
- rop.find_gadget(["pop rsi", "pop r15", "ret"])
54
- rop.find_gadget(["ret"]) # ret gadget for alignment
55
-
56
- # Build chain
57
- rop.raw(ret_gadget) # Stack alignment
58
- rop.call("puts", [got_puts]) # Call puts(GOT[puts])
59
- rop.call("main") # Return to main
60
- chain = rop.chain()
61
-
62
- COMMON CTF ROP PATTERNS
63
- # ret2libc (x86-64)
64
- 1. Leak libc address (puts GOT via puts PLT)
65
- 2. Calculate libc base
66
- 3. Find system() and "/bin/sh" in libc
67
- 4. pop rdi; ret → "/bin/sh" → system()
package/refs/base64.txt DELETED
@@ -1,63 +0,0 @@
1
- Base64 & Encoding Quick Reference
2
- =================================
3
-
4
- BASE64
5
- Alphabet: A-Z a-z 0-9 + / (padding: =)
6
- Encodes 3 bytes → 4 characters
7
- Decodes 4 characters → 3 bytes
8
-
9
- # Command line
10
- echo -n "text" | base64 Encode
11
- echo "dGV4dA==" | base64 -d Decode (Linux)
12
- echo "dGV4dA==" | base64 -D Decode (macOS)
13
- base64 file > encoded.txt Encode file
14
- base64 -d encoded.txt > file Decode file
15
-
16
- # Python
17
- import base64
18
- base64.b64encode(b"text") → b"dGV4dA=="
19
- base64.b64decode(b"dGV4dA==") → b"text"
20
-
21
- # URL-safe Base64
22
- base64.urlsafe_b64encode(data) Uses - and _ instead of + and /
23
- base64.urlsafe_b64decode(data)
24
-
25
- BASE32
26
- Alphabet: A-Z 2-7 (padding: =)
27
- echo -n "text" | base32
28
- base64.b32encode(b"text")
29
- base64.b32decode(b"ORSXG5A=")
30
-
31
- HEX
32
- echo -n "text" | xxd -p Encode to hex
33
- echo "74657874" | xxd -r -p Decode from hex
34
- bytes.fromhex("74657874") Python decode
35
- b"text".hex() Python encode
36
-
37
- URL ENCODING
38
- # Python
39
- from urllib.parse import quote, unquote
40
- quote("hello world") → "hello%20world"
41
- unquote("hello%20world") → "hello world"
42
-
43
- ROT13
44
- echo "text" | tr 'a-zA-Z' 'n-za-mN-ZA-M'
45
- import codecs; codecs.decode("grkg", "rot_13")
46
-
47
- BINARY
48
- # Python
49
- bin(65) → "0b1000001"
50
- int("1000001", 2) → 65
51
- ''.join(format(b, '08b') for b in data) Bytes to binary
52
-
53
- ASCII TABLE (key values)
54
- 0x00 NULL 0x20 SPACE 0x30 '0'
55
- 0x09 TAB 0x41 'A' 0x61 'a'
56
- 0x0a LF (\n) 0x5a 'Z' 0x7a 'z'
57
- 0x0d CR (\r) 0x7e '~' 0x7f DEL
58
-
59
- CTF TIPS
60
- - Try "Magic" in CyberChef to auto-detect encoding
61
- - Flags often have multiple layers: Base64(Hex(XOR(flag)))
62
- - Look for patterns: "==" at end = base64, all hex chars = hex
63
- - base64 length is always multiple of 4