From 333ea39c56144a3063842432956a0c1e1a5dfc46 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Thu, 4 Dec 2025 14:00:26 +0000 Subject: [PATCH] Implement submit_flags task functionality and enhance game mechanics - Added support for submit_flags tasks in GamesController, allowing players to submit flags for validation and task completion. - Updated game state management to track submitted flags and validate against required flags for task completion. - Enhanced ObjectivesManager to handle flag submissions, including syncing progress with the server and managing task states. - Introduced a new locksmith NPC for lockpicking tutorials, expanding gameplay elements and player engagement. - Updated scenario schema to include submit_flags task type and associated properties, ensuring proper integration into the game mechanics. - Improved logging and debugging information for flag submissions and task progress updates, enhancing visibility into game state changes. --- .../break_escape/games_controller.rb | 54 +- app/models/break_escape/game.rb | 40 +- docs/INK_BEST_PRACTICES.md | 50 +- .../assets/objects/lab-workstation.png | Bin 0 -> 351 bytes .../assets/objects/workstation.png | Bin 488 -> 388 bytes public/break_escape/js/core/game.js | 1 + public/break_escape/js/core/rooms.js | 59 ++- .../flag-station/flag-station-minigame.js | 19 + .../js/systems/objectives-manager.js | 206 +++++++- public/break_escape/js/ui/objectives-panel.js | 2 +- scenarios/lab_intro_linux/ink/instructor.ink | 482 ++++++++++-------- scenarios/lab_intro_linux/ink/instructor.json | 2 +- scenarios/lab_intro_linux/ink/locksmith.ink | 112 ++++ scenarios/lab_intro_linux/ink/locksmith.json | 1 + scenarios/lab_intro_linux/scenario.json.erb | 275 ++++++++-- scripts/scenario-schema.json | 10 +- 16 files changed, 1039 insertions(+), 274 deletions(-) create mode 100644 public/break_escape/assets/objects/lab-workstation.png create mode 100644 scenarios/lab_intro_linux/ink/locksmith.ink create mode 100644 scenarios/lab_intro_linux/ink/locksmith.json diff --git a/app/controllers/break_escape/games_controller.rb b/app/controllers/break_escape/games_controller.rb index 88c97a1..bb31d2b 100644 --- a/app/controllers/break_escape/games_controller.rb +++ b/app/controllers/break_escape/games_controller.rb @@ -435,7 +435,13 @@ module BreakEscape return render json: { success: false, error: 'Missing task_id' }, status: :bad_request end - result = @game.complete_task!(task_id, params[:validation_data]) + # For submit_flags tasks, accept submittedFlags from request body for validation + validation_data = params[:validation_data] || {} + if params[:submittedFlags].present? + validation_data[:submittedFlags] = params[:submittedFlags] + end + + result = @game.complete_task!(task_id, validation_data) if result[:success] Rails.logger.info "[BreakEscape] Task completed: #{task_id}" @@ -447,20 +453,21 @@ module BreakEscape end # PUT /games/:id/objectives/tasks/:task_id - # Update task progress (for collect_items tasks) + # Update task progress (for collect_items and submit_flags tasks) def update_task_progress authorize @game if defined?(Pundit) task_id = params[:task_id] progress = params[:progress].to_i + submitted_flags = params[:submittedFlags] unless task_id.present? return render json: { success: false, error: 'Missing task_id' }, status: :bad_request end - result = @game.update_task_progress!(task_id, progress) + result = @game.update_task_progress!(task_id, progress, submitted_flags) - Rails.logger.debug "[BreakEscape] Task progress updated: #{task_id} = #{progress}" + Rails.logger.debug "[BreakEscape] Task progress updated: #{task_id} = #{progress}, submittedFlags: #{submitted_flags&.length || 0}" render json: result end @@ -482,18 +489,25 @@ module BreakEscape result = @game.submit_flag(flag_key) if result[:success] + # Find flag-station and generate flag identifier + flag_station = find_flag_station_for_flag(flag_key) + flag_id = generate_flag_identifier(flag_key, flag_station) + vm_id = flag_station&.dig('acceptsVms', 0) + # Find rewards for this flag in scenario rewards = find_flag_rewards(flag_key) # Process rewards reward_results = process_flag_rewards(flag_key, rewards) - Rails.logger.info "[BreakEscape] Flag submitted: #{flag_key}, rewards: #{reward_results.length}" + Rails.logger.info "[BreakEscape] Flag submitted: #{flag_key}, flagId: #{flag_id}, rewards: #{reward_results.length}" render json: { success: true, message: result[:message], flag: flag_key, + flagId: flag_id, + vmId: vm_id, rewards: reward_results } else @@ -1073,5 +1087,35 @@ module BreakEscape end nil end + + # Find the flag-station that contains the submitted flag + def find_flag_station_for_flag(flag_key) + @game.scenario_data['rooms']&.each do |_room_id, room| + room['objects']&.each do |obj| + next unless obj['type'] == 'flag-station' + next unless obj['flags']&.any? { |f| f.downcase == flag_key.downcase } + + return obj + end + end + nil + end + + # Generate a flag identifier in the format: {vmId}-flag{index} + # Example: "desktop-flag1", "kali-flag2" + def generate_flag_identifier(flag_key, flag_station) + return nil unless flag_station + + # Find flag index in flags array (0-based) + flag_index = flag_station['flags']&.find_index { |f| f.downcase == flag_key.downcase } + return nil unless flag_index + + # Get VM ID (use first VM if multiple) + vm_id = flag_station['acceptsVms']&.first + return nil unless vm_id + + # Generate identifier: "desktop-flag1" (1-indexed for display) + "#{vm_id}-flag#{flag_index + 1}" + end end end diff --git a/app/models/break_escape/game.rb b/app/models/break_escape/game.rb index e5fac11..91658d9 100644 --- a/app/models/break_escape/game.rb +++ b/app/models/break_escape/game.rb @@ -403,6 +403,10 @@ module BreakEscape when 'enter_room' # Room entry is validated by the client having discovered the room # Trust the client for this low-stakes validation + when 'submit_flags' + unless validate_flag_submission(task, validation_data[:submittedFlags]) + return { success: false, error: 'Not all required flags submitted' } + end when 'custom' # Custom tasks are completed via ink tags - no validation needed end @@ -426,12 +430,18 @@ module BreakEscape { success: true, taskId: task_id } end - # Update task progress (for collect_items tasks) - def update_task_progress!(task_id, progress) + # Update task progress (for collect_items and submit_flags tasks) + def update_task_progress!(task_id, progress, submitted_flags = nil) initialize_objectives player_state['objectivesState']['tasks'][task_id] ||= {} player_state['objectivesState']['tasks'][task_id]['progress'] = progress + + # Store submittedFlags for submit_flags tasks + if submitted_flags.is_a?(Array) + player_state['objectivesState']['tasks'][task_id]['submittedFlags'] = submitted_flags + end + save! { success: true, taskId: task_id, progress: progress } @@ -480,6 +490,32 @@ module BreakEscape count >= (task['targetCount'] || 1) end + # Validate submit_flags tasks + # Checks that all targetFlags have been submitted + # If submittedFlags are provided in validation_data, use those (latest from client) + # Otherwise, use stored state from player_state + def validate_flag_submission(task, submitted_flags_from_request = nil) + return false unless task['targetFlags'].is_a?(Array) + + task_id = task['taskId'] + + # Use submittedFlags from request if provided (latest data), otherwise use stored state + if submitted_flags_from_request.present? + submitted = Array(submitted_flags_from_request) + Rails.logger.debug "[BreakEscape] Validating flags using request data: #{submitted.inspect}" + else + submitted = player_state.dig('objectivesState', 'tasks', task_id, 'submittedFlags') || [] + Rails.logger.debug "[BreakEscape] Validating flags using stored state: #{submitted.inspect}" + end + + # Check that all targetFlags are in submittedFlags + all_submitted = task['targetFlags'].all? { |target_flag| submitted.include?(target_flag) } + + Rails.logger.debug "[BreakEscape] Flag validation: targetFlags=#{task['targetFlags'].inspect}, submitted=#{submitted.inspect}, result=#{all_submitted}" + + all_submitted + end + # Check if NPC was encountered def npc_encountered?(npc_id) player_state['encounteredNPCs']&.include?(npc_id) diff --git a/docs/INK_BEST_PRACTICES.md b/docs/INK_BEST_PRACTICES.md index 26aea5b..490a567 100644 --- a/docs/INK_BEST_PRACTICES.md +++ b/docs/INK_BEST_PRACTICES.md @@ -818,13 +818,61 @@ See `docs/NPC_INFLUENCE.md` for complete documentation. --- +## Common Syntax Errors to Avoid + +### Do NOT Use Markdown-Style Bold (`**text**`) + +**Ink does NOT support markdown-style bold formatting.** Using `**text**` will cause the asterisks to appear literally in the output, which looks unprofessional. + +❌ **WRONG:** +```ink +Here's a **Lab Sheet Workstation** in this room. +``` + +✅ **RIGHT:** +```ink +Here's a Lab Sheet Workstation in this room. +``` + +If you need emphasis, use capitalization, quotes, or descriptive language instead of markdown formatting. + +### Do NOT Start Lines with `*` (Except for Choices) + +**Lines cannot start with `*` in Ink**, except when it's part of a valid choice syntax (`* [choice text]` or `+ [choice text]`). + +❌ **WRONG:** +```ink +**Navigation in normal mode:** +- "h" "j" "k" "l" move cursor +``` + +✅ **RIGHT:** +```ink +Navigation in normal mode: +- "h" "j" "k" "l" move cursor +``` + +If you need section headers, use plain text without asterisks. + +### Do NOT Ignore "Apparent Loose End" Warnings + +**"Apparent loose end" warnings from the Ink compiler are likely syntax errors** and should be investigated, not ignored. These warnings typically indicate: + +- Missing knot definitions (referenced but not defined) +- Incorrect choice syntax +- Unclosed conditionals or loops +- Invalid divert targets +- Markdown formatting such as ** at the start of a line. + +Always fix these warnings before considering your Ink story complete. They can cause runtime errors or unexpected behavior in the game. + ## Common Questions **Q: Should I use `-> END` or hub loop?** A: Use hub loop for all NPCs, and include in that loop at least one exit option that is always available. **Q: How do I show different dialogue on repeat conversations?** -A: Use Ink conditionals with variables like `{conversation_count > 1:` or `{favour >= 5:` +A: Use Ink conditionals with variables like `{conversation_count > 1:` or `{influence >= 5:` **Q: Can I have both choices and auto-advance?** A: Yes! After showing choices, the hub is reached. Use `-> hub` to loop. diff --git a/public/break_escape/assets/objects/lab-workstation.png b/public/break_escape/assets/objects/lab-workstation.png new file mode 100644 index 0000000000000000000000000000000000000000..aef477c2d35f3b481614dcd786bf90e5ba1f1586 GIT binary patch literal 351 zcmV-l0igbgP)Px$8A(JzR5*=eWIzMzO2+@u#Yh1+@112t=Chz1uCAp=iTMmHENuU;-Z~Dqgaw|Jp%&+!`|(i7*3ws!^jAW*q=Xs;0yx! xqNQ;5x8MKZ>`${(@#=eU?-m0ir4){k3s_j#Q2210wAC#CGcYhPn3`LYZ0NUdU*YVlmoGqQ zXnBO<1OL!S26Z)M6wNnp-G#IDb#)jR7#J8XUcLesLsze&p~S1n80pyl_wWy8 z`2FiQiegqaR#gTD1_p++Cy!%wxt^g3R`m=F3=Dg>Z(=xkZVw|PEMkBD_<=JBPJ;(eR}eSk76$XV90Gm`a+|C7B~Qy>;o`S^KO`W@2S*VD$OI8 zr=GX%qE_JhtA9ql$5xC;Ugk0EvEYl-C=d$x+vyUPj?^J9G5R?nz_JEp_@rhy704Qh zwfttx+Sfz?SYBQ47+NY7<#{50Qy>4{BjN^L-!>ff2_iVfXXN?(oD%?W8^4qHl>WA< zX&fHxlQ&p!Ziri6AB2iPIO`3106>%rQ!{tDm#F>#a5{c`1TJ>QFwztKT`spQ!DwJl ro|lA1XT1k^+Q#LwJeY2OFlzP-7+{9^GZ`;Y00000NkvXXu0mjf?s(Of diff --git a/public/break_escape/js/core/game.js b/public/break_escape/js/core/game.js index 53d7357..af1fd13 100644 --- a/public/break_escape/js/core/game.js +++ b/public/break_escape/js/core/game.js @@ -81,6 +81,7 @@ export function preload() { this.load.image('safe', 'objects/safe1.png'); this.load.image('book', 'objects/book1.png'); this.load.image('workstation', 'objects/workstation.png'); + this.load.image('lab-workstation', 'objects/lab-workstation.png'); this.load.image('bluetooth_scanner', 'objects/bluetooth_scanner.png'); this.load.image('bluetooth', 'objects/bluetooth.png'); this.load.image('tablet', 'objects/tablet.png'); diff --git a/public/break_escape/js/core/rooms.js b/public/break_escape/js/core/rooms.js index fab1d78..64ee4f5 100644 --- a/public/break_escape/js/core/rooms.js +++ b/public/break_escape/js/core/rooms.js @@ -491,7 +491,8 @@ function createSpriteFromMatch(tiledItem, scenarioObj, position, roomId, index, * Ensures position doesn't overlap with existing items * Items are placed within room GU boundaries with proper padding: * - 1 tile (32px) from left and right sides - * - 2 tiles (64px) from top and bottom + * - 2 tiles (64px) from top + * - 2 tiles (64px) + 16px from bottom, plus sprite height to prevent overlap with southern room walls */ function createSpriteAtRandomPosition(scenarioObj, position, roomId, index, map) { // Get actual room dimensions from the tilemap @@ -517,11 +518,58 @@ function createSpriteAtRandomPosition(scenarioObj, position, roomId, index, map) } } + // Get sprite texture dimensions to calculate proper placement + let spriteHeight = TILE_SIZE; // fallback to 1 tile if texture not found + const textureKey = scenarioObj.type; + + if (gameRef && gameRef.textures && gameRef.textures.exists(textureKey)) { + const texture = gameRef.textures.get(textureKey); + if (texture) { + // Try to get frame dimensions - Phaser 3 textures have frames + if (texture.frames && Object.keys(texture.frames).length > 0) { + // Get the first frame (usually '__BASE' or the texture key) + const frameName = texture.frameNames ? texture.frameNames[0] : Object.keys(texture.frames)[0]; + const frame = texture.frames[frameName]; + if (frame && frame.height) { + spriteHeight = frame.height; + } + } + // Fallback: try to get from source directly + if (spriteHeight === TILE_SIZE && texture.source && texture.source.length > 0) { + if (texture.source[0].height) { + spriteHeight = texture.source[0].height; + } + } + } + } + + // Final fallback: create temporary sprite (not added to scene) to get actual dimensions + if (spriteHeight === TILE_SIZE && gameRef && gameRef.make) { + try { + const tempSprite = gameRef.make.sprite({ key: textureKey, add: false }); + if (tempSprite && tempSprite.height) { + spriteHeight = tempSprite.height; + } + } catch (e) { + // If sprite creation fails, use fallback + console.warn(`Could not determine sprite height for ${textureKey}, using fallback ${TILE_SIZE}px`); + } + } + // Apply proper padding based on requirements: // - 1 tile (32px) from left and right sides - // - 2 tiles (64px) from top and bottom + // - 2 tiles (64px) from top + // - 2 tiles (64px) + 16px from bottom, plus sprite height to ensure bottom edge doesn't extend too far const paddingX = TILE_SIZE * 1; // 32px from sides - const paddingY = TILE_SIZE * 2; // 64px from top/bottom + const paddingYTop = TILE_SIZE * 2; // 64px from top + const paddingYBottom = TILE_SIZE * 2 + 16; // 64px + 16px from bottom + + // Calculate maximum Y position: room bottom - bottom padding - sprite height + // This ensures the sprite's bottom edge is at least paddingYBottom from the room bottom + const roomBottom = position.y + roomHeight; + const maxY = roomBottom - paddingYBottom - spriteHeight; + const minY = position.y + paddingYTop; + const availableHeight = maxY - minY; // Find a valid position that doesn't overlap with existing items let randomX, randomY; @@ -530,13 +578,14 @@ function createSpriteAtRandomPosition(scenarioObj, position, roomId, index, map) do { randomX = position.x + paddingX + Math.random() * (roomWidth - paddingX * 2); - randomY = position.y + paddingY + Math.random() * (roomHeight - paddingY * 2); + // Only place within the valid Y range that accounts for sprite height + randomY = minY + (availableHeight > 0 ? Math.random() * availableHeight : 0); attempts++; } while (attempts < maxAttempts && isPositionOverlapping(randomX, randomY, roomId, TILE_SIZE)); const sprite = gameRef.add.sprite(Math.round(randomX), Math.round(randomY), scenarioObj.type); - console.log(`Created ${scenarioObj.type} at random position - no matching item found (attempts: ${attempts})`); + console.log(`Created ${scenarioObj.type} at random position (sprite height: ${spriteHeight}px) - no matching item found (attempts: ${attempts})`); // Apply properties sprite.setOrigin(0, 0); diff --git a/public/break_escape/js/minigames/flag-station/flag-station-minigame.js b/public/break_escape/js/minigames/flag-station/flag-station-minigame.js index 4c0452b..ae8336f 100644 --- a/public/break_escape/js/minigames/flag-station/flag-station-minigame.js +++ b/public/break_escape/js/minigames/flag-station/flag-station-minigame.js @@ -377,6 +377,25 @@ export class FlagStationMinigame extends MinigameScene { window.gameState.submittedFlags = this.submittedFlags; } + // Emit generic flag_submitted event with identifier for objectives tracking + if (data.flagId) { + const eventData = { + flagKey: flagValue, + flagId: data.flagId, // e.g., "desktop-flag1" + vmId: data.vmId, // e.g., "desktop" + stationId: this.stationId + }; + + if (window.eventDispatcher) { + window.eventDispatcher.emit('flag_submitted', eventData); + console.log('[FlagStation] Emitted flag_submitted event:', data.flagId, eventData); + } else { + console.warn('[FlagStation] eventDispatcher not available, cannot emit flag_submitted event'); + } + } else { + console.warn('[FlagStation] No flagId in response, cannot track flag submission:', data); + } + // Show rewards if any if (data.rewards && data.rewards.length > 0) { this.showRewards(rewardEl, data.rewards); diff --git a/public/break_escape/js/systems/objectives-manager.js b/public/break_escape/js/systems/objectives-manager.js index 07cf761..b21529c 100644 --- a/public/break_escape/js/systems/objectives-manager.js +++ b/public/break_escape/js/systems/objectives-manager.js @@ -39,7 +39,26 @@ export class ObjectivesManager { this.aimIndex[aim.aimId] = aim; aim.tasks.forEach(task => { task.aimId = aim.aimId; + // Ensure task has a status, default to 'active' if not specified + if (!task.status) { + task.status = 'active'; + } task.originalStatus = task.status; // Store for reset + + // Initialize submit_flags task properties + if (task.type === 'submit_flags') { + if (!task.submittedFlags) { + task.submittedFlags = []; + } + if (task.targetCount === undefined && task.targetFlags) { + task.targetCount = task.targetFlags.length; + } + if (task.currentCount === undefined) { + task.currentCount = 0; + } + console.log(`📋 Initialized submit_flags task ${task.taskId}: status=${task.status}, targetFlags=${task.targetFlags?.join(', ') || 'none'}, targetCount=${task.targetCount}`); + } + this.taskIndex[task.taskId] = task; }); }); @@ -76,9 +95,37 @@ export class ObjectivesManager { // Restore task statuses and progress Object.entries(savedState.tasks || {}).forEach(([taskId, state]) => { if (this.taskIndex[taskId]) { - this.taskIndex[taskId].status = state.status; + // Only restore status if it exists in saved state, otherwise keep original + if (state.status) { + this.taskIndex[taskId].status = state.status; + } this.taskIndex[taskId].currentCount = state.progress || 0; this.taskIndex[taskId].completedAt = state.completedAt; + // Restore submittedFlags for submit_flags tasks + if (state.submittedFlags) { + this.taskIndex[taskId].submittedFlags = state.submittedFlags; + // Update currentCount based on submittedFlags length for submit_flags tasks + if (this.taskIndex[taskId].type === 'submit_flags') { + this.taskIndex[taskId].currentCount = state.submittedFlags.length; + } + } + } + }); + + // Ensure all tasks have a valid status (use originalStatus if status is undefined) + Object.values(this.taskIndex).forEach(task => { + if (!task.status) { + task.status = task.originalStatus || 'active'; + console.log(`📋 Restored task ${task.taskId} status to ${task.status} (was undefined)`); + } + // Also ensure submit_flags tasks have proper initialization + if (task.type === 'submit_flags') { + if (!task.submittedFlags) { + task.submittedFlags = []; + } + if (task.targetCount === undefined && task.targetFlags) { + task.targetCount = task.targetFlags.length; + } } }); @@ -188,6 +235,11 @@ export class ObjectivesManager { this.completeTask(data.taskId); }); + // Flag submission - for submit_flags task type + this.eventDispatcher.on('flag_submitted', (data) => { + this.handleFlagSubmission(data); + }); + console.log('📋 ObjectivesManager event listeners registered'); } @@ -221,6 +273,88 @@ export class ObjectivesManager { }); } + /** + * Handle flag submission - check submit_flags tasks + * @param {Object} data - Event data containing flagId, flagKey, vmId, stationId + */ + handleFlagSubmission(data) { + if (!this.initialized) { + console.warn('📋 ObjectivesManager not initialized, cannot handle flag submission'); + return; + } + + const flagId = data.flagId; // e.g., "desktop-flag1" + if (!flagId) { + console.warn('📋 Flag submission received without flagId:', data); + return; + } + + console.log(`📋 Handling flag submission: ${flagId}`, data); + + // Find all active submit_flags tasks that target this flag + let foundTask = false; + Object.values(this.taskIndex).forEach(task => { + if (task.type !== 'submit_flags') return; + + // Ensure task has a valid status + if (!task.status) { + task.status = task.originalStatus || 'active'; + console.log(`📋 Task ${task.taskId} had undefined status, restored to ${task.status}`); + } + + if (task.status !== 'active') { + console.log(`📋 Task ${task.taskId} is not active (status: ${task.status}), skipping`); + return; + } + if (!task.targetFlags || !task.targetFlags.includes(flagId)) { + console.log(`📋 Task ${task.taskId} does not target flag ${flagId} (targets: ${task.targetFlags?.join(', ') || 'none'})`); + return; + } + + foundTask = true; + + // Initialize submittedFlags array if needed + if (!task.submittedFlags) { + task.submittedFlags = []; + } + + // Skip if already submitted + if (task.submittedFlags.includes(flagId)) { + console.log(`📋 Flag ${flagId} already tracked for task ${task.taskId}`); + return; + } + + // Add to submitted flags + task.submittedFlags.push(flagId); + + // Update currentCount + task.currentCount = task.submittedFlags.length; + + console.log(`📋 Flag task progress: ${task.title} (${task.currentCount}/${task.targetCount}), submittedFlags:`, task.submittedFlags); + + // Check completion + if (task.currentCount >= task.targetCount) { + console.log(`📋 All flags submitted! Completing task ${task.taskId}`); + // Sync progress immediately before completion to ensure server has latest submittedFlags + this.syncFlagTaskProgressImmediate(task.taskId, task.currentCount, task.submittedFlags).then(() => { + this.completeTask(task.taskId); + }).catch(err => { + console.warn('Failed to sync flags before completion, attempting completion anyway:', err); + this.completeTask(task.taskId); + }); + } else { + // Sync progress to server (including submittedFlags) + console.log(`📋 Syncing progress for task ${task.taskId}: ${task.currentCount}/${task.targetCount}`); + this.syncFlagTaskProgress(task.taskId, task.currentCount, task.submittedFlags); + this.notifyListeners(); + } + }); + + if (!foundTask) { + console.warn(`📋 No submit_flags task found for flag ${flagId}`); + } + } + /** * Handle room unlock - check unlock_room tasks */ @@ -453,6 +587,16 @@ export class ObjectivesManager { const gameId = window.breakEscapeConfig?.gameId; if (!gameId) return { success: true }; // Offline mode + const task = this.taskIndex[taskId]; + const body = {}; + + // For submit_flags tasks, include submittedFlags in the completion request + // so server can validate against latest data + if (task && task.type === 'submit_flags' && task.submittedFlags) { + body.submittedFlags = task.submittedFlags; + console.log(`📋 Including submittedFlags in completion request:`, task.submittedFlags); + } + try { // RESTful route: POST /break_escape/games/:id/objectives/tasks/:task_id const response = await fetch(`/break_escape/games/${gameId}/objectives/tasks/${taskId}`, { @@ -460,7 +604,8 @@ export class ObjectivesManager { headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')?.content || '' - } + }, + body: Object.keys(body).length > 0 ? JSON.stringify(body) : undefined }); return response.json(); @@ -492,6 +637,63 @@ export class ObjectivesManager { }, 1000); } + /** + * Sync flag task progress to server (including submittedFlags array) + * Debounced version for regular progress updates + */ + syncFlagTaskProgress(taskId, progress, submittedFlags) { + const gameId = window.breakEscapeConfig?.gameId; + if (!gameId) return; + + // Debounce sync by 1 second + if (this.syncTimeouts[taskId]) { + clearTimeout(this.syncTimeouts[taskId]); + } + + this.syncTimeouts[taskId] = setTimeout(() => { + // RESTful route: PUT /break_escape/games/:id/objectives/tasks/:task_id + fetch(`/break_escape/games/${gameId}/objectives/tasks/${taskId}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')?.content || '' + }, + body: JSON.stringify({ progress, submittedFlags }) + }).catch(err => console.warn('Failed to sync flag progress:', err)); + }, 1000); + } + + /** + * Sync flag task progress immediately (no debounce) - returns a promise + * Used when completing a task to ensure server has latest data + */ + async syncFlagTaskProgressImmediate(taskId, progress, submittedFlags) { + const gameId = window.breakEscapeConfig?.gameId; + if (!gameId) return Promise.resolve(); + + // Clear any pending debounced sync for this task + if (this.syncTimeouts[taskId]) { + clearTimeout(this.syncTimeouts[taskId]); + delete this.syncTimeouts[taskId]; + } + + // RESTful route: PUT /break_escape/games/:id/objectives/tasks/:task_id + const response = await fetch(`/break_escape/games/${gameId}/objectives/tasks/${taskId}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')?.content || '' + }, + body: JSON.stringify({ progress, submittedFlags }) + }); + + if (!response.ok) { + throw new Error(`Failed to sync flag progress: ${response.statusText}`); + } + + return response.json(); + } + // === UI Notifications === showTaskCompleteNotification(task) { diff --git a/public/break_escape/js/ui/objectives-panel.js b/public/break_escape/js/ui/objectives-panel.js index b342001..99bd510 100644 --- a/public/break_escape/js/ui/objectives-panel.js +++ b/public/break_escape/js/ui/objectives-panel.js @@ -94,7 +94,7 @@ export class ObjectivesPanel { const taskIcon = task.status === 'completed' ? '✓' : '○'; let progressText = ''; - if (task.showProgress && task.type === 'collect_items' && task.status !== 'completed') { + if (task.showProgress && (task.type === 'collect_items' || task.type === 'submit_flags') && task.status !== 'completed') { progressText = ` (${task.currentCount || 0}/${task.targetCount})`; } diff --git a/scenarios/lab_intro_linux/ink/instructor.ink b/scenarios/lab_intro_linux/ink/instructor.ink index ef3fcac..0265193 100644 --- a/scenarios/lab_intro_linux/ink/instructor.ink +++ b/scenarios/lab_intro_linux/ink/instructor.ink @@ -40,6 +40,10 @@ VAR deep_dives_completed = 0 // Global variables (synced from scenario.json.erb) VAR player_name = "Agent 0x00" +VAR lockpicking_key_received = false + +// NPC item inventory variables +VAR has_key = false // =========================================== // ENTRY POINT - LINUX INSTRUCTOR @@ -48,13 +52,33 @@ VAR player_name = "Agent 0x00" === start === ~ instructor_rapport = 0 -Tech Instructor: Welcome to Linux Fundamentals and Security, Agent {player_name}. I'm your technical instructor for this session. +Welcome back, {player_name}. What would you like to discuss? -Tech Instructor: This lab covers essential Linux command-line skills, remote administration via SSH, and basic penetration testing techniques. All crucial skills for field operations. +-> linux_training_hub -Tech Instructor: Think of this as building your foundational toolkit. Every SAFETYNET agent needs to be comfortable in Linux environments—most of our targets run Linux servers, and Kali Linux is our primary offensive platform. +// =========================================== +// TIMED INTRO CONVERSATION (Game Start) +// =========================================== + +=== intro_timed === +~ instructor_rapport = 0 + +Welcome to Linux Fundamentals and Security, {player_name}. I'm your technical instructor for this session. + +This lab covers essential Linux command-line skills, remote administration via SSH, and basic penetration testing techniques. All crucial skills for field operations. + +Let me explain how this lab works. You'll find three key resources here: + +First, there's a Lab Sheet Workstation in this room. This gives you access to detailed written instructions and exercises that complement our conversation. Use it to follow along with the material. + +Second, in the VM lab room to the north, you'll find terminals to launch virtual machines. You'll work with both a Kali Linux attacker machine and a vulnerable desktop system for hands-on practice. + +Finally, there's a Flag Submission Terminal where you'll submit flags you capture during the exercises. These flags demonstrate that you've successfully completed the challenges. + +You can talk to me anytime to explore Linux concepts, get tips, or ask questions about the material. I'm here to help guide your learning. + +Ready to get started? Feel free to ask me about any topic, or head to the lab sheet workstation and VM room when you're ready to begin the practical exercises. -#complete_task:talk_to_instructor -> linux_training_hub // =========================================== @@ -63,7 +87,7 @@ Tech Instructor: Think of this as building your foundational toolkit. Every SAFE === linux_training_hub === -Tech Instructor: What would you like to cover? +What would you like to cover? + {not linux_basics_discussed} [Learn about Linux basics and why it matters] -> linux_basics_intro @@ -100,13 +124,13 @@ Tech Instructor: What would you like to cover? ~ linux_basics_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Excellent starting point. Let me explain why Linux matters for security work. +Excellent starting point. Let me explain why Linux matters for security work. -Tech Instructor: Linux is the backbone of modern internet infrastructure. Google, Facebook, Amazon—they all run Linux servers at massive scale. When you're conducting penetration tests or investigating security incidents, you'll encounter Linux systems constantly. +Linux is the backbone of modern internet infrastructure. Google, Facebook, Amazon—they all run Linux servers at massive scale. When you're conducting penetration tests or investigating security incidents, you'll encounter Linux systems constantly. -Tech Instructor: More importantly for us, the best security tools are Linux-native. Kali Linux contains hundreds of specialized tools for penetration testing, forensics, and security analysis. Mastering Linux means mastering your toolkit. +More importantly for us, the best security tools are Linux-native. Kali Linux contains hundreds of specialized tools for penetration testing, forensics, and security analysis. Mastering Linux means mastering your toolkit. -Tech Instructor: Linux comes in many "distributions"—different flavors packaged for different purposes. Ubuntu for ease of use, Debian for stability, Kali for security testing. They all share the same core commands and concepts, so learning one helps you understand them all. +Linux comes in many "distributions"—different flavors packaged for different purposes. Ubuntu for ease of use, Debian for stability, Kali for security testing. They all share the same core commands and concepts, so learning one helps you understand them all. * [Why not just use Windows?] ~ deep_dives_completed += 1 @@ -123,15 +147,15 @@ Tech Instructor: Linux comes in many "distributions"—different flavors package === windows_comparison === ~ instructor_rapport += 8 -Tech Instructor: Fair question. Windows absolutely has its place—many enterprise environments are Windows-heavy, and you'll need those skills too. +Fair question. Windows absolutely has its place—many enterprise environments are Windows-heavy, and you'll need those skills too. -Tech Instructor: But for offensive security work, Linux has three major advantages: +But for offensive security work, Linux has three major advantages: -Tech Instructor: **First**, the tools. Most cutting-edge security research happens in the open-source community, and those tools are Linux-first. Sure, some get ported to Windows eventually, but you'll always be behind the curve. +First, the tools. Most cutting-edge security research happens in the open-source community, and those tools are Linux-first. Sure, some get ported to Windows eventually, but you'll always be behind the curve. -Tech Instructor: **Second**, the control. Linux gives you deep system access and transparency. You can see exactly what's happening, modify anything, and automate everything. That level of control is crucial when you're trying to exploit systems or analyze malware. +Second, the control. Linux gives you deep system access and transparency. You can see exactly what's happening, modify anything, and automate everything. That level of control is crucial when you're trying to exploit systems or analyze malware. -Tech Instructor: **Third**, the culture. The security community lives in Linux. Understanding Linux means understanding how other security professionals work, communicate, and share knowledge. +Third, the culture. The security community lives in Linux. Understanding Linux means understanding how other security professionals work, communicate, and share knowledge. ~ instructor_rapport += 5 -> linux_training_hub @@ -139,13 +163,13 @@ Tech Instructor: **Third**, the culture. The security community lives in Linux. === kali_explanation === ~ instructor_rapport += 8 -Tech Instructor: Kali is essentially a curated arsenal of security tools, all pre-configured and ready to use. +Kali is essentially a curated arsenal of security tools, all pre-configured and ready to use. -Tech Instructor: Offensive Security—the company behind Kali—maintains hundreds of tools across every category: information gathering, vulnerability analysis, wireless attacks, exploitation, post-exploitation, forensics, you name it. +Offensive Security—the company behind Kali—maintains hundreds of tools across every category: information gathering, vulnerability analysis, wireless attacks, exploitation, post-exploitation, forensics, you name it. -Tech Instructor: What makes Kali special isn't just the tools, though. It's the integration. Everything works together. The tools are kept up-to-date. Documentation is solid. And it's become the lingua franca of penetration testing—when security professionals share techniques, they assume you're using Kali. +What makes Kali special isn't just the tools, though. It's the integration. Everything works together. The tools are kept up-to-date. Documentation is solid. And it's become the lingua franca of penetration testing—when security professionals share techniques, they assume you're using Kali. -Tech Instructor: Think of it like this: you *could* build your own toolkit from scratch, hunting down each tool individually and figuring out dependencies. Or you could use Kali and get straight to the actual security work. +Think of it like this: you *could* build your own toolkit from scratch, hunting down each tool individually and figuring out dependencies. Or you could use Kali and get straight to the actual security work. ~ instructor_rapport += 5 -> linux_training_hub @@ -158,11 +182,11 @@ Tech Instructor: Think of it like this: you *could* build your own toolkit from ~ command_line_skills_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Right, let's build your command-line fundamentals. These are skills you'll use every single day in the field. +Right, let's build your command-line fundamentals. These are skills you'll use every single day in the field. -Tech Instructor: The command line might seem archaic compared to graphical interfaces, but it's exponentially more powerful. You can automate tasks, chain commands together, work on remote systems, and handle massive datasets—all from a simple text interface. +The command line might seem archaic compared to graphical interfaces, but it's exponentially more powerful. You can automate tasks, chain commands together, work on remote systems, and handle massive datasets—all from a simple text interface. -Tech Instructor: I'll cover the essential commands: navigating the filesystem, manipulating files and directories, viewing content, and getting help when you're stuck. +I'll cover the essential commands: navigating the filesystem, manipulating files and directories, viewing content, and getting help when you're stuck. * [Show me the navigation commands] ~ pwd_ls_discussed = true @@ -183,24 +207,24 @@ Tech Instructor: I'll cover the essential commands: navigating the filesystem, m === navigation_commands === ~ instructor_rapport += 3 -Tech Instructor: Navigation is your foundation. Here are the essentials: +Navigation is your foundation. Here are the essentials: -Tech Instructor: **pwd** - "print working directory". Shows exactly where you are in the filesystem. Lost? Run pwd. +pwd - "print working directory". Shows exactly where you are in the filesystem. Lost? Run pwd. -Tech Instructor: **ls** - lists files in your current directory. Add "-la" for detailed information including hidden files and permissions. You'll use "ls -la" constantly. +ls - lists files in your current directory. Add "-la" for detailed information including hidden files and permissions. You'll use "ls -la" constantly. -Tech Instructor: **cd** - "change directory". Moves you around the filesystem. "cd .." goes up one level, "cd" alone takes you home. +cd - "change directory". Moves you around the filesystem. "cd .." goes up one level, "cd" alone takes you home. -Tech Instructor: Pro tip: pressing Tab autocompletes filenames and commands. Type a few letters, hit Tab, save yourself endless typing. And use the up arrow to cycle through previous commands. +Pro tip: pressing Tab autocompletes filenames and commands. Type a few letters, hit Tab, save yourself endless typing. And use the up arrow to cycle through previous commands. * [Tell me more about ls flags] You: What other useful flags does ls have? - Tech Instructor: Great question. "ls -lt" sorts by modification time, newest first. "ls -lh" shows human-readable file sizes. "ls -lR" recursively lists subdirectories. You can combine them: "ls -lhta" shows all files, human-readable sizes, sorted by time. + Great question. "ls -lt" sorts by modification time, newest first. "ls -lh" shows human-readable file sizes. "ls -lR" recursively lists subdirectories. You can combine them: "ls -lhta" shows all files, human-readable sizes, sorted by time. ~ instructor_rapport += 5 -> command_line_followup * [What about hidden files?] You: What are hidden files? - Tech Instructor: In Linux, files starting with "." are hidden—they don't show up in normal ls output. Configuration files are typically hidden. Use "ls -a" to see them. You'll frequently need to examine hidden config files during security assessments. + In Linux, files starting with "." are hidden—they don't show up in normal ls output. Configuration files are typically hidden. Use "ls -a" to see them. You'll frequently need to examine hidden config files during security assessments. ~ instructor_rapport += 5 -> command_line_followup * [Got it] @@ -217,26 +241,26 @@ Tech Instructor: Pro tip: pressing Tab autocompletes filenames and commands. Typ === file_manipulation === ~ instructor_rapport += 3 -Tech Instructor: Creating, copying, moving, and viewing files. Bread and butter stuff. +Creating, copying, moving, and viewing files. Bread and butter stuff. -Tech Instructor: **mkdir** - creates directories. "mkdir mydir" creates a new folder. +mkdir - creates directories. "mkdir mydir" creates a new folder. -Tech Instructor: **cp** - copies files. "cp source destination" copies a file. Add "-r" for recursive directory copying. +cp - copies files. "cp source destination" copies a file. Add "-r" for recursive directory copying. -Tech Instructor: **mv** - moves or renames files. "mv oldname newname" renames. "mv file /path/to/destination/" moves it. +mv - moves or renames files. "mv oldname newname" renames. "mv file /path/to/destination/" moves it. -Tech Instructor: **cat** - dumps file contents to the screen. "cat filename" shows the whole file. +cat - dumps file contents to the screen. "cat filename" shows the whole file. -Tech Instructor: **echo** - prints text. "echo 'hello world'" displays text. Useful for testing and scripting. +echo - prints text. "echo 'hello world'" displays text. Useful for testing and scripting. * [Tell me more about viewing files] You: Cat seems limited for large files... - Tech Instructor: Exactly right. For large files, use **less**. "less filename" lets you scroll through, search with "/", quit with "q". Much more practical than cat for big files. + Exactly right. For large files, use less. "less filename" lets you scroll through, search with "/", quit with "q". Much more practical than cat for big files. ~ instructor_rapport += 8 -> command_line_followup * [What about creating files?] You: How do I create a new empty file? - Tech Instructor: Several ways. "touch filename" creates an empty file. Or redirect output: "echo 'content' > filename" creates a file with content. We'll cover redirection shortly. + Several ways. "touch filename" creates an empty file. Or redirect output: "echo 'content' > filename" creates a file with content. We'll cover redirection shortly. ~ instructor_rapport += 5 -> command_line_followup * [Understood] @@ -246,24 +270,24 @@ Tech Instructor: **echo** - prints text. "echo 'hello world'" displays text. Use ~ man_pages_discussed = true ~ instructor_rapport += 8 -Tech Instructor: This is possibly the most important skill: learning to teach yourself. +This is possibly the most important skill: learning to teach yourself. -Tech Instructor: **man** - the manual pages. "man command" shows comprehensive documentation for any command. Navigation: space to page down, "b" to page up, "/" to search, "q" to quit. +man - the manual pages. "man command" shows comprehensive documentation for any command. Navigation: space to page down, "b" to page up, "/" to search, "q" to quit. -Tech Instructor: Example: "man ls" shows every flag and option for ls. The man pages are detailed, sometimes overwhelming, but they're authoritative. +Example: "man ls" shows every flag and option for ls. The man pages are detailed, sometimes overwhelming, but they're authoritative. -Tech Instructor: Alternative: **info** command provides similar documentation, sometimes more detailed. +Alternative: info command provides similar documentation, sometimes more detailed. -Tech Instructor: Pro tip: if you're really stuck, try "command --help" for a quick summary. Many tools also have online documentation, but man pages are always available, even when you're offline on a compromised system with no internet. +Pro tip: if you're really stuck, try "command --help" for a quick summary. Many tools also have online documentation, but man pages are always available, even when you're offline on a compromised system with no internet. * [How do I search man pages?] You: Can I search across all man pages for a topic? - Tech Instructor: Yes. "man -k keyword" searches all man page descriptions. "apropos keyword" does the same thing. Useful when you know what you want to do but not which command does it. + Yes. "man -k keyword" searches all man page descriptions. "apropos keyword" does the same thing. Useful when you know what you want to do but not which command does it. ~ instructor_rapport += 10 -> command_line_followup * [What if man pages are too dense?] You: Man pages can be pretty technical... - Tech Instructor: True. For beginner-friendly explanations, try "tldr command"—it shows simplified examples. Or search online for "command examples". But learning to parse man pages is a skill worth developing. They're accurate, complete, and always available. + True. For beginner-friendly explanations, try "tldr command"—it shows simplified examples. Or search online for "command examples". But learning to parse man pages is a skill worth developing. They're accurate, complete, and always available. ~ instructor_rapport += 8 -> command_line_followup * [Makes sense] @@ -277,19 +301,19 @@ Tech Instructor: Pro tip: if you're really stuck, try "command --help" for a qui ~ vi_editor_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Ah, vi. The editor that's been causing both frustration and devotion since 1976. +Ah, vi. The editor that's been causing both frustration and devotion since 1976. -Tech Instructor: Here's why you need to know vi: it's on *every* Unix and Linux system. When you SSH into a compromised server with minimal tools, vi will be there. Other editors might not be. +Here's why you need to know vi: it's on *every* Unix and Linux system. When you SSH into a compromised server with minimal tools, vi will be there. Other editors might not be. -Tech Instructor: Vi is modal. Two main modes: **normal mode** for commands, **insert mode** for typing text. +Vi is modal. Two main modes: normal mode for commands, insert mode for typing text. -Tech Instructor: The essentials: +The essentials: - "vi filename" opens or creates a file - Press "i" to enter insert mode (now you can type) - Press Esc to return to normal mode - In normal mode: ":wq" writes and quits, ":q!" quits without saving -Tech Instructor: That's literally everything you need to survive vi. +That's literally everything you need to survive vi. * [Tell me more about normal mode commands] ~ deep_dives_completed += 1 @@ -297,7 +321,7 @@ Tech Instructor: That's literally everything you need to survive vi. -> vi_advanced_commands * [Why not use nano or another editor?] You: Why not just use nano? It seems simpler. - Tech Instructor: Nano is fine for quick edits. But vi is universal and powerful. On hardened systems or embedded devices, vi might be your only option. Plus, once you learn it, vi is dramatically faster. Your call, but I recommend at least learning vi basics. + Nano is fine for quick edits. But vi is universal and powerful. On hardened systems or embedded devices, vi might be your only option. Plus, once you learn it, vi is dramatically faster. Your call, but I recommend at least learning vi basics. ~ instructor_rapport += 5 -> vi_editor_followup * [I'll learn the basics] @@ -308,14 +332,14 @@ Tech Instructor: That's literally everything you need to survive vi. === vi_advanced_commands === ~ instructor_rapport += 8 -Tech Instructor: Want to unlock vi's power? Here are some favorites: +Want to unlock vi's power? Here are some favorites: -Tech Instructor: **Navigation in normal mode:** +Navigation in normal mode: - "h" "j" "k" "l" move cursor left, down, up, right - "w" jumps forward by word, "b" jumps back - "gg" jumps to start of file, "G" jumps to end -Tech Instructor: **Editing in normal mode:** +Editing in normal mode: - "dd" deletes current line - "30dd" deletes 30 lines - "yy" copies (yanks) current line @@ -323,9 +347,9 @@ Tech Instructor: **Editing in normal mode:** - "u" undo - "/" searches, "n" finds next match -Tech Instructor: You can combine commands: "d10j" deletes 10 lines down. "c3w" changes next 3 words. +You can combine commands: "d10j" deletes 10 lines down. "c3w" changes next 3 words. -Tech Instructor: Ten minutes with a vi tutorial will make you look like a wizard. It's worth it. +Ten minutes with a vi tutorial will make you look like a wizard. It's worth it. ~ instructor_rapport += 10 -> vi_editor_followup @@ -342,15 +366,15 @@ Tech Instructor: Ten minutes with a vi tutorial will make you look like a wizard ~ piping_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Piping is where Linux becomes genuinely powerful. You can chain simple commands together to accomplish complex tasks. +Piping is where Linux becomes genuinely powerful. You can chain simple commands together to accomplish complex tasks. -Tech Instructor: The pipe operator sends the output of one command to the input of another. +The pipe operator sends the output of one command to the input of another. -Tech Instructor: Example command: cat /etc/passwd, then pipe to grep /home/ +Example command: cat /etc/passwd, then pipe to grep /home/ -Tech Instructor: This reads the passwd file and filters it to only lines containing "/home/". Two simple commands, combined to do something useful. +This reads the passwd file and filters it to only lines containing "/home/". Two simple commands, combined to do something useful. -Tech Instructor: You can chain multiple pipes: cat /etc/passwd, pipe to grep /home/, then pipe to sort -r. Now it's filtered *and* sorted in reverse. +You can chain multiple pipes: cat /etc/passwd, pipe to grep /home/, then pipe to sort -r. Now it's filtered *and* sorted in reverse. * [Show me more examples] ~ piping_examples_discussed = true @@ -366,21 +390,17 @@ Tech Instructor: You can chain multiple pipes: cat /etc/passwd, pipe to grep /ho === piping_examples === ~ instructor_rapport += 8 -Tech Instructor: Here are real-world examples you'll use constantly: +Here are real-world examples you'll use constantly: -Tech Instructor: **Finding running processes:** -Command: ps aux, pipe to grep ssh. This lists all processes and filters for SSH-related ones. +Finding running processes: Command: ps aux, pipe to grep ssh. This lists all processes and filters for SSH-related ones. -Tech Instructor: **Analyzing logs:** -Command: cat logfile, pipe to grep ERROR, pipe to sort, pipe to uniq -c, pipe to sort -nr. This finds errors, sorts them, counts unique occurrences, sorts by frequency. One line, powerful analysis. +Analyzing logs: Command: cat logfile, pipe to grep ERROR, pipe to sort, pipe to uniq -c, pipe to sort -nr. This finds errors, sorts them, counts unique occurrences, sorts by frequency. One line, powerful analysis. -Tech Instructor: **Network analysis:** -Command: netstat -an, pipe to grep ESTABLISHED. This shows active network connections. +Network analysis: Command: netstat -an, pipe to grep ESTABLISHED. This shows active network connections. -Tech Instructor: **Counting things:** -Command: ls, pipe to wc -l. This counts files in current directory. +Counting things: Command: ls, pipe to wc -l. This counts files in current directory. -Tech Instructor: The Unix philosophy: small tools that do one thing well, combined creatively. Piping is how you combine them. +The Unix philosophy: small tools that do one thing well, combined creatively. Piping is how you combine them. ~ completed_piping_challenge = true ~ instructor_rapport += 5 @@ -389,23 +409,23 @@ Tech Instructor: The Unix philosophy: small tools that do one thing well, combin === piping_common_commands === ~ instructor_rapport += 8 -Tech Instructor: Commands that work brilliantly in pipes: +Commands that work brilliantly in pipes: -Tech Instructor: **grep** - filters lines matching a pattern. Your most-used pipe command. +grep - filters lines matching a pattern. Your most-used pipe command. -Tech Instructor: **sort** - sorts lines alphabetically. "-n" for numeric sort, "-r" for reverse. +sort - sorts lines alphabetically. "-n" for numeric sort, "-r" for reverse. -Tech Instructor: **uniq** - removes duplicate adjacent lines. Usually used after sort. "-c" counts occurrences. +uniq - removes duplicate adjacent lines. Usually used after sort. "-c" counts occurrences. -Tech Instructor: **head** and **tail** - show first or last N lines. "head -20" shows first 20 lines. +head and tail - show first or last N lines. "head -20" shows first 20 lines. -Tech Instructor: **wc** - word count. "-l" counts lines, "-w" counts words, "-c" counts characters. +wc - word count. "-l" counts lines, "-w" counts words, "-c" counts characters. -Tech Instructor: **cut** - extracts columns from text. "cut -d: -f1" splits on colons, takes first field. +cut - extracts columns from text. "cut -d: -f1" splits on colons, takes first field. -Tech Instructor: **awk** and **sed** - powerful text processing. More advanced, but incredibly useful. +awk and sed - powerful text processing. More advanced, but incredibly useful. -Tech Instructor: Learn these, and you can process massive datasets from the command line. +Learn these, and you can process massive datasets from the command line. ~ completed_piping_challenge = true ~ instructor_rapport += 5 @@ -419,17 +439,17 @@ Tech Instructor: Learn these, and you can process massive datasets from the comm ~ redirection_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Redirection lets you send command output to files or read input from files. +Redirection lets you send command output to files or read input from files. -Tech Instructor: Three key operators: +Three key operators: -Tech Instructor: **>** - redirects output to a file, overwriting it. "ls > filelist.txt" saves directory listing to a file. +greater than > - redirects output to a file, overwriting it. "ls > filelist.txt" saves directory listing to a file. -Tech Instructor: **>>** - redirects output to a file, appending. "echo 'new line' >> file.txt" adds to the end. +append >> - redirects output to a file, appending. "echo 'new line' >> file.txt" adds to the end. -Tech Instructor: **<** - reads input from a file. "wc -l < file.txt" counts lines in the file. +less than < - reads input from a file. "wc -l < file.txt" counts lines in the file. -Tech Instructor: Practical example: "ps aux > processes.txt" saves a snapshot of running processes for analysis. +Practical example: "ps aux > processes.txt" saves a snapshot of running processes for analysis. * [Show me more redirection examples] ~ redirection_examples_discussed = true @@ -444,21 +464,21 @@ Tech Instructor: Practical example: "ps aux > processes.txt" saves a snapshot of === redirection_examples === ~ instructor_rapport += 8 -Tech Instructor: Practical redirection scenarios: +Practical redirection scenarios: -Tech Instructor: **Saving command output for later:** +Saving command output for later: "ifconfig > network_config.txt" - captures network configuration. -Tech Instructor: **Building logs:** +Building logs: "echo '$(date): Scan completed' >> scan_log.txt" - appends timestamped entries. -Tech Instructor: **Combining with pipes:** +Combining with pipes: Command: cat /etc/passwd, pipe to grep /home/, redirect to users.txt. This filters and saves results. -Tech Instructor: **Quick file creation:** +Quick file creation: "echo 'test content' > test.txt" - creates a file with content in one command. -Tech Instructor: During security assessments, you'll constantly redirect command output to files for documentation and later analysis. +During security assessments, you'll constantly redirect command output to files for documentation and later analysis. ~ instructor_rapport += 5 -> linux_training_hub @@ -466,19 +486,19 @@ Tech Instructor: During security assessments, you'll constantly redirect command === stderr_redirection === ~ instructor_rapport += 10 -Tech Instructor: Good catch. There are actually two output streams: stdout (standard output) and stderr (standard error). +Good catch. There are actually two output streams: stdout (standard output) and stderr (standard error). -Tech Instructor: By default, ">" only redirects stdout. Error messages still appear on screen. +By default, ">" only redirects stdout. Error messages still appear on screen. -Tech Instructor: To redirect stderr: "command 2> errors.txt" +To redirect stderr: "command 2> errors.txt" -Tech Instructor: To redirect both: "command > output.txt 2>&1" - sends stderr to stdout, which goes to the file. +To redirect both: "command > output.txt 2>&1" - sends stderr to stdout, which goes to the file. -Tech Instructor: Or in modern Bash: "command &> output.txt" does the same thing more simply. +Or in modern Bash: "command &> output.txt" does the same thing more simply. -Tech Instructor: To discard output entirely: "command > /dev/null 2>&1" - sends everything to the void. +To discard output entirely: "command > /dev/null 2>&1" - sends everything to the void. -Tech Instructor: This is advanced stuff, but incredibly useful when scripting or when you want clean output. +This is advanced stuff, but incredibly useful when scripting or when you want clean output. ~ instructor_rapport += 10 -> linux_training_hub @@ -491,15 +511,15 @@ Tech Instructor: This is advanced stuff, but incredibly useful when scripting or ~ networking_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Linux networking commands. Essential for understanding network configurations and troubleshooting connectivity. +Linux networking commands. Essential for understanding network configurations and troubleshooting connectivity. -Tech Instructor: **ifconfig** - the classic command to view network interfaces and IP addresses. Shows all your network adapters. +ifconfig - the classic command to view network interfaces and IP addresses. Shows all your network adapters. -Tech Instructor: **ip** - the modern replacement. "ip a s" (ip address show) does the same thing. You'll see both used in the field. +ip - the modern replacement. "ip a s" (ip address show) does the same thing. You'll see both used in the field. -Tech Instructor: **hostname -I** - quick way to display just your IP address. +hostname -I - quick way to display just your IP address. -Tech Instructor: In our environment, your IP typically starts with "172.22" or "10" - those are private network ranges. +In our environment, your IP typically starts with "172.22" or "10" - those are private network ranges. * [Tell me more about network interfaces] ~ ifconfig_discussed = true @@ -510,7 +530,7 @@ Tech Instructor: In our environment, your IP typically starts with "172.22" or " -> network_troubleshooting * [What about finding other machines?] You: How do I discover other systems on the network? - Tech Instructor: Good question, but that's scanning territory. We'll cover tools like nmap in the scanning module. For now, focus on understanding your own network configuration. + Good question, but that's scanning territory. We'll cover tools like nmap in the scanning module. For now, focus on understanding your own network configuration. ~ instructor_rapport += 5 -> linux_training_hub * [Got it] @@ -519,17 +539,17 @@ Tech Instructor: In our environment, your IP typically starts with "172.22" or " === network_interfaces === ~ instructor_rapport += 8 -Tech Instructor: Network interfaces are how your computer connects to networks. Think of them as connection points. +Network interfaces are how your computer connects to networks. Think of them as connection points. -Tech Instructor: **eth0, eth1** - Ethernet interfaces. Physical network ports. +eth0, eth1 - Ethernet interfaces. Physical network ports. -Tech Instructor: **wlan0** - Wireless interface. WiFi adapter. +wlan0 - Wireless interface. WiFi adapter. -Tech Instructor: **lo** - Loopback interface, always 127.0.0.1. Your computer talking to itself. Useful for testing. +lo - Loopback interface, always 127.0.0.1. Your computer talking to itself. Useful for testing. -Tech Instructor: **Virtual interfaces** - VPNs and containers create virtual interfaces like tun0, tap0, docker0. +Virtual interfaces - VPNs and containers create virtual interfaces like tun0, tap0, docker0. -Tech Instructor: When you run ifconfig, you see all interfaces, their IP addresses, MAC addresses, and traffic statistics. Essential information for network security assessments. +When you run ifconfig, you see all interfaces, their IP addresses, MAC addresses, and traffic statistics. Essential information for network security assessments. ~ instructor_rapport += 5 -> linux_training_hub @@ -537,19 +557,19 @@ Tech Instructor: When you run ifconfig, you see all interfaces, their IP address === network_troubleshooting === ~ instructor_rapport += 8 -Tech Instructor: Basic network troubleshooting steps: +Basic network troubleshooting steps: -Tech Instructor: **Step 1:** Check interface status with "ifconfig" or "ip a s". Is the interface up? Does it have an IP? +Step 1: Check interface status with "ifconfig" or "ip a s". Is the interface up? Does it have an IP? -Tech Instructor: **Step 2:** If no IP, try "dhclient eth0" to request one from DHCP server. +Step 2: If no IP, try "dhclient eth0" to request one from DHCP server. -Tech Instructor: **Step 3:** Test local connectivity: "ping 127.0.0.1" tests your network stack. +Step 3: Test local connectivity: "ping 127.0.0.1" tests your network stack. -Tech Instructor: **Step 4:** Test gateway: "ping your_gateway_ip" tests local network. +Step 4: Test gateway: "ping your_gateway_ip" tests local network. -Tech Instructor: **Step 5:** Test DNS: "ping google.com" tests name resolution and external connectivity. +Step 5: Test DNS: "ping google.com" tests name resolution and external connectivity. -Tech Instructor: In our lab environment, if you're having issues, usually dhclient fixes it. In the field, troubleshooting can be much more complex. +In our lab environment, if you're having issues, usually dhclient fixes it. In the field, troubleshooting can be much more complex. ~ instructor_rapport += 5 -> linux_training_hub @@ -562,13 +582,13 @@ Tech Instructor: In our lab environment, if you're having issues, usually dhclie ~ kali_intro_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Kali Linux. Your primary offensive security platform. +Kali Linux. Your primary offensive security platform. -Tech Instructor: Released by Offensive Security in 2013 as the successor to BackTrack Linux. It's specifically designed for penetration testing, security auditing, and digital forensics. +Released by Offensive Security in 2013 as the successor to BackTrack Linux. It's specifically designed for penetration testing, security auditing, and digital forensics. -Tech Instructor: Kali includes hundreds of pre-installed tools organized by category: information gathering, vulnerability analysis, wireless attacks, web applications, exploitation tools, password attacks, forensics, and more. +Kali includes hundreds of pre-installed tools organized by category: information gathering, vulnerability analysis, wireless attacks, web applications, exploitation tools, password attacks, forensics, and more. -Tech Instructor: Default credentials: username "kali", password "kali". Never use Kali as your primary OS—it's designed for security testing, not everyday computing. +Default credentials: username "kali", password "kali". Never use Kali as your primary OS—it's designed for security testing, not everyday computing. * [Show me what tools are available] You: What kinds of tools are we talking about? @@ -582,21 +602,21 @@ Tech Instructor: Default credentials: username "kali", password "kali". Never us === kali_tools_overview === ~ instructor_rapport += 8 -Tech Instructor: Let me give you a taste of what's available: +Let me give you a taste of what's available: -Tech Instructor: **Information Gathering:** nmap, dnsenum, whois, recon-ng. Tools for mapping networks and gathering intelligence. +Information Gathering: nmap, dnsenum, whois, recon-ng. Tools for mapping networks and gathering intelligence. -Tech Instructor: **Vulnerability Analysis:** Nessus, OpenVAS, nikto. Automated scanners that identify security weaknesses. +Vulnerability Analysis: Nessus, OpenVAS, nikto. Automated scanners that identify security weaknesses. -Tech Instructor: **Exploitation:** Metasploit Framework, BeEF, sqlmap. Tools for actively exploiting vulnerabilities. +Exploitation: Metasploit Framework, BeEF, sqlmap. Tools for actively exploiting vulnerabilities. -Tech Instructor: **Password Attacks:** Hydra, John the Ripper, hashcat. Cracking and bruteforcing credentials. +Password Attacks: Hydra, John the Ripper, hashcat. Cracking and bruteforcing credentials. -Tech Instructor: **Wireless Attacks:** Aircrack-ng, Reaver, Wifite. WiFi security testing. +Wireless Attacks: Aircrack-ng, Reaver, Wifite. WiFi security testing. -Tech Instructor: **Forensics:** Autopsy, Sleuth Kit, Volatility. Analyzing systems and recovering data. +Forensics: Autopsy, Sleuth Kit, Volatility. Analyzing systems and recovering data. -Tech Instructor: And those are just highlights. Run "ls /usr/bin" to see hundreds more. It's an arsenal. +And those are just highlights. Run "ls /usr/bin" to see hundreds more. It's an arsenal. ~ instructor_rapport += 5 -> linux_training_hub @@ -604,19 +624,19 @@ Tech Instructor: And those are just highlights. Run "ls /usr/bin" to see hundred === kali_organization === ~ instructor_rapport += 8 -Tech Instructor: Kali organizes tools by the penetration testing lifecycle: +Kali organizes tools by the penetration testing lifecycle: -Tech Instructor: **Phase 1 - Information Gathering:** Passive and active reconnaissance. Learning about your target. +Phase 1 - Information Gathering: Passive and active reconnaissance. Learning about your target. -Tech Instructor: **Phase 2 - Vulnerability Analysis:** Identifying weaknesses in systems and applications. +Phase 2 - Vulnerability Analysis: Identifying weaknesses in systems and applications. -Tech Instructor: **Phase 3 - Exploitation:** Actually compromising systems using identified vulnerabilities. +Phase 3 - Exploitation: Actually compromising systems using identified vulnerabilities. -Tech Instructor: **Phase 4 - Post-Exploitation:** What you do after gaining access. Maintaining access, pivoting, data exfiltration. +Phase 4 - Post-Exploitation: What you do after gaining access. Maintaining access, pivoting, data exfiltration. -Tech Instructor: The Applications menu mirrors this structure. When you need a tool, think about which phase you're in, and browse that category. +The Applications menu mirrors this structure. When you need a tool, think about which phase you're in, and browse that category. -Tech Instructor: You'll also quickly learn the handful of tools you use constantly. Nmap, Metasploit, Burp Suite, Wireshark—these become second nature. +You'll also quickly learn the handful of tools you use constantly. Nmap, Metasploit, Burp Suite, Wireshark—these become second nature. ~ instructor_rapport += 5 -> linux_training_hub @@ -629,15 +649,15 @@ Tech Instructor: You'll also quickly learn the handful of tools you use constant ~ ssh_discussed = true ~ instructor_rapport += 5 -Tech Instructor: SSH - Secure Shell. Encrypted remote access to systems. One of your most critical tools. +SSH - Secure Shell. Encrypted remote access to systems. One of your most critical tools. -Tech Instructor: SSH lets you securely connect to remote Linux systems and execute commands as if you were sitting at that machine. All traffic is encrypted, protecting against eavesdropping. +SSH lets you securely connect to remote Linux systems and execute commands as if you were sitting at that machine. All traffic is encrypted, protecting against eavesdropping. -Tech Instructor: Basic usage: "ssh username@ip_address" +Basic usage: "ssh username@ip_address" -Tech Instructor: The server typically listens on port 22. When you connect, you authenticate (usually with password or key), and then you have a remote shell. +The server typically listens on port 22. When you connect, you authenticate (usually with password or key), and then you have a remote shell. -Tech Instructor: SSH replaced older, insecure protocols like Telnet and rlogin, which transmitted passwords in cleartext. Never use those—always use SSH. +SSH replaced older, insecure protocols like Telnet and rlogin, which transmitted passwords in cleartext. Never use those—always use SSH. * [Tell me about SSH keys] You: What about SSH key authentication? @@ -659,19 +679,19 @@ Tech Instructor: SSH replaced older, insecure protocols like Telnet and rlogin, === ssh_keys === ~ instructor_rapport += 10 -Tech Instructor: SSH keys are asymmetric cryptography for authentication. Much more secure than passwords. +SSH keys are asymmetric cryptography for authentication. Much more secure than passwords. -Tech Instructor: You generate a key pair: a private key (keep secret) and public key (share freely). +You generate a key pair: a private key (keep secret) and public key (share freely). -Tech Instructor: Generate keys: "ssh-keygen -t rsa -b 4096" +Generate keys: "ssh-keygen -t rsa -b 4096" -Tech Instructor: Copy public key to server: "ssh-copy-id user@server" +Copy public key to server: "ssh-copy-id user@server" -Tech Instructor: Now you can SSH without typing passwords. The private key proves your identity. +Now you can SSH without typing passwords. The private key proves your identity. -Tech Instructor: Benefits: stronger than passwords, can't be bruteforced, can be passphrase-protected, can be revoked per-server. +Benefits: stronger than passwords, can't be bruteforced, can be passphrase-protected, can be revoked per-server. -Tech Instructor: Many organizations require key-based auth and disable password authentication entirely. Learn this workflow. +Many organizations require key-based auth and disable password authentication entirely. Learn this workflow. ~ instructor_rapport += 10 -> ssh_intro @@ -679,15 +699,15 @@ Tech Instructor: Many organizations require key-based auth and disable password === ssh_x_forwarding === ~ instructor_rapport += 8 -Tech Instructor: X11 forwarding is clever. Linux graphical applications use the X Window System. SSH can tunnel X11 traffic. +X11 forwarding is clever. Linux graphical applications use the X Window System. SSH can tunnel X11 traffic. -Tech Instructor: Connect with: "ssh -X user@server" +Connect with: "ssh -X user@server" -Tech Instructor: Now you can run graphical programs on the remote server, but see them on your local screen. The program runs remotely, but displays locally. +Now you can run graphical programs on the remote server, but see them on your local screen. The program runs remotely, but displays locally. -Tech Instructor: Example: "kate" opens the text editor, running on the remote system but displaying on yours. Useful for accessing GUI tools remotely. +Example: "kate" opens the text editor, running on the remote system but displaying on yours. Useful for accessing GUI tools remotely. -Tech Instructor: Warning: some latency over networks. And it does expose some security risks—only use on trusted connections. +Warning: some latency over networks. And it does expose some security risks—only use on trusted connections. ~ instructor_rapport += 5 -> ssh_intro @@ -695,23 +715,23 @@ Tech Instructor: Warning: some latency over networks. And it does expose some se === ssh_fingerprints === ~ instructor_rapport += 10 -Tech Instructor: Excellent security awareness. SSH uses host key fingerprints to prevent man-in-the-middle attacks. +Excellent security awareness. SSH uses host key fingerprints to prevent man-in-the-middle attacks. -Tech Instructor: When you first connect, SSH shows the server's fingerprint. You should verify this matches the real server before accepting. +When you first connect, SSH shows the server's fingerprint. You should verify this matches the real server before accepting. -Tech Instructor: On the server, check fingerprint: "ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub" +On the server, check fingerprint: "ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub" -Tech Instructor: If the fingerprint matches what SSH showed you, type "yes". SSH remembers this and will warn if it changes later. +If the fingerprint matches what SSH showed you, type "yes". SSH remembers this and will warn if it changes later. -Tech Instructor: If the fingerprint changes unexpectedly, that's a warning sign. Could be a man-in-the-middle attack, or could be the server was rebuilt. Investigate before proceeding. +If the fingerprint changes unexpectedly, that's a warning sign. Could be a man-in-the-middle attack, or could be the server was rebuilt. Investigate before proceeding. -Tech Instructor: Most people skip this check. Don't be most people. Especially in adversarial security contexts. +Most people skip this check. Don't be most people. Especially in adversarial security contexts. ~ instructor_rapport += 10 -> ssh_intro === ssh_to_hydra_transition === -Tech Instructor: Now you're thinking like a penetration tester. Let's talk about attacking SSH. +Now you're thinking like a penetration tester. Let's talk about attacking SSH. -> hydra_intro // =========================================== @@ -722,15 +742,15 @@ Tech Instructor: Now you're thinking like a penetration tester. Let's talk about ~ hydra_discussed = true ~ instructor_rapport += 5 -Tech Instructor: Hydra. THC-Hydra, to be specific. A parallelized login cracker supporting numerous protocols. +Hydra. THC-Hydra, to be specific. A parallelized login cracker supporting numerous protocols. -Tech Instructor: Hydra performs **online bruteforce attacks**—it actually tries to log in with username/password combinations. Different from offline attacks where you crack hashed passwords. +Hydra performs online bruteforce attacks—it actually tries to log in with username/password combinations. Different from offline attacks where you crack hashed passwords. -Tech Instructor: Basic usage: "hydra -l username -p password target ssh" +Basic usage: "hydra -l username -p password target ssh" -Tech Instructor: Tests a single username/password combo. But Hydra's power is testing many combinations from wordlists. +Tests a single username/password combo. But Hydra's power is testing many combinations from wordlists. -Tech Instructor: Supports dozens of protocols: SSH, FTP, HTTP, RDP, SMB, databases, and more. If it accepts login credentials, Hydra can probably attack it. +Supports dozens of protocols: SSH, FTP, HTTP, RDP, SMB, databases, and more. If it accepts login credentials, Hydra can probably attack it. * [How do I use wordlists?] ~ bruteforce_basics_discussed = true @@ -749,19 +769,19 @@ Tech Instructor: Supports dozens of protocols: SSH, FTP, HTTP, RDP, SMB, databas === hydra_wordlists === ~ instructor_rapport += 10 -Tech Instructor: Wordlists are the fuel for Hydra. Collections of common passwords to test. +Wordlists are the fuel for Hydra. Collections of common passwords to test. -Tech Instructor: Usage: "hydra -l username -P /path/to/wordlist.txt target ssh" +Usage: "hydra -l username -P /path/to/wordlist.txt target ssh" -Tech Instructor: Capital -P for password list, lowercase -l for single username. Or use -L for username list too. +Capital -P for password list, lowercase -l for single username. Or use -L for username list too. -Tech Instructor: Kali includes wordlists: "ls /usr/share/wordlists/seclists/Passwords/" +Kali includes wordlists: "ls /usr/share/wordlists/seclists/Passwords/" -Tech Instructor: **Choosing the right wordlist is critical.** A wordlist with 10 million passwords might take days for online attacks. Start with smaller, curated lists of common passwords. +Choosing the right wordlist is critical. A wordlist with 10 million passwords might take days for online attacks. Start with smaller, curated lists of common passwords. -Tech Instructor: For SSH specifically, "Common-Credentials" lists work well. They contain default passwords and common weak passwords. +For SSH specifically, "Common-Credentials" lists work well. They contain default passwords and common weak passwords. -Tech Instructor: Real-world advice: online attacks are slow and noisy. They generate logs. They trigger intrusion detection. Use them strategically, not as your first approach. +Real-world advice: online attacks are slow and noisy. They generate logs. They trigger intrusion detection. Use them strategically, not as your first approach. ~ completed_hydra_challenge = true ~ instructor_rapport += 10 @@ -770,17 +790,17 @@ Tech Instructor: Real-world advice: online attacks are slow and noisy. They gene === hydra_speed === ~ instructor_rapport += 8 -Tech Instructor: Speed depends on many factors: network latency, server response time, number of parallel connections. +Speed depends on many factors: network latency, server response time, number of parallel connections. -Tech Instructor: Hydra's "-t" flag controls parallel tasks. "hydra -t 4" uses 4 parallel connections. +Hydra's "-t" flag controls parallel tasks. "hydra -t 4" uses 4 parallel connections. -Tech Instructor: More isn't always better. Too many parallel connections can crash services or trigger rate limiting. For SSH, 4-16 threads is usually reasonable. +More isn't always better. Too many parallel connections can crash services or trigger rate limiting. For SSH, 4-16 threads is usually reasonable. -Tech Instructor: Realistic expectations: online SSH bruteforce might test 10-50 passwords per second. Against a wordlist with 10,000 passwords, that's several minutes at best. +Realistic expectations: online SSH bruteforce might test 10-50 passwords per second. Against a wordlist with 10,000 passwords, that's several minutes at best. -Tech Instructor: Compare to offline cracking (like hashcat on GPUs), which can test billions of passwords per second. Online attacks are fundamentally slower. +Compare to offline cracking (like hashcat on GPUs), which can test billions of passwords per second. Online attacks are fundamentally slower. -Tech Instructor: Strategic implication: online attacks work best when you have good intelligence. If you know username is "admin" and password is probably from a short list of defaults, Hydra excels. Blind bruteforce against random accounts? Impractical. +Strategic implication: online attacks work best when you have good intelligence. If you know username is "admin" and password is probably from a short list of defaults, Hydra excels. Blind bruteforce against random accounts? Impractical. ~ instructor_rapport += 8 -> linux_training_hub @@ -788,17 +808,17 @@ Tech Instructor: Strategic implication: online attacks work best when you have g === hydra_ethics === ~ instructor_rapport += 10 -Tech Instructor: Critical question. Shows good judgment. +Critical question. Shows good judgment. -Tech Instructor: **Legal status:** Hydra itself is legal to possess and use in authorized security testing. Unauthorized use against systems you don't own or have explicit permission to test? That's computer fraud. Felony-level crime in most jurisdictions. +Legal status: Hydra itself is legal to possess and use in authorized security testing. Unauthorized use against systems you don't own or have explicit permission to test? That's computer fraud. Felony-level crime in most jurisdictions. -Tech Instructor: **In this training:** You're attacking lab systems we control, with explicit permission. This is legal and ethical training. +In this training: You're attacking lab systems we control, with explicit permission. This is legal and ethical training. -Tech Instructor: **In SAFETYNET operations:** You'll have authorization for your targets. Still legally gray area, but covered by classified operational authorities. +In SAFETYNET operations: You'll have authorization for your targets. Still legally gray area, but covered by classified operational authorities. -Tech Instructor: **In the real world:** Never, ever use these tools against systems without written authorization. Penetration testers get contracts. Bug bounty hunters follow program rules. Hobbyists practice in their own isolated labs. +In the real world: Never, ever use these tools against systems without written authorization. Penetration testers get contracts. Bug bounty hunters follow program rules. Hobbyists practice in their own isolated labs. -Tech Instructor: The skills you're learning are powerful. Use them responsibly. With authorization. Within the law. That's not optional—it's core to professional security work. +The skills you're learning are powerful. Use them responsibly. With authorization. Within the law. That's not optional—it's core to professional security work. ~ instructor_rapport += 15 -> linux_training_hub @@ -810,15 +830,15 @@ Tech Instructor: The skills you're learning are powerful. Use them responsibly. === commands_reference === ~ instructor_rapport += 5 -Tech Instructor: Here's your essential commands quick reference: +Here's your essential commands quick reference: -Tech Instructor: **Navigation:** +Navigation: - pwd (print working directory) - ls, ls -la (list files, detailed) - cd directory (change directory) - cd .. (up one level), cd (home) -Tech Instructor: **File Operations:** +File Operations: - mkdir (make directory) - cp source dest (copy), cp -r (recursive) - mv old new (move/rename) @@ -826,25 +846,25 @@ Tech Instructor: **File Operations:** - less filename (scrollable view) - echo "text" (print text) -Tech Instructor: **Getting Help:** +Getting Help: - man command (manual page) - info command (info page) - command --help (quick help) -Tech Instructor: **Text Processing:** +Text Processing: - grep pattern (filter lines) - sort (sort lines) - uniq (remove duplicates) - head, tail (first/last lines) - wc -l (count lines) -Tech Instructor: **Networking:** +Networking: - ifconfig, ip a s (show interfaces) - hostname -I (show IP) - ssh user@host (remote shell) - ssh -X user@host (X11 forwarding) -Tech Instructor: **Security Tools:** +Security Tools: - hydra -l user -p pass target ssh (test SSH login) - hydra -l user -P wordlist target ssh (bruteforce SSH) @@ -858,28 +878,28 @@ Tech Instructor: **Security Tools:** === challenge_tips === ~ instructor_rapport += 5 -Tech Instructor: Practical tips for the hands-on challenges: +Practical tips for the hands-on challenges: -Tech Instructor: **For SSH practice:** +For SSH practice: - Verify fingerprints before accepting - Try both regular SSH and -X flag for X forwarding - Use "exit" or Ctrl-D to disconnect - Check "who" command to see who else is connected -Tech Instructor: **For Hydra attacks:** +For Hydra attacks: - Start with small, targeted wordlists from /usr/share/wordlists/seclists/Passwords/Common-Credentials/ - Use -t 4 for reasonable parallel connections - Be patient—online attacks are slow - Watch for successful login messages - Remember to actually SSH in once you crack credentials -Tech Instructor: **For finding flags:** +For finding flags: - Navigate to user home directories - Use "cat" to read files - Remember "sudo" lets you act as root (if you have permission) - Check file permissions with "ls -la" -Tech Instructor: **General advice:** +General advice: - Use Tab completion to save typing - Use up arrow to recall previous commands - If stuck, check man pages @@ -895,17 +915,17 @@ Tech Instructor: **General advice:** === ready_for_practice === ~ instructor_rapport += 5 -Tech Instructor: Excellent. You've covered the fundamentals. +Excellent. You've covered the fundamentals. {command_line_skills_discussed and piping_discussed and redirection_discussed and ssh_discussed and hydra_discussed: - Tech Instructor: You've reviewed all the core material. You should be well-prepared for the practical exercises. + You've reviewed all the core material. You should be well-prepared for the practical exercises. - else: - Tech Instructor: You might want to review the topics you haven't covered yet, but you've got enough to start. + You might want to review the topics you haven't covered yet, but you've got enough to start. } -Tech Instructor: Remember: the best way to learn Linux is by doing. Read the challenges, try commands, make mistakes, figure out fixes. That's how you build real competence. +Remember: the best way to learn Linux is by doing. Read the challenges, try commands, make mistakes, figure out fixes. That's how you build real competence. -Tech Instructor: Practical objectives: +Practical objectives: 1. Practice basic command-line navigation and file manipulation 2. Edit files with vi 3. Use piping and redirection @@ -913,13 +933,13 @@ Tech Instructor: Practical objectives: 5. Use Hydra to crack weak SSH credentials 6. Capture flags from compromised accounts -Tech Instructor: The lab environment is yours to experiment in. Break things. It's a safe space for learning. +The lab environment is yours to experiment in. Break things. It's a safe space for learning. {instructor_rapport >= 50: - Tech Instructor: You've asked great questions and engaged deeply with the material. That's exactly the right approach. You're going to do well. + You've asked great questions and engaged deeply with the material. That's exactly the right approach. You're going to do well. } -Tech Instructor: Good luck, Agent. You've got this. +Good luck, Agent. You've got this. -> end_session @@ -929,15 +949,63 @@ Tech Instructor: Good luck, Agent. You've got this. === end_session === -Tech Instructor: Whenever you need a refresher on Linux fundamentals, I'm here. +Whenever you need a refresher on Linux fundamentals, I'm here. {instructor_rapport >= 40: - Tech Instructor: You've demonstrated solid understanding and good security awareness. Keep that mindset. + You've demonstrated solid understanding and good security awareness. Keep that mindset. } -Tech Instructor: Now get to that terminal and start practicing. Theory is useful, but hands-on experience is how you actually learn. +Now get to that terminal and start practicing. Theory is useful, but hands-on experience is how you actually learn. -Tech Instructor: See you in the field, Agent. +See you in the field, Agent. #exit_conversation -> linux_training_hub + +// =========================================== +// FLAGS COMPLETED - CONGRATULATIONS +// =========================================== + +=== flags_completed_congrats === +~ instructor_rapport += 10 + +Excellent work, {player_name}! You've successfully completed all the VM lab exercises and captured all the flags. That demonstrates real competence with Linux security fundamentals. + +You've shown you can: +- Navigate Linux systems effectively +- Use SSH for remote access +- Perform security testing with tools like Hydra +- Escalate privileges when needed + +These are essential skills for field operations. + +I have an optional challenge for you, if you're interested. There's a lockpicking practice room. It's completely optional, but it's a useful field skill to learn. + +{has_key: + Here's the key to the lockpicking practice room. The locksmith inside can teach you the basics. + ~ lockpicking_key_received = true + #give_item:key + #unlock_aim:learn_lockpicking + #unlock_task:talk_to_locksmith + Good luck! It's a valuable skill to have. +- else: + I see you already have the key. Feel free to explore the lockpicking practice room if you're interested. + {not lockpicking_key_received: + ~ lockpicking_key_received = true + #unlock_aim:learn_lockpicking + #unlock_task:talk_to_locksmith + } +} + +-> flags_completed_followup + +=== flags_completed_followup === ++ [Tell me more about lockpicking] + Lockpicking is a physical security skill. In the field, you'll encounter locked doors, safes, and containers. Being able to pick locks gives you access without keys or forced entry. + + The locksmith in the practice room can teach you the fundamentals: applying tension with a wrench, and picking pins in binding order. It takes practice, but it's a skill worth learning. + -> flags_completed_followup ++ [Back to main menu] + -> linux_training_hub ++ [That's all I need] + -> end_session diff --git a/scenarios/lab_intro_linux/ink/instructor.json b/scenarios/lab_intro_linux/ink/instructor.json index 67b61a1..5a59656 100644 --- a/scenarios/lab_intro_linux/ink/instructor.json +++ b/scenarios/lab_intro_linux/ink/instructor.json @@ -1 +1 @@ -{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["ev",0,"/ev",{"VAR=":"instructor_rapport","re":true},"^Tech Instructor: Welcome to Linux Fundamentals and Security, Agent ","ev",{"VAR?":"player_name"},"out","/ev","^. I'm your technical instructor for this session.","\n","^Tech Instructor: This lab covers essential Linux command-line skills, remote administration via SSH, and basic penetration testing techniques. All crucial skills for field operations.","\n","^Tech Instructor: Think of this as building your foundational toolkit. Every SAFETYNET agent needs to be comfortable in Linux environments—most of our targets run Linux servers, and Kali Linux is our primary offensive platform.","\n","#","^complete_task:talk_to_instructor","/#",{"->":"linux_training_hub"},null],"linux_training_hub":[["^Tech Instructor: What would you like to cover?","\n","ev","str","^Learn about Linux basics and why it matters","/str",{"VAR?":"linux_basics_discussed"},"!","/ev",{"*":".^.c-0","flg":5},"ev","str","^Essential command-line skills","/str",{"VAR?":"command_line_skills_discussed"},"!","/ev",{"*":".^.c-1","flg":5},"ev","str","^Learn the vi editor","/str",{"VAR?":"vi_editor_discussed"},"!","/ev",{"*":".^.c-2","flg":5},"ev","str","^Piping between programs","/str",{"VAR?":"piping_discussed"},"!","/ev",{"*":".^.c-3","flg":5},"ev","str","^Redirecting input and output","/str",{"VAR?":"redirection_discussed"},"!","/ev",{"*":".^.c-4","flg":5},"ev","str","^Basic Linux networking","/str",{"VAR?":"networking_discussed"},"!","/ev",{"*":".^.c-5","flg":5},"ev","str","^Introduction to Kali Linux","/str",{"VAR?":"kali_intro_discussed"},"!","/ev",{"*":".^.c-6","flg":5},"ev","str","^Remote shell access with SSH","/str",{"VAR?":"ssh_discussed"},"!","/ev",{"*":".^.c-7","flg":5},"ev","str","^Attacking SSH with Hydra","/str",{"VAR?":"hydra_discussed"},"!","/ev",{"*":".^.c-8","flg":5},"ev","str","^Show me the essential commands reference","/str",{"VAR?":"linux_basics_discussed"},{"VAR?":"command_line_skills_discussed"},"&&","/ev",{"*":".^.c-9","flg":5},"ev","str","^Tips for the hands-on challenges","/str",{"VAR?":"ssh_discussed"},{"VAR?":"hydra_discussed"},"||","/ev",{"*":".^.c-10","flg":5},"ev","str","^I'm ready to start the practical exercises","/str","/ev",{"*":".^.c-11","flg":4},"ev","str","^That's all I need for now","/str","/ev",{"*":".^.c-12","flg":4},{"c-0":["\n",{"->":"linux_basics_intro"},null],"c-1":["\n",{"->":"command_line_skills"},null],"c-2":["\n",{"->":"vi_editor_intro"},null],"c-3":["\n",{"->":"piping_intro"},null],"c-4":["\n",{"->":"redirection_intro"},null],"c-5":["\n",{"->":"networking_basics"},null],"c-6":["\n",{"->":"kali_intro"},null],"c-7":["\n",{"->":"ssh_intro"},null],"c-8":["\n",{"->":"hydra_intro"},null],"c-9":["\n",{"->":"commands_reference"},null],"c-10":["\n",{"->":"challenge_tips"},null],"c-11":["\n",{"->":"ready_for_practice"},null],"c-12":["\n",{"->":"end_session"},null]}],null],"linux_basics_intro":[["ev",true,"/ev",{"VAR=":"linux_basics_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Excellent starting point. Let me explain why Linux matters for security work.","\n","^Tech Instructor: Linux is the backbone of modern internet infrastructure. Google, Facebook, Amazon—they all run Linux servers at massive scale. When you're conducting penetration tests or investigating security incidents, you'll encounter Linux systems constantly.","\n","^Tech Instructor: More importantly for us, the best security tools are Linux-native. Kali Linux contains hundreds of specialized tools for penetration testing, forensics, and security analysis. Mastering Linux means mastering your toolkit.","\n","^Tech Instructor: Linux comes in many \"distributions\"—different flavors packaged for different purposes. Ubuntu for ease of use, Debian for stability, Kali for security testing. They all share the same core commands and concepts, so learning one helps you understand them all.","\n","ev","str","^Why not just use Windows?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What makes Kali special?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Got it, let's move on","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",{"VAR?":"deep_dives_completed"},1,"+",{"VAR=":"deep_dives_completed","re":true},"/ev","^You: Why can't we just use Windows for security work?","\n",{"->":"windows_comparison"},{"#f":5}],"c-1":["\n","ev",{"VAR?":"deep_dives_completed"},1,"+",{"VAR=":"deep_dives_completed","re":true},"/ev","^You: What specifically makes Kali Linux the industry standard?","\n",{"->":"kali_explanation"},{"#f":5}],"c-2":["\n","^You: Understood. Linux is essential for security work.","\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"windows_comparison":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Fair question. Windows absolutely has its place—many enterprise environments are Windows-heavy, and you'll need those skills too.","\n","^Tech Instructor: But for offensive security work, Linux has three major advantages:","\n","^Tech Instructor: **First**, the tools. Most cutting-edge security research happens in the open-source community, and those tools are Linux-first. Sure, some get ported to Windows eventually, but you'll always be behind the curve.","\n","^Tech Instructor: **Second**, the control. Linux gives you deep system access and transparency. You can see exactly what's happening, modify anything, and automate everything. That level of control is crucial when you're trying to exploit systems or analyze malware.","\n","^Tech Instructor: **Third**, the culture. The security community lives in Linux. Understanding Linux means understanding how other security professionals work, communicate, and share knowledge.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"kali_explanation":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Kali is essentially a curated arsenal of security tools, all pre-configured and ready to use.","\n","^Tech Instructor: Offensive Security—the company behind Kali—maintains hundreds of tools across every category: information gathering, vulnerability analysis, wireless attacks, exploitation, post-exploitation, forensics, you name it.","\n","^Tech Instructor: What makes Kali special isn't just the tools, though. It's the integration. Everything works together. The tools are kept up-to-date. Documentation is solid. And it's become the lingua franca of penetration testing—when security professionals share techniques, they assume you're using Kali.","\n","^Tech Instructor: Think of it like this: you *could* build your own toolkit from scratch, hunting down each tool individually and figuring out dependencies. Or you could use Kali and get straight to the actual security work.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"command_line_skills":[["ev",true,"/ev",{"VAR=":"command_line_skills_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Right, let's build your command-line fundamentals. These are skills you'll use every single day in the field.","\n","^Tech Instructor: The command line might seem archaic compared to graphical interfaces, but it's exponentially more powerful. You can automate tasks, chain commands together, work on remote systems, and handle massive datasets—all from a simple text interface.","\n","^Tech Instructor: I'll cover the essential commands: navigating the filesystem, manipulating files and directories, viewing content, and getting help when you're stuck.","\n","ev","str","^Show me the navigation commands","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How do I work with files?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^How do I get help when stuck?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^I want to see the full command reference","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"pwd_ls_discussed","re":true},"^You: How do I navigate the filesystem?","\n",{"->":"navigation_commands"},{"#f":5}],"c-1":["\n","ev",true,"/ev",{"VAR=":"file_manipulation_discussed","re":true},"^You: What about creating and editing files?","\n",{"->":"file_manipulation"},{"#f":5}],"c-2":["\n","ev",true,"/ev",{"VAR=":"man_pages_discussed","re":true},"^You: What if I don't know what a command does?","\n",{"->":"man_pages"},{"#f":5}],"c-3":["\n","^You: Can I see a complete list of essential commands?","\n",{"->":"commands_reference"},{"#f":5}]}],null],"navigation_commands":[["ev",{"VAR?":"instructor_rapport"},3,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Navigation is your foundation. Here are the essentials:","\n","^Tech Instructor: **pwd** - \"print working directory\". Shows exactly where you are in the filesystem. Lost? Run pwd.","\n","^Tech Instructor: **ls** - lists files in your current directory. Add \"-la\" for detailed information including hidden files and permissions. You'll use \"ls -la\" constantly.","\n","^Tech Instructor: **cd** - \"change directory\". Moves you around the filesystem. \"cd ..\" goes up one level, \"cd\" alone takes you home.","\n","^Tech Instructor: Pro tip: pressing Tab autocompletes filenames and commands. Type a few letters, hit Tab, save yourself endless typing. And use the up arrow to cycle through previous commands.","\n","ev","str","^Tell me more about ls flags","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What about hidden files?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Got it","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: What other useful flags does ls have?","\n","^Tech Instructor: Great question. \"ls -lt\" sorts by modification time, newest first. \"ls -lh\" shows human-readable file sizes. \"ls -lR\" recursively lists subdirectories. You can combine them: \"ls -lhta\" shows all files, human-readable sizes, sorted by time.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-1":["\n","^You: What are hidden files?","\n","^Tech Instructor: In Linux, files starting with \".\" are hidden—they don't show up in normal ls output. Configuration files are typically hidden. Use \"ls -a\" to see them. You'll frequently need to examine hidden config files during security assessments.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-2":["\n",{"->":"command_line_followup"},{"#f":5}]}],null],"command_line_followup":[["ev","str","^Show me file manipulation commands","/str","/ev",{"*":".^.c-0","flg":4},"ev","str","^How do I get help when stuck?","/str","/ev",{"*":".^.c-1","flg":4},"ev","str","^Back to the main menu","/str","/ev",{"*":".^.c-2","flg":4},{"c-0":["\n",{"->":"file_manipulation"},null],"c-1":["\n",{"->":"man_pages"},null],"c-2":["\n",{"->":"linux_training_hub"},null]}],null],"file_manipulation":[["ev",{"VAR?":"instructor_rapport"},3,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Creating, copying, moving, and viewing files. Bread and butter stuff.","\n","^Tech Instructor: **mkdir** - creates directories. \"mkdir mydir\" creates a new folder.","\n","^Tech Instructor: **cp** - copies files. \"cp source destination\" copies a file. Add \"-r\" for recursive directory copying.","\n","^Tech Instructor: **mv** - moves or renames files. \"mv oldname newname\" renames. \"mv file /path/to/destination/\" moves it.","\n","^Tech Instructor: **cat** - dumps file contents to the screen. \"cat filename\" shows the whole file.","\n","^Tech Instructor: **echo** - prints text. \"echo 'hello world'\" displays text. Useful for testing and scripting.","\n","ev","str","^Tell me more about viewing files","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What about creating files?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Understood","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: Cat seems limited for large files...","\n","^Tech Instructor: Exactly right. For large files, use **less**. \"less filename\" lets you scroll through, search with \"/\", quit with \"q\". Much more practical than cat for big files.","\n","ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-1":["\n","^You: How do I create a new empty file?","\n","^Tech Instructor: Several ways. \"touch filename\" creates an empty file. Or redirect output: \"echo 'content' > filename\" creates a file with content. We'll cover redirection shortly.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-2":["\n",{"->":"command_line_followup"},{"#f":5}]}],null],"man_pages":[["ev",true,"/ev",{"VAR=":"man_pages_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: This is possibly the most important skill: learning to teach yourself.","\n","^Tech Instructor: **man** - the manual pages. \"man command\" shows comprehensive documentation for any command. Navigation: space to page down, \"b\" to page up, \"/\" to search, \"q\" to quit.","\n","^Tech Instructor: Example: \"man ls\" shows every flag and option for ls. The man pages are detailed, sometimes overwhelming, but they're authoritative.","\n","^Tech Instructor: Alternative: **info** command provides similar documentation, sometimes more detailed.","\n","^Tech Instructor: Pro tip: if you're really stuck, try \"command --help\" for a quick summary. Many tools also have online documentation, but man pages are always available, even when you're offline on a compromised system with no internet.","\n","ev","str","^How do I search man pages?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What if man pages are too dense?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Makes sense","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: Can I search across all man pages for a topic?","\n","^Tech Instructor: Yes. \"man -k keyword\" searches all man page descriptions. \"apropos keyword\" does the same thing. Useful when you know what you want to do but not which command does it.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-1":["\n","^You: Man pages can be pretty technical...","\n","^Tech Instructor: True. For beginner-friendly explanations, try \"tldr command\"—it shows simplified examples. Or search online for \"command examples\". But learning to parse man pages is a skill worth developing. They're accurate, complete, and always available.","\n","ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-2":["\n",{"->":"command_line_followup"},{"#f":5}]}],null],"vi_editor_intro":[["ev",true,"/ev",{"VAR=":"vi_editor_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Ah, vi. The editor that's been causing both frustration and devotion since 1976.","\n","^Tech Instructor: Here's why you need to know vi: it's on *every* Unix and Linux system. When you SSH into a compromised server with minimal tools, vi will be there. Other editors might not be.","\n","^Tech Instructor: Vi is modal. Two main modes: **normal mode** for commands, **insert mode** for typing text.","\n","^Tech Instructor: The essentials:","\n",["^\"vi filename\" opens or creates a file","\n",["^Press \"i\" to enter insert mode (now you can type)","\n",["^Press Esc to return to normal mode","\n",["^In normal mode: \":wq\" writes and quits, \":q!\" quits without saving","\n","^Tech Instructor: That's literally everything you need to survive vi.","\n","ev","str","^Tell me more about normal mode commands","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Why not use nano or another editor?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^I'll learn the basics","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",{"VAR?":"deep_dives_completed"},1,"+",{"VAR=":"deep_dives_completed","re":true},"/ev","^You: What else can I do in normal mode?","\n",{"->":"vi_advanced_commands"},{"#f":5}],"c-1":["\n","^You: Why not just use nano? It seems simpler.","\n","^Tech Instructor: Nano is fine for quick edits. But vi is universal and powerful. On hardened systems or embedded devices, vi might be your only option. Plus, once you learn it, vi is dramatically faster. Your call, but I recommend at least learning vi basics.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"vi_editor_followup"},{"#f":5}],"c-2":["\n","ev",true,"/ev",{"VAR=":"completed_vi_challenge","re":true},"^You: Got it. I'll practice the essential commands.","\n",{"->":"vi_editor_followup"},{"#f":5}],"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"vi_advanced_commands":[["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Want to unlock vi's power? Here are some favorites:","\n","^Tech Instructor: **Navigation in normal mode:**","\n",["^\"h\" \"j\" \"k\" \"l\" move cursor left, down, up, right","\n",["^\"w\" jumps forward by word, \"b\" jumps back","\n",["^\"gg\" jumps to start of file, \"G\" jumps to end","\n","^Tech Instructor: **Editing in normal mode:**","\n",["^\"dd\" deletes current line","\n",["^\"30dd\" deletes 30 lines","\n",["^\"yy\" copies (yanks) current line","\n",["^\"p\" pastes","\n",["^\"u\" undo","\n",["^\"/\" searches, \"n\" finds next match","\n","^Tech Instructor: You can combine commands: \"d10j\" deletes 10 lines down. \"c3w\" changes next 3 words.","\n","^Tech Instructor: Ten minutes with a vi tutorial will make you look like a wizard. It's worth it.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"vi_editor_followup"},{"#n":"g-8"}],{"#n":"g-7"}],{"#n":"g-6"}],{"#n":"g-5"}],{"#n":"g-4"}],{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"vi_editor_followup":[["ev","str","^Back to main menu","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"linux_training_hub"},null]}],null],"piping_intro":[["ev",true,"/ev",{"VAR=":"piping_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Piping is where Linux becomes genuinely powerful. You can chain simple commands together to accomplish complex tasks.","\n","^Tech Instructor: The pipe operator sends the output of one command to the input of another.","\n","^Tech Instructor: Example command: cat /etc/passwd, then pipe to grep /home/","\n","^Tech Instructor: This reads the passwd file and filters it to only lines containing \"/home/\". Two simple commands, combined to do something useful.","\n","^Tech Instructor: You can chain multiple pipes: cat /etc/passwd, pipe to grep /home/, then pipe to sort -r. Now it's filtered *and* sorted in reverse.","\n","ev","str","^Show me more examples","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What commands work well with pipes?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^I've got the concept","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"piping_examples_discussed","re":true},"^You: What are some practical piping examples?","\n",{"->":"piping_examples"},{"#f":5}],"c-1":["\n","^You: Which commands are commonly piped together?","\n",{"->":"piping_common_commands"},{"#f":5}],"c-2":["\n","ev",true,"/ev",{"VAR=":"completed_piping_challenge","re":true},{"->":"linux_training_hub"},{"#f":5}]}],null],"piping_examples":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Here are real-world examples you'll use constantly:","\n","^Tech Instructor: **Finding running processes:**","\n","^Command: ps aux, pipe to grep ssh. This lists all processes and filters for SSH-related ones.","\n","^Tech Instructor: **Analyzing logs:**","\n","^Command: cat logfile, pipe to grep ERROR, pipe to sort, pipe to uniq -c, pipe to sort -nr. This finds errors, sorts them, counts unique occurrences, sorts by frequency. One line, powerful analysis.","\n","^Tech Instructor: **Network analysis:**","\n","^Command: netstat -an, pipe to grep ESTABLISHED. This shows active network connections.","\n","^Tech Instructor: **Counting things:**","\n","^Command: ls, pipe to wc -l. This counts files in current directory.","\n","^Tech Instructor: The Unix philosophy: small tools that do one thing well, combined creatively. Piping is how you combine them.","\n","ev",true,"/ev",{"VAR=":"completed_piping_challenge","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"piping_common_commands":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Commands that work brilliantly in pipes:","\n","^Tech Instructor: **grep** - filters lines matching a pattern. Your most-used pipe command.","\n","^Tech Instructor: **sort** - sorts lines alphabetically. \"-n\" for numeric sort, \"-r\" for reverse.","\n","^Tech Instructor: **uniq** - removes duplicate adjacent lines. Usually used after sort. \"-c\" counts occurrences.","\n","^Tech Instructor: **head** and **tail** - show first or last N lines. \"head -20\" shows first 20 lines.","\n","^Tech Instructor: **wc** - word count. \"-l\" counts lines, \"-w\" counts words, \"-c\" counts characters.","\n","^Tech Instructor: **cut** - extracts columns from text. \"cut -d: -f1\" splits on colons, takes first field.","\n","^Tech Instructor: **awk** and **sed** - powerful text processing. More advanced, but incredibly useful.","\n","^Tech Instructor: Learn these, and you can process massive datasets from the command line.","\n","ev",true,"/ev",{"VAR=":"completed_piping_challenge","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"redirection_intro":[["ev",true,"/ev",{"VAR=":"redirection_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Redirection lets you send command output to files or read input from files.","\n","^Tech Instructor: Three key operators:","\n","^Tech Instructor: **>** - redirects output to a file, overwriting it. \"ls > filelist.txt\" saves directory listing to a file.","\n","^Tech Instructor: **>>** - redirects output to a file, appending. \"echo 'new line' >> file.txt\" adds to the end.","\n","^Tech Instructor: **<** - reads input from a file. \"wc -l < file.txt\" counts lines in the file.","\n","^Tech Instructor: Practical example: \"ps aux > processes.txt\" saves a snapshot of running processes for analysis.","\n","ev","str","^Show me more redirection examples","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What about error messages?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Understood","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"redirection_examples_discussed","re":true},"^You: What are some practical redirection scenarios?","\n",{"->":"redirection_examples"},{"#f":5}],"c-1":["\n","^You: Can I redirect error messages too?","\n",{"->":"stderr_redirection"},{"#f":5}],"c-2":["\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"redirection_examples":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Practical redirection scenarios:","\n","^Tech Instructor: **Saving command output for later:**","\n","^\"ifconfig > network_config.txt\" - captures network configuration.","\n","^Tech Instructor: **Building logs:**","\n","^\"echo '$(date): Scan completed' >> scan_log.txt\" - appends timestamped entries.","\n","^Tech Instructor: **Combining with pipes:**","\n","^Command: cat /etc/passwd, pipe to grep /home/, redirect to users.txt. This filters and saves results.","\n","^Tech Instructor: **Quick file creation:**","\n","^\"echo 'test content' > test.txt\" - creates a file with content in one command.","\n","^Tech Instructor: During security assessments, you'll constantly redirect command output to files for documentation and later analysis.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"stderr_redirection":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Good catch. There are actually two output streams: stdout (standard output) and stderr (standard error).","\n","^Tech Instructor: By default, \">\" only redirects stdout. Error messages still appear on screen.","\n","^Tech Instructor: To redirect stderr: \"command 2> errors.txt\"","\n","^Tech Instructor: To redirect both: \"command > output.txt 2>&1\" - sends stderr to stdout, which goes to the file.","\n","^Tech Instructor: Or in modern Bash: \"command &> output.txt\" does the same thing more simply.","\n","^Tech Instructor: To discard output entirely: \"command > /dev/null 2>&1\" - sends everything to the void.","\n","^Tech Instructor: This is advanced stuff, but incredibly useful when scripting or when you want clean output.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"networking_basics":[["ev",true,"/ev",{"VAR=":"networking_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Linux networking commands. Essential for understanding network configurations and troubleshooting connectivity.","\n","^Tech Instructor: **ifconfig** - the classic command to view network interfaces and IP addresses. Shows all your network adapters.","\n","^Tech Instructor: **ip** - the modern replacement. \"ip a s\" (ip address show) does the same thing. You'll see both used in the field.","\n","^Tech Instructor: **hostname -I** - quick way to display just your IP address.","\n","^Tech Instructor: In our environment, your IP typically starts with \"172.22\" or \"10\" - those are private network ranges.","\n","ev","str","^Tell me more about network interfaces","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How do I troubleshoot network issues?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^What about finding other machines?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Got it","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"ifconfig_discussed","re":true},"^You: What are network interfaces exactly?","\n",{"->":"network_interfaces"},{"#f":5}],"c-1":["\n","^You: What if my network isn't working?","\n",{"->":"network_troubleshooting"},{"#f":5}],"c-2":["\n","^You: How do I discover other systems on the network?","\n","^Tech Instructor: Good question, but that's scanning territory. We'll cover tools like nmap in the scanning module. For now, focus on understanding your own network configuration.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},{"#f":5}],"c-3":["\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"network_interfaces":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Network interfaces are how your computer connects to networks. Think of them as connection points.","\n","^Tech Instructor: **eth0, eth1** - Ethernet interfaces. Physical network ports.","\n","^Tech Instructor: **wlan0** - Wireless interface. WiFi adapter.","\n","^Tech Instructor: **lo** - Loopback interface, always 127.0.0.1. Your computer talking to itself. Useful for testing.","\n","^Tech Instructor: **Virtual interfaces** - VPNs and containers create virtual interfaces like tun0, tap0, docker0.","\n","^Tech Instructor: When you run ifconfig, you see all interfaces, their IP addresses, MAC addresses, and traffic statistics. Essential information for network security assessments.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"network_troubleshooting":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Basic network troubleshooting steps:","\n","^Tech Instructor: **Step 1:** Check interface status with \"ifconfig\" or \"ip a s\". Is the interface up? Does it have an IP?","\n","^Tech Instructor: **Step 2:** If no IP, try \"dhclient eth0\" to request one from DHCP server.","\n","^Tech Instructor: **Step 3:** Test local connectivity: \"ping 127.0.0.1\" tests your network stack.","\n","^Tech Instructor: **Step 4:** Test gateway: \"ping your_gateway_ip\" tests local network.","\n","^Tech Instructor: **Step 5:** Test DNS: \"ping google.com\" tests name resolution and external connectivity.","\n","^Tech Instructor: In our lab environment, if you're having issues, usually dhclient fixes it. In the field, troubleshooting can be much more complex.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"kali_intro":[["ev",true,"/ev",{"VAR=":"kali_intro_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Kali Linux. Your primary offensive security platform.","\n","^Tech Instructor: Released by Offensive Security in 2013 as the successor to BackTrack Linux. It's specifically designed for penetration testing, security auditing, and digital forensics.","\n","^Tech Instructor: Kali includes hundreds of pre-installed tools organized by category: information gathering, vulnerability analysis, wireless attacks, web applications, exploitation tools, password attacks, forensics, and more.","\n","^Tech Instructor: Default credentials: username \"kali\", password \"kali\". Never use Kali as your primary OS—it's designed for security testing, not everyday computing.","\n","ev","str","^Show me what tools are available","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How is Kali organized?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Sounds powerful","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: What kinds of tools are we talking about?","\n",{"->":"kali_tools_overview"},{"#f":5}],"c-1":["\n","^You: How do I find the right tool for a task?","\n",{"->":"kali_organization"},{"#f":5}],"c-2":["\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"kali_tools_overview":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Let me give you a taste of what's available:","\n","^Tech Instructor: **Information Gathering:** nmap, dnsenum, whois, recon-ng. Tools for mapping networks and gathering intelligence.","\n","^Tech Instructor: **Vulnerability Analysis:** Nessus, OpenVAS, nikto. Automated scanners that identify security weaknesses.","\n","^Tech Instructor: **Exploitation:** Metasploit Framework, BeEF, sqlmap. Tools for actively exploiting vulnerabilities.","\n","^Tech Instructor: **Password Attacks:** Hydra, John the Ripper, hashcat. Cracking and bruteforcing credentials.","\n","^Tech Instructor: **Wireless Attacks:** Aircrack-ng, Reaver, Wifite. WiFi security testing.","\n","^Tech Instructor: **Forensics:** Autopsy, Sleuth Kit, Volatility. Analyzing systems and recovering data.","\n","^Tech Instructor: And those are just highlights. Run \"ls /usr/bin\" to see hundreds more. It's an arsenal.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"kali_organization":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Kali organizes tools by the penetration testing lifecycle:","\n","^Tech Instructor: **Phase 1 - Information Gathering:** Passive and active reconnaissance. Learning about your target.","\n","^Tech Instructor: **Phase 2 - Vulnerability Analysis:** Identifying weaknesses in systems and applications.","\n","^Tech Instructor: **Phase 3 - Exploitation:** Actually compromising systems using identified vulnerabilities.","\n","^Tech Instructor: **Phase 4 - Post-Exploitation:** What you do after gaining access. Maintaining access, pivoting, data exfiltration.","\n","^Tech Instructor: The Applications menu mirrors this structure. When you need a tool, think about which phase you're in, and browse that category.","\n","^Tech Instructor: You'll also quickly learn the handful of tools you use constantly. Nmap, Metasploit, Burp Suite, Wireshark—these become second nature.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"ssh_intro":[["ev",true,"/ev",{"VAR=":"ssh_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: SSH - Secure Shell. Encrypted remote access to systems. One of your most critical tools.","\n","^Tech Instructor: SSH lets you securely connect to remote Linux systems and execute commands as if you were sitting at that machine. All traffic is encrypted, protecting against eavesdropping.","\n","^Tech Instructor: Basic usage: \"ssh username@ip_address\"","\n","^Tech Instructor: The server typically listens on port 22. When you connect, you authenticate (usually with password or key), and then you have a remote shell.","\n","^Tech Instructor: SSH replaced older, insecure protocols like Telnet and rlogin, which transmitted passwords in cleartext. Never use those—always use SSH.","\n","ev","str","^Tell me about SSH keys","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What's X11 forwarding?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^How do I verify I'm connecting to the right server?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Let's talk about attacking SSH","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Got the basics","/str","/ev",{"*":".^.c-4","flg":20},{"c-0":["\n","^You: What about SSH key authentication?","\n",{"->":"ssh_keys"},{"#f":5}],"c-1":["\n","ev",true,"/ev",{"VAR=":"ssh_x_forwarding_discussed","re":true},"^You: I saw something about -X flag for forwarding?","\n",{"->":"ssh_x_forwarding"},{"#f":5}],"c-2":["\n","^You: How do I know I'm not being man-in-the-middled?","\n",{"->":"ssh_fingerprints"},{"#f":5}],"c-3":["\n","^You: How do we test SSH security?","\n",{"->":"ssh_to_hydra_transition"},{"#f":5}],"c-4":["\n","ev",true,"/ev",{"VAR=":"completed_ssh_challenge","re":true},{"->":"linux_training_hub"},{"#f":5}]}],null],"ssh_keys":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: SSH keys are asymmetric cryptography for authentication. Much more secure than passwords.","\n","^Tech Instructor: You generate a key pair: a private key (keep secret) and public key (share freely).","\n","^Tech Instructor: Generate keys: \"ssh-keygen -t rsa -b 4096\"","\n","^Tech Instructor: Copy public key to server: \"ssh-copy-id user@server\"","\n","^Tech Instructor: Now you can SSH without typing passwords. The private key proves your identity.","\n","^Tech Instructor: Benefits: stronger than passwords, can't be bruteforced, can be passphrase-protected, can be revoked per-server.","\n","^Tech Instructor: Many organizations require key-based auth and disable password authentication entirely. Learn this workflow.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"ssh_intro"},null],"ssh_x_forwarding":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: X11 forwarding is clever. Linux graphical applications use the X Window System. SSH can tunnel X11 traffic.","\n","^Tech Instructor: Connect with: \"ssh -X user@server\"","\n","^Tech Instructor: Now you can run graphical programs on the remote server, but see them on your local screen. The program runs remotely, but displays locally.","\n","^Tech Instructor: Example: \"kate\" opens the text editor, running on the remote system but displaying on yours. Useful for accessing GUI tools remotely.","\n","^Tech Instructor: Warning: some latency over networks. And it does expose some security risks—only use on trusted connections.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"ssh_intro"},null],"ssh_fingerprints":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Excellent security awareness. SSH uses host key fingerprints to prevent man-in-the-middle attacks.","\n","^Tech Instructor: When you first connect, SSH shows the server's fingerprint. You should verify this matches the real server before accepting.","\n","^Tech Instructor: On the server, check fingerprint: \"ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub\"","\n","^Tech Instructor: If the fingerprint matches what SSH showed you, type \"yes\". SSH remembers this and will warn if it changes later.","\n","^Tech Instructor: If the fingerprint changes unexpectedly, that's a warning sign. Could be a man-in-the-middle attack, or could be the server was rebuilt. Investigate before proceeding.","\n","^Tech Instructor: Most people skip this check. Don't be most people. Especially in adversarial security contexts.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"ssh_intro"},null],"ssh_to_hydra_transition":["^Tech Instructor: Now you're thinking like a penetration tester. Let's talk about attacking SSH.","\n",{"->":"hydra_intro"},null],"hydra_intro":[["ev",true,"/ev",{"VAR=":"hydra_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Hydra. THC-Hydra, to be specific. A parallelized login cracker supporting numerous protocols.","\n","^Tech Instructor: Hydra performs **online bruteforce attacks**—it actually tries to log in with username/password combinations. Different from offline attacks where you crack hashed passwords.","\n","^Tech Instructor: Basic usage: \"hydra -l username -p password target ssh\"","\n","^Tech Instructor: Tests a single username/password combo. But Hydra's power is testing many combinations from wordlists.","\n","^Tech Instructor: Supports dozens of protocols: SSH, FTP, HTTP, RDP, SMB, databases, and more. If it accepts login credentials, Hydra can probably attack it.","\n","ev","str","^How do I use wordlists?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How fast is Hydra?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^What are the legal/ethical considerations?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^I'm ready to try it","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"bruteforce_basics_discussed","re":true},"^You: How do I test multiple passwords?","\n",{"->":"hydra_wordlists"},{"#f":5}],"c-1":["\n","^You: How quickly can it crack passwords?","\n",{"->":"hydra_speed"},{"#f":5}],"c-2":["\n","^You: Is this legal to use?","\n",{"->":"hydra_ethics"},{"#f":5}],"c-3":["\n","ev",true,"/ev",{"VAR=":"completed_hydra_challenge","re":true},{"->":"linux_training_hub"},{"#f":5}]}],null],"hydra_wordlists":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Wordlists are the fuel for Hydra. Collections of common passwords to test.","\n","^Tech Instructor: Usage: \"hydra -l username -P /path/to/wordlist.txt target ssh\"","\n","^Tech Instructor: Capital -P for password list, lowercase -l for single username. Or use -L for username list too.","\n","^Tech Instructor: Kali includes wordlists: \"ls /usr/share/wordlists/seclists/Passwords/\"","\n","^Tech Instructor: **Choosing the right wordlist is critical.** A wordlist with 10 million passwords might take days for online attacks. Start with smaller, curated lists of common passwords.","\n","^Tech Instructor: For SSH specifically, \"Common-Credentials\" lists work well. They contain default passwords and common weak passwords.","\n","^Tech Instructor: Real-world advice: online attacks are slow and noisy. They generate logs. They trigger intrusion detection. Use them strategically, not as your first approach.","\n","ev",true,"/ev",{"VAR=":"completed_hydra_challenge","re":true},"ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"hydra_speed":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Speed depends on many factors: network latency, server response time, number of parallel connections.","\n","^Tech Instructor: Hydra's \"-t\" flag controls parallel tasks. \"hydra -t 4\" uses 4 parallel connections.","\n","^Tech Instructor: More isn't always better. Too many parallel connections can crash services or trigger rate limiting. For SSH, 4-16 threads is usually reasonable.","\n","^Tech Instructor: Realistic expectations: online SSH bruteforce might test 10-50 passwords per second. Against a wordlist with 10,000 passwords, that's several minutes at best.","\n","^Tech Instructor: Compare to offline cracking (like hashcat on GPUs), which can test billions of passwords per second. Online attacks are fundamentally slower.","\n","^Tech Instructor: Strategic implication: online attacks work best when you have good intelligence. If you know username is \"admin\" and password is probably from a short list of defaults, Hydra excels. Blind bruteforce against random accounts? Impractical.","\n","ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"hydra_ethics":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Critical question. Shows good judgment.","\n","^Tech Instructor: **Legal status:** Hydra itself is legal to possess and use in authorized security testing. Unauthorized use against systems you don't own or have explicit permission to test? That's computer fraud. Felony-level crime in most jurisdictions.","\n","^Tech Instructor: **In this training:** You're attacking lab systems we control, with explicit permission. This is legal and ethical training.","\n","^Tech Instructor: **In SAFETYNET operations:** You'll have authorization for your targets. Still legally gray area, but covered by classified operational authorities.","\n","^Tech Instructor: **In the real world:** Never, ever use these tools against systems without written authorization. Penetration testers get contracts. Bug bounty hunters follow program rules. Hobbyists practice in their own isolated labs.","\n","^Tech Instructor: The skills you're learning are powerful. Use them responsibly. With authorization. Within the law. That's not optional—it's core to professional security work.","\n","ev",{"VAR?":"instructor_rapport"},15,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"commands_reference":[["ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Here's your essential commands quick reference:","\n","^Tech Instructor: **Navigation:**","\n",["^pwd (print working directory)","\n",["^ls, ls -la (list files, detailed)","\n",["^cd directory (change directory)","\n",["^cd .. (up one level), cd (home)","\n","^Tech Instructor: **File Operations:**","\n",["^mkdir (make directory)","\n",["^cp source dest (copy), cp -r (recursive)","\n",["^mv old new (move/rename)","\n",["^cat filename (display file)","\n",["^less filename (scrollable view)","\n",["^echo \"text\" (print text)","\n","^Tech Instructor: **Getting Help:**","\n",["^man command (manual page)","\n",["^info command (info page)","\n",["^command --help (quick help)","\n","^Tech Instructor: **Text Processing:**","\n",["^grep pattern (filter lines)","\n",["^sort (sort lines)","\n",["^uniq (remove duplicates)","\n",["^head, tail (first/last lines)","\n",["^wc -l (count lines)","\n","^Tech Instructor: **Networking:**","\n",["^ifconfig, ip a s (show interfaces)","\n",["^hostname -I (show IP)","\n",["^ssh user@host (remote shell)","\n",["^ssh -X user@host (X11 forwarding)","\n","^Tech Instructor: **Security Tools:**","\n",["^hydra -l user -p pass target ssh (test SSH login)","\n",["^hydra -l user -P wordlist target ssh (bruteforce SSH)","\n","ev","str","^Back to main menu","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"linux_training_hub"},null],"#n":"g-23"}],{"#n":"g-22"}],{"#n":"g-21"}],{"#n":"g-20"}],{"#n":"g-19"}],{"#n":"g-18"}],{"#n":"g-17"}],{"#n":"g-16"}],{"#n":"g-15"}],{"#n":"g-14"}],{"#n":"g-13"}],{"#n":"g-12"}],{"#n":"g-11"}],{"#n":"g-10"}],{"#n":"g-9"}],{"#n":"g-8"}],{"#n":"g-7"}],{"#n":"g-6"}],{"#n":"g-5"}],{"#n":"g-4"}],{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"challenge_tips":[["ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Practical tips for the hands-on challenges:","\n","^Tech Instructor: **For SSH practice:**","\n",["^Verify fingerprints before accepting","\n",["^Try both regular SSH and -X flag for X forwarding","\n",["^Use \"exit\" or Ctrl-D to disconnect","\n",["^Check \"who\" command to see who else is connected","\n","^Tech Instructor: **For Hydra attacks:**","\n",["^Start with small, targeted wordlists from /usr/share/wordlists/seclists/Passwords/Common-Credentials/","\n",["^Use -t 4 for reasonable parallel connections","\n",["^Be patient—online attacks are slow","\n",["^Watch for successful login messages","\n",["^Remember to actually SSH in once you crack credentials","\n","^Tech Instructor: **For finding flags:**","\n",["^Navigate to user home directories","\n",["^Use \"cat\" to read files","\n",["^Remember \"sudo\" lets you act as root (if you have permission)","\n",["^Check file permissions with \"ls -la\"","\n","^Tech Instructor: **General advice:**","\n",["^Use Tab completion to save typing","\n",["^Use up arrow to recall previous commands","\n",["^If stuck, check man pages","\n",["^Take notes on what works","\n","ev","str","^Back to main menu","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"linux_training_hub"},null],"#n":"g-16"}],{"#n":"g-15"}],{"#n":"g-14"}],{"#n":"g-13"}],{"#n":"g-12"}],{"#n":"g-11"}],{"#n":"g-10"}],{"#n":"g-9"}],{"#n":"g-8"}],{"#n":"g-7"}],{"#n":"g-6"}],{"#n":"g-5"}],{"#n":"g-4"}],{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"ready_for_practice":["ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Tech Instructor: Excellent. You've covered the fundamentals.","\n","ev",{"VAR?":"command_line_skills_discussed"},{"VAR?":"piping_discussed"},"&&",{"VAR?":"redirection_discussed"},"&&",{"VAR?":"ssh_discussed"},"&&",{"VAR?":"hydra_discussed"},"&&","/ev",[{"->":".^.b","c":true},{"b":["\n","^Tech Instructor: You've reviewed all the core material. You should be well-prepared for the practical exercises.","\n",{"->":".^.^.^.21"},null]}],[{"->":".^.b"},{"b":["\n","^Tech Instructor: You might want to review the topics you haven't covered yet, but you've got enough to start.","\n",{"->":".^.^.^.21"},null]}],"nop","\n","^Tech Instructor: Remember: the best way to learn Linux is by doing. Read the challenges, try commands, make mistakes, figure out fixes. That's how you build real competence.","\n","^Tech Instructor: Practical objectives:","\n","^1. Practice basic command-line navigation and file manipulation","\n","^2. Edit files with vi","\n","^3. Use piping and redirection","\n","^4. SSH between systems","\n","^5. Use Hydra to crack weak SSH credentials","\n","^6. Capture flags from compromised accounts","\n","^Tech Instructor: The lab environment is yours to experiment in. Break things. It's a safe space for learning.","\n","ev",{"VAR?":"instructor_rapport"},50,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","^Tech Instructor: You've asked great questions and engaged deeply with the material. That's exactly the right approach. You're going to do well.","\n",{"->":".^.^.^.47"},null]}],"nop","\n","^Tech Instructor: Good luck, Agent. You've got this.","\n",{"->":"end_session"},null],"end_session":["^Tech Instructor: Whenever you need a refresher on Linux fundamentals, I'm here.","\n","ev",{"VAR?":"instructor_rapport"},40,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","^Tech Instructor: You've demonstrated solid understanding and good security awareness. Keep that mindset.","\n",{"->":".^.^.^.8"},null]}],"nop","\n","^Tech Instructor: Now get to that terminal and start practicing. Theory is useful, but hands-on experience is how you actually learn.","\n","^Tech Instructor: See you in the field, Agent.","\n","#","^exit_conversation","/#",{"->":"linux_training_hub"},null],"global decl":["ev",false,{"VAR=":"linux_basics_discussed"},false,{"VAR=":"command_line_skills_discussed"},false,{"VAR=":"vi_editor_discussed"},false,{"VAR=":"piping_discussed"},false,{"VAR=":"redirection_discussed"},false,{"VAR=":"networking_discussed"},false,{"VAR=":"ssh_discussed"},false,{"VAR=":"hydra_discussed"},false,{"VAR=":"kali_intro_discussed"},false,{"VAR=":"pwd_ls_discussed"},false,{"VAR=":"file_manipulation_discussed"},false,{"VAR=":"man_pages_discussed"},false,{"VAR=":"piping_examples_discussed"},false,{"VAR=":"redirection_examples_discussed"},false,{"VAR=":"ifconfig_discussed"},false,{"VAR=":"ssh_basics_discussed"},false,{"VAR=":"ssh_x_forwarding_discussed"},false,{"VAR=":"bruteforce_basics_discussed"},false,{"VAR=":"completed_vi_challenge"},false,{"VAR=":"completed_piping_challenge"},false,{"VAR=":"completed_ssh_challenge"},false,{"VAR=":"completed_hydra_challenge"},0,{"VAR=":"instructor_rapport"},0,{"VAR=":"deep_dives_completed"},"str","^Agent 0x00","/str",{"VAR=":"player_name"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["ev",0,"/ev",{"VAR=":"instructor_rapport","re":true},"^Welcome back, ","ev",{"VAR?":"player_name"},"out","/ev","^. What would you like to discuss?","\n",{"->":"linux_training_hub"},null],"intro_timed":["ev",0,"/ev",{"VAR=":"instructor_rapport","re":true},"^Welcome to Linux Fundamentals and Security, ","ev",{"VAR?":"player_name"},"out","/ev","^. I'm your technical instructor for this session.","\n","^This lab covers essential Linux command-line skills, remote administration via SSH, and basic penetration testing techniques. All crucial skills for field operations.","\n","^Let me explain how this lab works. You'll find three key resources here:","\n","^First, there's a Lab Sheet Workstation in this room. This gives you access to detailed written instructions and exercises that complement our conversation. Use it to follow along with the material.","\n","^Second, in the VM lab room to the north, you'll find terminals to launch virtual machines. You'll work with both a Kali Linux attacker machine and a vulnerable desktop system for hands-on practice.","\n","^Finally, there's a Flag Submission Terminal where you'll submit flags you capture during the exercises. These flags demonstrate that you've successfully completed the challenges.","\n","^You can talk to me anytime to explore Linux concepts, get tips, or ask questions about the material. I'm here to help guide your learning.","\n","^Ready to get started? Feel free to ask me about any topic, or head to the lab sheet workstation and VM room when you're ready to begin the practical exercises.","\n",{"->":"linux_training_hub"},null],"linux_training_hub":[["^What would you like to cover?","\n","ev","str","^Learn about Linux basics and why it matters","/str",{"VAR?":"linux_basics_discussed"},"!","/ev",{"*":".^.c-0","flg":5},"ev","str","^Essential command-line skills","/str",{"VAR?":"command_line_skills_discussed"},"!","/ev",{"*":".^.c-1","flg":5},"ev","str","^Learn the vi editor","/str",{"VAR?":"vi_editor_discussed"},"!","/ev",{"*":".^.c-2","flg":5},"ev","str","^Piping between programs","/str",{"VAR?":"piping_discussed"},"!","/ev",{"*":".^.c-3","flg":5},"ev","str","^Redirecting input and output","/str",{"VAR?":"redirection_discussed"},"!","/ev",{"*":".^.c-4","flg":5},"ev","str","^Basic Linux networking","/str",{"VAR?":"networking_discussed"},"!","/ev",{"*":".^.c-5","flg":5},"ev","str","^Introduction to Kali Linux","/str",{"VAR?":"kali_intro_discussed"},"!","/ev",{"*":".^.c-6","flg":5},"ev","str","^Remote shell access with SSH","/str",{"VAR?":"ssh_discussed"},"!","/ev",{"*":".^.c-7","flg":5},"ev","str","^Attacking SSH with Hydra","/str",{"VAR?":"hydra_discussed"},"!","/ev",{"*":".^.c-8","flg":5},"ev","str","^Show me the essential commands reference","/str",{"VAR?":"linux_basics_discussed"},{"VAR?":"command_line_skills_discussed"},"&&","/ev",{"*":".^.c-9","flg":5},"ev","str","^Tips for the hands-on challenges","/str",{"VAR?":"ssh_discussed"},{"VAR?":"hydra_discussed"},"||","/ev",{"*":".^.c-10","flg":5},"ev","str","^I'm ready to start the practical exercises","/str","/ev",{"*":".^.c-11","flg":4},"ev","str","^That's all I need for now","/str","/ev",{"*":".^.c-12","flg":4},{"c-0":["\n",{"->":"linux_basics_intro"},null],"c-1":["\n",{"->":"command_line_skills"},null],"c-2":["\n",{"->":"vi_editor_intro"},null],"c-3":["\n",{"->":"piping_intro"},null],"c-4":["\n",{"->":"redirection_intro"},null],"c-5":["\n",{"->":"networking_basics"},null],"c-6":["\n",{"->":"kali_intro"},null],"c-7":["\n",{"->":"ssh_intro"},null],"c-8":["\n",{"->":"hydra_intro"},null],"c-9":["\n",{"->":"commands_reference"},null],"c-10":["\n",{"->":"challenge_tips"},null],"c-11":["\n",{"->":"ready_for_practice"},null],"c-12":["\n",{"->":"end_session"},null]}],null],"linux_basics_intro":[["ev",true,"/ev",{"VAR=":"linux_basics_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Excellent starting point. Let me explain why Linux matters for security work.","\n","^Linux is the backbone of modern internet infrastructure. Google, Facebook, Amazon—they all run Linux servers at massive scale. When you're conducting penetration tests or investigating security incidents, you'll encounter Linux systems constantly.","\n","^More importantly for us, the best security tools are Linux-native. Kali Linux contains hundreds of specialized tools for penetration testing, forensics, and security analysis. Mastering Linux means mastering your toolkit.","\n","^Linux comes in many \"distributions\"—different flavors packaged for different purposes. Ubuntu for ease of use, Debian for stability, Kali for security testing. They all share the same core commands and concepts, so learning one helps you understand them all.","\n","ev","str","^Why not just use Windows?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What makes Kali special?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Got it, let's move on","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",{"VAR?":"deep_dives_completed"},1,"+",{"VAR=":"deep_dives_completed","re":true},"/ev","^You: Why can't we just use Windows for security work?","\n",{"->":"windows_comparison"},{"#f":5}],"c-1":["\n","ev",{"VAR?":"deep_dives_completed"},1,"+",{"VAR=":"deep_dives_completed","re":true},"/ev","^You: What specifically makes Kali Linux the industry standard?","\n",{"->":"kali_explanation"},{"#f":5}],"c-2":["\n","^You: Understood. Linux is essential for security work.","\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"windows_comparison":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Fair question. Windows absolutely has its place—many enterprise environments are Windows-heavy, and you'll need those skills too.","\n","^But for offensive security work, Linux has three major advantages:","\n","^First, the tools. Most cutting-edge security research happens in the open-source community, and those tools are Linux-first. Sure, some get ported to Windows eventually, but you'll always be behind the curve.","\n","^Second, the control. Linux gives you deep system access and transparency. You can see exactly what's happening, modify anything, and automate everything. That level of control is crucial when you're trying to exploit systems or analyze malware.","\n","^Third, the culture. The security community lives in Linux. Understanding Linux means understanding how other security professionals work, communicate, and share knowledge.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"kali_explanation":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Kali is essentially a curated arsenal of security tools, all pre-configured and ready to use.","\n","^Offensive Security—the company behind Kali—maintains hundreds of tools across every category: information gathering, vulnerability analysis, wireless attacks, exploitation, post-exploitation, forensics, you name it.","\n","^What makes Kali special isn't just the tools, though. It's the integration. Everything works together. The tools are kept up-to-date. Documentation is solid. And it's become the lingua franca of penetration testing—when security professionals share techniques, they assume you're using Kali.","\n","^Think of it like this: you *could* build your own toolkit from scratch, hunting down each tool individually and figuring out dependencies. Or you could use Kali and get straight to the actual security work.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"command_line_skills":[["ev",true,"/ev",{"VAR=":"command_line_skills_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Right, let's build your command-line fundamentals. These are skills you'll use every single day in the field.","\n","^The command line might seem archaic compared to graphical interfaces, but it's exponentially more powerful. You can automate tasks, chain commands together, work on remote systems, and handle massive datasets—all from a simple text interface.","\n","^I'll cover the essential commands: navigating the filesystem, manipulating files and directories, viewing content, and getting help when you're stuck.","\n","ev","str","^Show me the navigation commands","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How do I work with files?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^How do I get help when stuck?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^I want to see the full command reference","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"pwd_ls_discussed","re":true},"^You: How do I navigate the filesystem?","\n",{"->":"navigation_commands"},{"#f":5}],"c-1":["\n","ev",true,"/ev",{"VAR=":"file_manipulation_discussed","re":true},"^You: What about creating and editing files?","\n",{"->":"file_manipulation"},{"#f":5}],"c-2":["\n","ev",true,"/ev",{"VAR=":"man_pages_discussed","re":true},"^You: What if I don't know what a command does?","\n",{"->":"man_pages"},{"#f":5}],"c-3":["\n","^You: Can I see a complete list of essential commands?","\n",{"->":"commands_reference"},{"#f":5}]}],null],"navigation_commands":[["ev",{"VAR?":"instructor_rapport"},3,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Navigation is your foundation. Here are the essentials:","\n","^pwd - \"print working directory\". Shows exactly where you are in the filesystem. Lost? Run pwd.","\n","^ls - lists files in your current directory. Add \"-la\" for detailed information including hidden files and permissions. You'll use \"ls -la\" constantly.","\n","^cd - \"change directory\". Moves you around the filesystem. \"cd ..\" goes up one level, \"cd\" alone takes you home.","\n","^Pro tip: pressing Tab autocompletes filenames and commands. Type a few letters, hit Tab, save yourself endless typing. And use the up arrow to cycle through previous commands.","\n","ev","str","^Tell me more about ls flags","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What about hidden files?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Got it","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: What other useful flags does ls have?","\n","^Great question. \"ls -lt\" sorts by modification time, newest first. \"ls -lh\" shows human-readable file sizes. \"ls -lR\" recursively lists subdirectories. You can combine them: \"ls -lhta\" shows all files, human-readable sizes, sorted by time.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-1":["\n","^You: What are hidden files?","\n","^In Linux, files starting with \".\" are hidden—they don't show up in normal ls output. Configuration files are typically hidden. Use \"ls -a\" to see them. You'll frequently need to examine hidden config files during security assessments.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-2":["\n",{"->":"command_line_followup"},{"#f":5}]}],null],"command_line_followup":[["ev","str","^Show me file manipulation commands","/str","/ev",{"*":".^.c-0","flg":4},"ev","str","^How do I get help when stuck?","/str","/ev",{"*":".^.c-1","flg":4},"ev","str","^Back to the main menu","/str","/ev",{"*":".^.c-2","flg":4},{"c-0":["\n",{"->":"file_manipulation"},null],"c-1":["\n",{"->":"man_pages"},null],"c-2":["\n",{"->":"linux_training_hub"},null]}],null],"file_manipulation":[["ev",{"VAR?":"instructor_rapport"},3,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Creating, copying, moving, and viewing files. Bread and butter stuff.","\n","^mkdir - creates directories. \"mkdir mydir\" creates a new folder.","\n","^cp - copies files. \"cp source destination\" copies a file. Add \"-r\" for recursive directory copying.","\n","^mv - moves or renames files. \"mv oldname newname\" renames. \"mv file /path/to/destination/\" moves it.","\n","^cat - dumps file contents to the screen. \"cat filename\" shows the whole file.","\n","^echo - prints text. \"echo 'hello world'\" displays text. Useful for testing and scripting.","\n","ev","str","^Tell me more about viewing files","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What about creating files?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Understood","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: Cat seems limited for large files...","\n","^Exactly right. For large files, use less. \"less filename\" lets you scroll through, search with \"/\", quit with \"q\". Much more practical than cat for big files.","\n","ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-1":["\n","^You: How do I create a new empty file?","\n","^Several ways. \"touch filename\" creates an empty file. Or redirect output: \"echo 'content' > filename\" creates a file with content. We'll cover redirection shortly.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-2":["\n",{"->":"command_line_followup"},{"#f":5}]}],null],"man_pages":[["ev",true,"/ev",{"VAR=":"man_pages_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^This is possibly the most important skill: learning to teach yourself.","\n","^man - the manual pages. \"man command\" shows comprehensive documentation for any command. Navigation: space to page down, \"b\" to page up, \"/\" to search, \"q\" to quit.","\n","^Example: \"man ls\" shows every flag and option for ls. The man pages are detailed, sometimes overwhelming, but they're authoritative.","\n","^Alternative: info command provides similar documentation, sometimes more detailed.","\n","^Pro tip: if you're really stuck, try \"command --help\" for a quick summary. Many tools also have online documentation, but man pages are always available, even when you're offline on a compromised system with no internet.","\n","ev","str","^How do I search man pages?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What if man pages are too dense?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Makes sense","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: Can I search across all man pages for a topic?","\n","^Yes. \"man -k keyword\" searches all man page descriptions. \"apropos keyword\" does the same thing. Useful when you know what you want to do but not which command does it.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-1":["\n","^You: Man pages can be pretty technical...","\n","^True. For beginner-friendly explanations, try \"tldr command\"—it shows simplified examples. Or search online for \"command examples\". But learning to parse man pages is a skill worth developing. They're accurate, complete, and always available.","\n","ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"command_line_followup"},{"#f":5}],"c-2":["\n",{"->":"command_line_followup"},{"#f":5}]}],null],"vi_editor_intro":[["ev",true,"/ev",{"VAR=":"vi_editor_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Ah, vi. The editor that's been causing both frustration and devotion since 1976.","\n","^Here's why you need to know vi: it's on *every* Unix and Linux system. When you SSH into a compromised server with minimal tools, vi will be there. Other editors might not be.","\n","^Vi is modal. Two main modes: normal mode for commands, insert mode for typing text.","\n","^The essentials:","\n",["^\"vi filename\" opens or creates a file","\n",["^Press \"i\" to enter insert mode (now you can type)","\n",["^Press Esc to return to normal mode","\n",["^In normal mode: \":wq\" writes and quits, \":q!\" quits without saving","\n","^That's literally everything you need to survive vi.","\n","ev","str","^Tell me more about normal mode commands","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Why not use nano or another editor?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^I'll learn the basics","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",{"VAR?":"deep_dives_completed"},1,"+",{"VAR=":"deep_dives_completed","re":true},"/ev","^You: What else can I do in normal mode?","\n",{"->":"vi_advanced_commands"},{"#f":5}],"c-1":["\n","^You: Why not just use nano? It seems simpler.","\n","^Nano is fine for quick edits. But vi is universal and powerful. On hardened systems or embedded devices, vi might be your only option. Plus, once you learn it, vi is dramatically faster. Your call, but I recommend at least learning vi basics.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"vi_editor_followup"},{"#f":5}],"c-2":["\n","ev",true,"/ev",{"VAR=":"completed_vi_challenge","re":true},"^You: Got it. I'll practice the essential commands.","\n",{"->":"vi_editor_followup"},{"#f":5}],"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"vi_advanced_commands":[["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Want to unlock vi's power? Here are some favorites:","\n","^Navigation in normal mode:","\n",["^\"h\" \"j\" \"k\" \"l\" move cursor left, down, up, right","\n",["^\"w\" jumps forward by word, \"b\" jumps back","\n",["^\"gg\" jumps to start of file, \"G\" jumps to end","\n","^Editing in normal mode:","\n",["^\"dd\" deletes current line","\n",["^\"30dd\" deletes 30 lines","\n",["^\"yy\" copies (yanks) current line","\n",["^\"p\" pastes","\n",["^\"u\" undo","\n",["^\"/\" searches, \"n\" finds next match","\n","^You can combine commands: \"d10j\" deletes 10 lines down. \"c3w\" changes next 3 words.","\n","^Ten minutes with a vi tutorial will make you look like a wizard. It's worth it.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"vi_editor_followup"},{"#n":"g-8"}],{"#n":"g-7"}],{"#n":"g-6"}],{"#n":"g-5"}],{"#n":"g-4"}],{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"vi_editor_followup":[["ev","str","^Back to main menu","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"linux_training_hub"},null]}],null],"piping_intro":[["ev",true,"/ev",{"VAR=":"piping_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Piping is where Linux becomes genuinely powerful. You can chain simple commands together to accomplish complex tasks.","\n","^The pipe operator sends the output of one command to the input of another.","\n","^Example command: cat /etc/passwd, then pipe to grep /home/","\n","^This reads the passwd file and filters it to only lines containing \"/home/\". Two simple commands, combined to do something useful.","\n","^You can chain multiple pipes: cat /etc/passwd, pipe to grep /home/, then pipe to sort -r. Now it's filtered *and* sorted in reverse.","\n","ev","str","^Show me more examples","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What commands work well with pipes?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^I've got the concept","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"piping_examples_discussed","re":true},"^You: What are some practical piping examples?","\n",{"->":"piping_examples"},{"#f":5}],"c-1":["\n","^You: Which commands are commonly piped together?","\n",{"->":"piping_common_commands"},{"#f":5}],"c-2":["\n","ev",true,"/ev",{"VAR=":"completed_piping_challenge","re":true},{"->":"linux_training_hub"},{"#f":5}]}],null],"piping_examples":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Here are real-world examples you'll use constantly:","\n","^Finding running processes: Command: ps aux, pipe to grep ssh. This lists all processes and filters for SSH-related ones.","\n","^Analyzing logs: Command: cat logfile, pipe to grep ERROR, pipe to sort, pipe to uniq -c, pipe to sort -nr. This finds errors, sorts them, counts unique occurrences, sorts by frequency. One line, powerful analysis.","\n","^Network analysis: Command: netstat -an, pipe to grep ESTABLISHED. This shows active network connections.","\n","^Counting things: Command: ls, pipe to wc -l. This counts files in current directory.","\n","^The Unix philosophy: small tools that do one thing well, combined creatively. Piping is how you combine them.","\n","ev",true,"/ev",{"VAR=":"completed_piping_challenge","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"piping_common_commands":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Commands that work brilliantly in pipes:","\n","^grep - filters lines matching a pattern. Your most-used pipe command.","\n","^sort - sorts lines alphabetically. \"-n\" for numeric sort, \"-r\" for reverse.","\n","^uniq - removes duplicate adjacent lines. Usually used after sort. \"-c\" counts occurrences.","\n","^head and tail - show first or last N lines. \"head -20\" shows first 20 lines.","\n","^wc - word count. \"-l\" counts lines, \"-w\" counts words, \"-c\" counts characters.","\n","^cut - extracts columns from text. \"cut -d: -f1\" splits on colons, takes first field.","\n","^awk and sed - powerful text processing. More advanced, but incredibly useful.","\n","^Learn these, and you can process massive datasets from the command line.","\n","ev",true,"/ev",{"VAR=":"completed_piping_challenge","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"redirection_intro":[["ev",true,"/ev",{"VAR=":"redirection_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Redirection lets you send command output to files or read input from files.","\n","^Three key operators:","\n","^greater than > - redirects output to a file, overwriting it. \"ls > filelist.txt\" saves directory listing to a file.","\n","^append >> - redirects output to a file, appending. \"echo 'new line' >> file.txt\" adds to the end.","\n","^less than < - reads input from a file. \"wc -l < file.txt\" counts lines in the file.","\n","^Practical example: \"ps aux > processes.txt\" saves a snapshot of running processes for analysis.","\n","ev","str","^Show me more redirection examples","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What about error messages?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Understood","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"redirection_examples_discussed","re":true},"^You: What are some practical redirection scenarios?","\n",{"->":"redirection_examples"},{"#f":5}],"c-1":["\n","^You: Can I redirect error messages too?","\n",{"->":"stderr_redirection"},{"#f":5}],"c-2":["\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"redirection_examples":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Practical redirection scenarios:","\n","^Saving command output for later:","\n","^\"ifconfig > network_config.txt\" - captures network configuration.","\n","^Building logs:","\n","^\"echo '$(date): Scan completed' >> scan_log.txt\" - appends timestamped entries.","\n","^Combining with pipes:","\n","^Command: cat /etc/passwd, pipe to grep /home/, redirect to users.txt. This filters and saves results.","\n","^Quick file creation:","\n","^\"echo 'test content' > test.txt\" - creates a file with content in one command.","\n","^During security assessments, you'll constantly redirect command output to files for documentation and later analysis.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"stderr_redirection":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Good catch. There are actually two output streams: stdout (standard output) and stderr (standard error).","\n","^By default, \">\" only redirects stdout. Error messages still appear on screen.","\n","^To redirect stderr: \"command 2> errors.txt\"","\n","^To redirect both: \"command > output.txt 2>&1\" - sends stderr to stdout, which goes to the file.","\n","^Or in modern Bash: \"command &> output.txt\" does the same thing more simply.","\n","^To discard output entirely: \"command > /dev/null 2>&1\" - sends everything to the void.","\n","^This is advanced stuff, but incredibly useful when scripting or when you want clean output.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"networking_basics":[["ev",true,"/ev",{"VAR=":"networking_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Linux networking commands. Essential for understanding network configurations and troubleshooting connectivity.","\n","^ifconfig - the classic command to view network interfaces and IP addresses. Shows all your network adapters.","\n","^ip - the modern replacement. \"ip a s\" (ip address show) does the same thing. You'll see both used in the field.","\n","^hostname -I - quick way to display just your IP address.","\n","^In our environment, your IP typically starts with \"172.22\" or \"10\" - those are private network ranges.","\n","ev","str","^Tell me more about network interfaces","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How do I troubleshoot network issues?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^What about finding other machines?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Got it","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"ifconfig_discussed","re":true},"^You: What are network interfaces exactly?","\n",{"->":"network_interfaces"},{"#f":5}],"c-1":["\n","^You: What if my network isn't working?","\n",{"->":"network_troubleshooting"},{"#f":5}],"c-2":["\n","^You: How do I discover other systems on the network?","\n","^Good question, but that's scanning territory. We'll cover tools like nmap in the scanning module. For now, focus on understanding your own network configuration.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},{"#f":5}],"c-3":["\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"network_interfaces":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Network interfaces are how your computer connects to networks. Think of them as connection points.","\n","^eth0, eth1 - Ethernet interfaces. Physical network ports.","\n","^wlan0 - Wireless interface. WiFi adapter.","\n","^lo - Loopback interface, always 127.0.0.1. Your computer talking to itself. Useful for testing.","\n","^Virtual interfaces - VPNs and containers create virtual interfaces like tun0, tap0, docker0.","\n","^When you run ifconfig, you see all interfaces, their IP addresses, MAC addresses, and traffic statistics. Essential information for network security assessments.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"network_troubleshooting":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Basic network troubleshooting steps:","\n","^Step 1: Check interface status with \"ifconfig\" or \"ip a s\". Is the interface up? Does it have an IP?","\n","^Step 2: If no IP, try \"dhclient eth0\" to request one from DHCP server.","\n","^Step 3: Test local connectivity: \"ping 127.0.0.1\" tests your network stack.","\n","^Step 4: Test gateway: \"ping your_gateway_ip\" tests local network.","\n","^Step 5: Test DNS: \"ping google.com\" tests name resolution and external connectivity.","\n","^In our lab environment, if you're having issues, usually dhclient fixes it. In the field, troubleshooting can be much more complex.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"kali_intro":[["ev",true,"/ev",{"VAR=":"kali_intro_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Kali Linux. Your primary offensive security platform.","\n","^Released by Offensive Security in 2013 as the successor to BackTrack Linux. It's specifically designed for penetration testing, security auditing, and digital forensics.","\n","^Kali includes hundreds of pre-installed tools organized by category: information gathering, vulnerability analysis, wireless attacks, web applications, exploitation tools, password attacks, forensics, and more.","\n","^Default credentials: username \"kali\", password \"kali\". Never use Kali as your primary OS—it's designed for security testing, not everyday computing.","\n","ev","str","^Show me what tools are available","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How is Kali organized?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Sounds powerful","/str","/ev",{"*":".^.c-2","flg":20},{"c-0":["\n","^You: What kinds of tools are we talking about?","\n",{"->":"kali_tools_overview"},{"#f":5}],"c-1":["\n","^You: How do I find the right tool for a task?","\n",{"->":"kali_organization"},{"#f":5}],"c-2":["\n",{"->":"linux_training_hub"},{"#f":5}]}],null],"kali_tools_overview":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Let me give you a taste of what's available:","\n","^Information Gathering: nmap, dnsenum, whois, recon-ng. Tools for mapping networks and gathering intelligence.","\n","^Vulnerability Analysis: Nessus, OpenVAS, nikto. Automated scanners that identify security weaknesses.","\n","^Exploitation: Metasploit Framework, BeEF, sqlmap. Tools for actively exploiting vulnerabilities.","\n","^Password Attacks: Hydra, John the Ripper, hashcat. Cracking and bruteforcing credentials.","\n","^Wireless Attacks: Aircrack-ng, Reaver, Wifite. WiFi security testing.","\n","^Forensics: Autopsy, Sleuth Kit, Volatility. Analyzing systems and recovering data.","\n","^And those are just highlights. Run \"ls /usr/bin\" to see hundreds more. It's an arsenal.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"kali_organization":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Kali organizes tools by the penetration testing lifecycle:","\n","^Phase 1 - Information Gathering: Passive and active reconnaissance. Learning about your target.","\n","^Phase 2 - Vulnerability Analysis: Identifying weaknesses in systems and applications.","\n","^Phase 3 - Exploitation: Actually compromising systems using identified vulnerabilities.","\n","^Phase 4 - Post-Exploitation: What you do after gaining access. Maintaining access, pivoting, data exfiltration.","\n","^The Applications menu mirrors this structure. When you need a tool, think about which phase you're in, and browse that category.","\n","^You'll also quickly learn the handful of tools you use constantly. Nmap, Metasploit, Burp Suite, Wireshark—these become second nature.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"ssh_intro":[["ev",true,"/ev",{"VAR=":"ssh_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^SSH - Secure Shell. Encrypted remote access to systems. One of your most critical tools.","\n","^SSH lets you securely connect to remote Linux systems and execute commands as if you were sitting at that machine. All traffic is encrypted, protecting against eavesdropping.","\n","^Basic usage: \"ssh username@ip_address\"","\n","^The server typically listens on port 22. When you connect, you authenticate (usually with password or key), and then you have a remote shell.","\n","^SSH replaced older, insecure protocols like Telnet and rlogin, which transmitted passwords in cleartext. Never use those—always use SSH.","\n","ev","str","^Tell me about SSH keys","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What's X11 forwarding?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^How do I verify I'm connecting to the right server?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Let's talk about attacking SSH","/str","/ev",{"*":".^.c-3","flg":20},"ev","str","^Got the basics","/str","/ev",{"*":".^.c-4","flg":20},{"c-0":["\n","^You: What about SSH key authentication?","\n",{"->":"ssh_keys"},{"#f":5}],"c-1":["\n","ev",true,"/ev",{"VAR=":"ssh_x_forwarding_discussed","re":true},"^You: I saw something about -X flag for forwarding?","\n",{"->":"ssh_x_forwarding"},{"#f":5}],"c-2":["\n","^You: How do I know I'm not being man-in-the-middled?","\n",{"->":"ssh_fingerprints"},{"#f":5}],"c-3":["\n","^You: How do we test SSH security?","\n",{"->":"ssh_to_hydra_transition"},{"#f":5}],"c-4":["\n","ev",true,"/ev",{"VAR=":"completed_ssh_challenge","re":true},{"->":"linux_training_hub"},{"#f":5}]}],null],"ssh_keys":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^SSH keys are asymmetric cryptography for authentication. Much more secure than passwords.","\n","^You generate a key pair: a private key (keep secret) and public key (share freely).","\n","^Generate keys: \"ssh-keygen -t rsa -b 4096\"","\n","^Copy public key to server: \"ssh-copy-id user@server\"","\n","^Now you can SSH without typing passwords. The private key proves your identity.","\n","^Benefits: stronger than passwords, can't be bruteforced, can be passphrase-protected, can be revoked per-server.","\n","^Many organizations require key-based auth and disable password authentication entirely. Learn this workflow.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"ssh_intro"},null],"ssh_x_forwarding":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^X11 forwarding is clever. Linux graphical applications use the X Window System. SSH can tunnel X11 traffic.","\n","^Connect with: \"ssh -X user@server\"","\n","^Now you can run graphical programs on the remote server, but see them on your local screen. The program runs remotely, but displays locally.","\n","^Example: \"kate\" opens the text editor, running on the remote system but displaying on yours. Useful for accessing GUI tools remotely.","\n","^Warning: some latency over networks. And it does expose some security risks—only use on trusted connections.","\n","ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"ssh_intro"},null],"ssh_fingerprints":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Excellent security awareness. SSH uses host key fingerprints to prevent man-in-the-middle attacks.","\n","^When you first connect, SSH shows the server's fingerprint. You should verify this matches the real server before accepting.","\n","^On the server, check fingerprint: \"ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub\"","\n","^If the fingerprint matches what SSH showed you, type \"yes\". SSH remembers this and will warn if it changes later.","\n","^If the fingerprint changes unexpectedly, that's a warning sign. Could be a man-in-the-middle attack, or could be the server was rebuilt. Investigate before proceeding.","\n","^Most people skip this check. Don't be most people. Especially in adversarial security contexts.","\n","ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"ssh_intro"},null],"ssh_to_hydra_transition":["^Now you're thinking like a penetration tester. Let's talk about attacking SSH.","\n",{"->":"hydra_intro"},null],"hydra_intro":[["ev",true,"/ev",{"VAR=":"hydra_discussed","re":true},"ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Hydra. THC-Hydra, to be specific. A parallelized login cracker supporting numerous protocols.","\n","^Hydra performs online bruteforce attacks—it actually tries to log in with username/password combinations. Different from offline attacks where you crack hashed passwords.","\n","^Basic usage: \"hydra -l username -p password target ssh\"","\n","^Tests a single username/password combo. But Hydra's power is testing many combinations from wordlists.","\n","^Supports dozens of protocols: SSH, FTP, HTTP, RDP, SMB, databases, and more. If it accepts login credentials, Hydra can probably attack it.","\n","ev","str","^How do I use wordlists?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^How fast is Hydra?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^What are the legal/ethical considerations?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^I'm ready to try it","/str","/ev",{"*":".^.c-3","flg":20},{"c-0":["\n","ev",true,"/ev",{"VAR=":"bruteforce_basics_discussed","re":true},"^You: How do I test multiple passwords?","\n",{"->":"hydra_wordlists"},{"#f":5}],"c-1":["\n","^You: How quickly can it crack passwords?","\n",{"->":"hydra_speed"},{"#f":5}],"c-2":["\n","^You: Is this legal to use?","\n",{"->":"hydra_ethics"},{"#f":5}],"c-3":["\n","ev",true,"/ev",{"VAR=":"completed_hydra_challenge","re":true},{"->":"linux_training_hub"},{"#f":5}]}],null],"hydra_wordlists":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Wordlists are the fuel for Hydra. Collections of common passwords to test.","\n","^Usage: \"hydra -l username -P /path/to/wordlist.txt target ssh\"","\n","^Capital -P for password list, lowercase -l for single username. Or use -L for username list too.","\n","^Kali includes wordlists: \"ls /usr/share/wordlists/seclists/Passwords/\"","\n","^Choosing the right wordlist is critical. A wordlist with 10 million passwords might take days for online attacks. Start with smaller, curated lists of common passwords.","\n","^For SSH specifically, \"Common-Credentials\" lists work well. They contain default passwords and common weak passwords.","\n","^Real-world advice: online attacks are slow and noisy. They generate logs. They trigger intrusion detection. Use them strategically, not as your first approach.","\n","ev",true,"/ev",{"VAR=":"completed_hydra_challenge","re":true},"ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"hydra_speed":["ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Speed depends on many factors: network latency, server response time, number of parallel connections.","\n","^Hydra's \"-t\" flag controls parallel tasks. \"hydra -t 4\" uses 4 parallel connections.","\n","^More isn't always better. Too many parallel connections can crash services or trigger rate limiting. For SSH, 4-16 threads is usually reasonable.","\n","^Realistic expectations: online SSH bruteforce might test 10-50 passwords per second. Against a wordlist with 10,000 passwords, that's several minutes at best.","\n","^Compare to offline cracking (like hashcat on GPUs), which can test billions of passwords per second. Online attacks are fundamentally slower.","\n","^Strategic implication: online attacks work best when you have good intelligence. If you know username is \"admin\" and password is probably from a short list of defaults, Hydra excels. Blind bruteforce against random accounts? Impractical.","\n","ev",{"VAR?":"instructor_rapport"},8,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"hydra_ethics":["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Critical question. Shows good judgment.","\n","^Legal status: Hydra itself is legal to possess and use in authorized security testing. Unauthorized use against systems you don't own or have explicit permission to test? That's computer fraud. Felony-level crime in most jurisdictions.","\n","^In this training: You're attacking lab systems we control, with explicit permission. This is legal and ethical training.","\n","^In SAFETYNET operations: You'll have authorization for your targets. Still legally gray area, but covered by classified operational authorities.","\n","^In the real world: Never, ever use these tools against systems without written authorization. Penetration testers get contracts. Bug bounty hunters follow program rules. Hobbyists practice in their own isolated labs.","\n","^The skills you're learning are powerful. Use them responsibly. With authorization. Within the law. That's not optional—it's core to professional security work.","\n","ev",{"VAR?":"instructor_rapport"},15,"+",{"VAR=":"instructor_rapport","re":true},"/ev",{"->":"linux_training_hub"},null],"commands_reference":[["ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Here's your essential commands quick reference:","\n","^Navigation:","\n",["^pwd (print working directory)","\n",["^ls, ls -la (list files, detailed)","\n",["^cd directory (change directory)","\n",["^cd .. (up one level), cd (home)","\n","^File Operations:","\n",["^mkdir (make directory)","\n",["^cp source dest (copy), cp -r (recursive)","\n",["^mv old new (move/rename)","\n",["^cat filename (display file)","\n",["^less filename (scrollable view)","\n",["^echo \"text\" (print text)","\n","^Getting Help:","\n",["^man command (manual page)","\n",["^info command (info page)","\n",["^command --help (quick help)","\n","^Text Processing:","\n",["^grep pattern (filter lines)","\n",["^sort (sort lines)","\n",["^uniq (remove duplicates)","\n",["^head, tail (first/last lines)","\n",["^wc -l (count lines)","\n","^Networking:","\n",["^ifconfig, ip a s (show interfaces)","\n",["^hostname -I (show IP)","\n",["^ssh user@host (remote shell)","\n",["^ssh -X user@host (X11 forwarding)","\n","^Security Tools:","\n",["^hydra -l user -p pass target ssh (test SSH login)","\n",["^hydra -l user -P wordlist target ssh (bruteforce SSH)","\n","ev","str","^Back to main menu","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"linux_training_hub"},null],"#n":"g-23"}],{"#n":"g-22"}],{"#n":"g-21"}],{"#n":"g-20"}],{"#n":"g-19"}],{"#n":"g-18"}],{"#n":"g-17"}],{"#n":"g-16"}],{"#n":"g-15"}],{"#n":"g-14"}],{"#n":"g-13"}],{"#n":"g-12"}],{"#n":"g-11"}],{"#n":"g-10"}],{"#n":"g-9"}],{"#n":"g-8"}],{"#n":"g-7"}],{"#n":"g-6"}],{"#n":"g-5"}],{"#n":"g-4"}],{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"challenge_tips":[["ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Practical tips for the hands-on challenges:","\n","^For SSH practice:","\n",["^Verify fingerprints before accepting","\n",["^Try both regular SSH and -X flag for X forwarding","\n",["^Use \"exit\" or Ctrl-D to disconnect","\n",["^Check \"who\" command to see who else is connected","\n","^For Hydra attacks:","\n",["^Start with small, targeted wordlists from /usr/share/wordlists/seclists/Passwords/Common-Credentials/","\n",["^Use -t 4 for reasonable parallel connections","\n",["^Be patient—online attacks are slow","\n",["^Watch for successful login messages","\n",["^Remember to actually SSH in once you crack credentials","\n","^For finding flags:","\n",["^Navigate to user home directories","\n",["^Use \"cat\" to read files","\n",["^Remember \"sudo\" lets you act as root (if you have permission)","\n",["^Check file permissions with \"ls -la\"","\n","^General advice:","\n",["^Use Tab completion to save typing","\n",["^Use up arrow to recall previous commands","\n",["^If stuck, check man pages","\n",["^Take notes on what works","\n","ev","str","^Back to main menu","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"linux_training_hub"},null],"#n":"g-16"}],{"#n":"g-15"}],{"#n":"g-14"}],{"#n":"g-13"}],{"#n":"g-12"}],{"#n":"g-11"}],{"#n":"g-10"}],{"#n":"g-9"}],{"#n":"g-8"}],{"#n":"g-7"}],{"#n":"g-6"}],{"#n":"g-5"}],{"#n":"g-4"}],{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"ready_for_practice":["ev",{"VAR?":"instructor_rapport"},5,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Excellent. You've covered the fundamentals.","\n","ev",{"VAR?":"command_line_skills_discussed"},{"VAR?":"piping_discussed"},"&&",{"VAR?":"redirection_discussed"},"&&",{"VAR?":"ssh_discussed"},"&&",{"VAR?":"hydra_discussed"},"&&","/ev",[{"->":".^.b","c":true},{"b":["\n","^You've reviewed all the core material. You should be well-prepared for the practical exercises.","\n",{"->":".^.^.^.21"},null]}],[{"->":".^.b"},{"b":["\n","^You might want to review the topics you haven't covered yet, but you've got enough to start.","\n",{"->":".^.^.^.21"},null]}],"nop","\n","^Remember: the best way to learn Linux is by doing. Read the challenges, try commands, make mistakes, figure out fixes. That's how you build real competence.","\n","^Practical objectives:","\n","^1. Practice basic command-line navigation and file manipulation","\n","^2. Edit files with vi","\n","^3. Use piping and redirection","\n","^4. SSH between systems","\n","^5. Use Hydra to crack weak SSH credentials","\n","^6. Capture flags from compromised accounts","\n","^The lab environment is yours to experiment in. Break things. It's a safe space for learning.","\n","ev",{"VAR?":"instructor_rapport"},50,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","^You've asked great questions and engaged deeply with the material. That's exactly the right approach. You're going to do well.","\n",{"->":".^.^.^.47"},null]}],"nop","\n","^Good luck, Agent. You've got this.","\n",{"->":"end_session"},null],"end_session":["^Whenever you need a refresher on Linux fundamentals, I'm here.","\n","ev",{"VAR?":"instructor_rapport"},40,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","^You've demonstrated solid understanding and good security awareness. Keep that mindset.","\n",{"->":".^.^.^.8"},null]}],"nop","\n","^Now get to that terminal and start practicing. Theory is useful, but hands-on experience is how you actually learn.","\n","^See you in the field, Agent.","\n","#","^exit_conversation","/#",{"->":"linux_training_hub"},null],"flags_completed_congrats":[["ev",{"VAR?":"instructor_rapport"},10,"+",{"VAR=":"instructor_rapport","re":true},"/ev","^Excellent work, ","ev",{"VAR?":"player_name"},"out","/ev","^! You've successfully completed all the VM lab exercises and captured all the flags. That demonstrates real competence with Linux security fundamentals.","\n","^You've shown you can:","\n",["^Navigate Linux systems effectively","\n",["^Use SSH for remote access","\n",["^Perform security testing with tools like Hydra","\n",["^Escalate privileges when needed","\n","^These are essential skills for field operations.","\n","^I have an optional challenge for you, if you're interested. There's a lockpicking practice room to the east. It's completely optional, but it's a useful field skill to learn.","\n","ev",{"VAR?":"has_key"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Here's the key to the lockpicking practice room. The locksmith inside can teach you the basics.","\n","ev",true,"/ev",{"VAR=":"lockpicking_key_received","re":true},"#","^give_item:key","/#","#","^unlock_aim:learn_lockpicking","/#","#","^unlock_task:talk_to_locksmith","/#","^Good luck! It's a valuable skill to have.","\n",{"->":".^.^.^.11"},null]}],[{"->":".^.b"},{"b":["\n","^I see you already have the key. Feel free to explore the lockpicking practice room if you're interested.","\n","ev",{"VAR?":"lockpicking_key_received"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",true,"/ev",{"VAR=":"lockpicking_key_received","re":true},"#","^unlock_aim:learn_lockpicking","/#","#","^unlock_task:talk_to_locksmith","/#",{"->":".^.^.^.8"},null]}],"nop","\n",{"->":".^.^.^.11"},null]}],"nop","\n",{"->":"flags_completed_followup"},{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"flags_completed_followup":[["ev","str","^Tell me more about lockpicking","/str","/ev",{"*":".^.c-0","flg":4},"ev","str","^Back to main menu","/str","/ev",{"*":".^.c-1","flg":4},"ev","str","^That's all I need","/str","/ev",{"*":".^.c-2","flg":4},{"c-0":["\n","^Lockpicking is a physical security skill. In the field, you'll encounter locked doors, safes, and containers. Being able to pick locks gives you access without keys or forced entry.","\n","^The locksmith in the practice room can teach you the fundamentals: applying tension with a wrench, and picking pins in binding order. It takes practice, but it's a skill worth learning.","\n",{"->":".^.^.^"},null],"c-1":["\n",{"->":"linux_training_hub"},null],"c-2":["\n",{"->":"end_session"},null]}],null],"global decl":["ev",false,{"VAR=":"linux_basics_discussed"},false,{"VAR=":"command_line_skills_discussed"},false,{"VAR=":"vi_editor_discussed"},false,{"VAR=":"piping_discussed"},false,{"VAR=":"redirection_discussed"},false,{"VAR=":"networking_discussed"},false,{"VAR=":"ssh_discussed"},false,{"VAR=":"hydra_discussed"},false,{"VAR=":"kali_intro_discussed"},false,{"VAR=":"pwd_ls_discussed"},false,{"VAR=":"file_manipulation_discussed"},false,{"VAR=":"man_pages_discussed"},false,{"VAR=":"piping_examples_discussed"},false,{"VAR=":"redirection_examples_discussed"},false,{"VAR=":"ifconfig_discussed"},false,{"VAR=":"ssh_basics_discussed"},false,{"VAR=":"ssh_x_forwarding_discussed"},false,{"VAR=":"bruteforce_basics_discussed"},false,{"VAR=":"completed_vi_challenge"},false,{"VAR=":"completed_piping_challenge"},false,{"VAR=":"completed_ssh_challenge"},false,{"VAR=":"completed_hydra_challenge"},0,{"VAR=":"instructor_rapport"},0,{"VAR=":"deep_dives_completed"},"str","^Agent 0x00","/str",{"VAR=":"player_name"},false,{"VAR=":"lockpicking_key_received"},false,{"VAR=":"has_key"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/scenarios/lab_intro_linux/ink/locksmith.ink b/scenarios/lab_intro_linux/ink/locksmith.ink new file mode 100644 index 0000000..8106fc7 --- /dev/null +++ b/scenarios/lab_intro_linux/ink/locksmith.ink @@ -0,0 +1,112 @@ +// =========================================== +// LOCKSMITH NPC - LOCKPICKING TUTORIAL +// =========================================== + +// NPC item inventory variables +VAR has_lockpick = false + +// Progress tracking +VAR lockpicking_tutorial_given = false +VAR all_locks_picked = false + +// =========================================== +// ENTRY POINT +// =========================================== + +=== start === +Welcome to the lockpicking practice room. I'm here to teach you the fundamentals of lockpicking. + +{has_lockpick: + Here's a professional lockpick set to get you started. + #give_item:lockpick + #complete_task:talk_to_locksmith + #unlock_task:pick_all_locks + Now let me explain how to use it. +- else: + I see you already have a lockpick set. Let me give you a quick refresher on the basics. +} + +-> lockpicking_tutorial + +// =========================================== +// MAIN HUB +// =========================================== + +=== hub === +What would you like to know? + +{not lockpicking_tutorial_given: + * [Teach me about lockpicking] + -> lockpicking_tutorial +} + +{not all_locks_picked: + + [I'm working on picking the locks] + You'll find five locked containers in this room. Each one contains a document fragment. Pick all five to complete the practice exercise. + -> hub +} + ++ [That's all I need] + -> end_conversation + +// =========================================== +// LOCKPICKING TUTORIAL +// =========================================== + +=== lockpicking_tutorial === +~ lockpicking_tutorial_given = true + +Lockpicking is a physical security skill that's essential for field operations. Here's how it works: + +The basic principle: Most locks use pin tumblers. Each pin has two parts - a driver pin and a key pin. When the correct key is inserted, the pins align at the shear line, allowing the lock to turn. + +When picking a lock, you need two tools: +1. A tension wrench - applies rotational pressure to the lock cylinder +2. A pick - manipulates the pins one by one + +The technique: +- Apply light tension with the wrench in the direction the lock turns +- Use the pick to push each pin up until you feel it "bind" (stop moving) +- Pins bind in a specific order - work through them systematically +- When all pins are set at the shear line, the lock will turn + +Practice makes perfect. Start with the containers in this room - they have different difficulty levels. + +Each container has a different lock configuration. Start with the easier ones and work your way up. When you've picked all five locks and collected all the documents, come back and I'll congratulate you on completing the practice. + +Good luck! + +-> hub + + +// =========================================== +// LOCKPICKING COMPLETE +// =========================================== + +=== lockpicking_complete === +~ all_locks_picked = true + +Congratulations! You've successfully picked all five locks and recovered all the lost documents. + +You've demonstrated: +- Understanding of lock mechanics +- Ability to apply proper tension +- Skill in identifying binding order +- Patience and precision + +These skills will serve you well in the field. Lockpicking is often the difference between mission success and failure when you need access without leaving evidence of forced entry. + +You're ready for real-world operations. Well done, Agent. + +-> hub + +// =========================================== +// END CONVERSATION +// =========================================== + +=== end_conversation === +Good luck with your practice. Come back if you need any tips! + +#exit_conversation +-> hub + diff --git a/scenarios/lab_intro_linux/ink/locksmith.json b/scenarios/lab_intro_linux/ink/locksmith.json new file mode 100644 index 0000000..9079d4c --- /dev/null +++ b/scenarios/lab_intro_linux/ink/locksmith.json @@ -0,0 +1 @@ +{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["^Welcome to the lockpicking practice room. I'm here to teach you the fundamentals of lockpicking.","\n","ev",{"VAR?":"has_lockpick"},"/ev",[{"->":".^.b","c":true},{"b":["\n","^Here's a professional lockpick set to get you started.","\n","#","^give_item:lockpick","/#","#","^complete_task:talk_to_locksmith","/#","#","^unlock_task:pick_all_locks","/#","^Now let me explain how to use it.","\n",{"->":"start.7"},null]}],[{"->":".^.b"},{"b":["\n","^I see you already have a lockpick set. Let me give you a quick refresher on the basics.","\n",{"->":"start.7"},null]}],"nop","\n",{"->":"lockpicking_tutorial"},null],"hub":[["^What would you like to know?","\n","ev",{"VAR?":"lockpicking_tutorial_given"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","ev","str","^Teach me about lockpicking","/str","/ev",{"*":".^.c-0","flg":20},{"->":"hub.0.7"},{"c-0":["\n",{"->":"lockpicking_tutorial"},{"#f":5}]}]}],"nop","\n","ev",{"VAR?":"all_locks_picked"},"!","/ev",[{"->":".^.b","c":true},{"b":["\n","ev","str","^I'm working on picking the locks","/str","/ev",{"*":".^.c-0","flg":4},{"->":"hub.0.14"},{"c-0":["\n","^You'll find five locked containers in this room. Each one contains a document fragment. Pick all five to complete the practice exercise.","\n",{"->":"hub"},null]}]}],"nop","\n","ev","str","^That's all I need","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"end_conversation"},null]}],null],"lockpicking_tutorial":[["ev",true,"/ev",{"VAR=":"lockpicking_tutorial_given","re":true},"^Lockpicking is a physical security skill that's essential for field operations. Here's how it works:","\n","^The basic principle: Most locks use pin tumblers. Each pin has two parts - a driver pin and a key pin. When the correct key is inserted, the pins align at the shear line, allowing the lock to turn.","\n","^When picking a lock, you need two tools:","\n","^1. A tension wrench - applies rotational pressure to the lock cylinder","\n","^2. A pick - manipulates the pins one by one","\n","^The technique:","\n",["^Apply light tension with the wrench in the direction the lock turns","\n",["^Use the pick to push each pin up until you feel it \"bind\" (stop moving)","\n",["^Pins bind in a specific order - work through them systematically","\n",["^When all pins are set at the shear line, the lock will turn","\n","^Practice makes perfect. Start with the containers in this room - they have different difficulty levels.","\n","^Each container has a different lock configuration. Start with the easier ones and work your way up. When you've picked all five locks and collected all the documents, come back and I'll congratulate you on completing the practice.","\n","^Good luck!","\n",{"->":"hub"},{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"lockpicking_complete":[["ev",true,"/ev",{"VAR=":"all_locks_picked","re":true},"^Congratulations! You've successfully picked all five locks and recovered all the lost documents.","\n","^You've demonstrated:","\n",["^Understanding of lock mechanics","\n",["^Ability to apply proper tension","\n",["^Skill in identifying binding order","\n",["^Patience and precision","\n","^These skills will serve you well in the field. Lockpicking is often the difference between mission success and failure when you need access without leaving evidence of forced entry.","\n","^You're ready for real-world operations. Well done, Agent.","\n",{"->":"hub"},{"#n":"g-3"}],{"#n":"g-2"}],{"#n":"g-1"}],{"#n":"g-0"}],null],null],"end_conversation":["^Good luck with your practice. Come back if you need any tips!","\n","#","^exit_conversation","/#",{"->":"hub"},null],"global decl":["ev",false,{"VAR=":"has_lockpick"},false,{"VAR=":"lockpicking_tutorial_given"},false,{"VAR=":"all_locks_picked"},"/ev","end",null]}],"listDefs":{}} \ No newline at end of file diff --git a/scenarios/lab_intro_linux/scenario.json.erb b/scenarios/lab_intro_linux/scenario.json.erb index 4c77d02..d270be8 100644 --- a/scenarios/lab_intro_linux/scenario.json.erb +++ b/scenarios/lab_intro_linux/scenario.json.erb @@ -8,42 +8,61 @@ "lab_instruction_complete": false, "vm_launched": false, "ssh_flag_submitted": false, - "privilege_flag_submitted": false + "privilege_flag_submitted": false, + "lockpicking_key_received": false, + "lockpicks_received": false }, "objectives": [ { - "aimId": "complete_lab_instruction", - "title": "Complete Lab Instruction", - "description": "Learn Linux fundamentals from the technical instructor", + "aimId": "complete_vm_lab", + "title": "Complete VM Lab Exercises", + "description": "Capture all flags from the desktop system", "status": "active", "order": 0, "tasks": [ { - "taskId": "talk_to_instructor", - "title": "Speak with the technical instructor", + "taskId": "submit_all_flags", + "title": "Submit all required flags from desktop", + "type": "submit_flags", + "targetFlags": ["desktop-flag1", "desktop-flag2"], + "targetCount": 2, + "currentCount": 0, + "showProgress": true, + "status": "active", + "onComplete": { + "unlockAim": "learn_lockpicking" + } + } + ] + }, + { + "aimId": "learn_lockpicking", + "title": "Learn Lockpicking (Optional)", + "description": "Practice lockpicking to retrieve all the lost documents", + "status": "locked", + "order": 1, + "unlockCondition": { + "aimCompleted": "complete_vm_lab" + }, + "tasks": [ + { + "taskId": "talk_to_locksmith", + "title": "Talk to the locksmith to get lockpick set", "type": "npc_conversation", - "targetNPC": "tech_instructor", - "status": "active" + "targetNPC": "locksmith", + "status": "locked", + "onComplete": { + "unlockTask": "pick_all_locks" + } }, { - "taskId": "complete_lab_sheet", - "title": "Complete the lab sheet and capture flags from desktop system", + "taskId": "pick_all_locks", + "title": "Pick locks to retrieve lost documents", "type": "collect_items", "targetItems": ["notes"], - "status": "locked" - }, - { - "taskId": "submit_ssh_flag", - "title": "Submit SSH brute force flag from desktop system", - "type": "unlock_object", - "targetObject": "flag_station_lab", - "status": "locked" - }, - { - "taskId": "submit_privilege_flag", - "title": "Submit privilege escalation flag from desktop system", - "type": "unlock_object", - "targetObject": "flag_station_lab", + "targetCount": 5, + "currentCount": 0, + "showProgress": true, "status": "locked" } ] @@ -63,7 +82,7 @@ "instruction_room": { "type": "room_office", "connections": { - "north": "vm_lab_room" + "north": "lockpicking_room" }, "locked": false, "npcs": [ @@ -71,7 +90,7 @@ "id": "tech_instructor", "displayName": "Tech Instructor", "npcType": "person", - "position": { "x": 5, "y": 5 }, + "position": { "x": 3.5, "y": 3.5 }, "spriteSheet": "hacker-red", "spriteTalk": "assets/characters/hacker-red-talk.png", "spriteConfig": { @@ -79,7 +98,30 @@ "idleFrameEnd": 23 }, "storyPath": "scenarios/lab_intro_linux/ink/instructor.json", - "currentKnot": "start" + "currentKnot": "start", + "timedConversation": { + "delay": 3000, + "knot": "intro_timed" + }, + "eventMappings": [ + { + "eventPattern": "objective_aim_completed:complete_vm_lab", + "targetKnot": "flags_completed_congrats", + "conversationMode": "person-chat", + "autoTrigger": true, + "cooldown": 0 + } + ], + "itemsHeld": [ + { + "type": "key", + "name": "Lockpicking Room Key", + "key_id": "lockpicking_room_key", + "keyPins": [35, 30, 40, 28], + "takeable": true, + "observations": "A key to the lockpicking practice room" + } + ] } ], "objects": [ @@ -96,18 +138,9 @@ "name": "Lab Welcome Guide", "takeable": true, "readable": true, - "text": "Welcome to the Linux Fundamentals and Security Lab!\n\nOBJECTIVES:\n1. Speak with the technical instructor to learn Linux fundamentals\n2. Use the Lab Sheet Workstation to access detailed lab instructions\n3. Complete the lab sheet exercises\n4. Launch the VMs and capture flags from the desktop system\n\nThe instructor will guide you through all the essential concepts before you begin hands-on practice.\n\nGood luck!", + "text": "Welcome to the Linux Fundamentals and Security Lab!\n\nOBJECTIVES:\n1. Use the Lab Sheet Workstation to access detailed lab instructions\n2. Complete the lab sheet exercises\n3. Launch the VMs and capture flags from the desktop system\n4. (Optional) Learn lockpicking skills in the practice room\n\nThe technical instructor is available if you need guidance.\n\nGood luck!", "observations": "A guide to the lab structure and objectives" - } - ] - }, - "vm_lab_room": { - "type": "room_office", - "connections": { - "south": "instruction_room" - }, - "locked": false, - "objects": [ + }, { "type": "vm-launcher", "id": "vm_launcher_kali", @@ -148,21 +181,11 @@ 'flag{privilege_escalation_success}' ]) %>, "flagRewards": [ - { - "type": "complete_task", - "taskId": "submit_ssh_flag", - "description": "SSH access flag submitted - demonstrates SSH brute force skills" - }, { "type": "emit_event", "event_name": "ssh_flag_submitted", "description": "SSH access flag submitted - demonstrates SSH brute force skills" }, - { - "type": "complete_task", - "taskId": "submit_privilege_flag", - "description": "Privilege escalation flag submitted - demonstrates advanced Linux skills" - }, { "type": "emit_event", "event_name": "privilege_flag_submitted", @@ -179,6 +202,162 @@ "observations": "Instructions for the VM lab exercises" } ] + }, + "lockpicking_room": { + "type": "room_office", + "connections": { + "west": "instruction_room" + }, + "locked": true, + "lockType": "key", + "requires": "lockpicking_room_key", + "keyPins": [35, 30, 40, 28], + "difficulty": "medium", + "npcs": [ + { + "id": "locksmith", + "displayName": "Locksmith", + "npcType": "person", + "position": { "x": 4.5, "y": 3.5 }, + "spriteSheet": "hacker", + "spriteTalk": "assets/characters/hacker-talk.png", + "spriteConfig": { + "idleFrameStart": 20, + "idleFrameEnd": 23 + }, + "storyPath": "scenarios/lab_intro_linux/ink/locksmith.json", + "currentKnot": "start", + "eventMappings": [ + { + "eventPattern": "objective_task_completed:pick_all_locks", + "targetKnot": "lockpicking_complete", + "conversationMode": "person-chat", + "autoTrigger": true, + "cooldown": 0 + } + ], + "itemsHeld": [ + { + "type": "lockpick", + "name": "Lock Pick Set", + "takeable": true, + "observations": "Professional lock picking tools for practicing" + } + ] + } + ], + "objects": [ + { + "type": "suitcase", + "id": "document_bag_1", + "name": "Locked Briefcase", + "takeable": false, + "locked": true, + "lockType": "key", + "requires": "nonexistent_key", + "keyPins": [32, 28, 35, 30], + "difficulty": "medium", + "contents": [ + { + "type": "notes", + "name": "Document Fragment 1", + "takeable": true, + "readable": true, + "text": "Document Fragment 1\n\nThis is the first of five lost documents. You're making good progress with your lockpicking skills!", + "observations": "A fragment of classified documents" + } + ], + "observations": "A locked briefcase containing important documents" + }, + { + "type": "suitcase", + "id": "document_bag_2", + "name": "Locked Briefcase", + "takeable": false, + "locked": true, + "lockType": "key", + "requires": "nonexistent_key", + "keyPins": [40, 35, 38, 32, 36], + "difficulty": "medium", + "contents": [ + { + "type": "notes", + "name": "Document Fragment 2", + "takeable": true, + "readable": true, + "text": "Document Fragment 2\n\nSecond document recovered. Keep practicing!", + "observations": "A fragment of classified documents" + } + ], + "observations": "A locked briefcase containing important documents" + }, + { + "type": "suitcase", + "id": "document_bag_3", + "name": "Locked Bag", + "takeable": false, + "locked": true, + "lockType": "key", + "requires": "nonexistent_key", + "keyPins": [28, 42, 30, 33, 37], + "difficulty": "medium", + "contents": [ + { + "type": "notes", + "name": "Document Fragment 3", + "takeable": true, + "readable": true, + "text": "Document Fragment 3\n\nThird document found. You're getting the hang of this!", + "observations": "A fragment of classified documents" + } + ], + "observations": "A locked bag containing important documents" + }, + { + "type": "suitcase", + "id": "document_bag_4", + "name": "Locked Briefcase", + "takeable": false, + "locked": true, + "lockType": "key", + "requires": "nonexistent_key", + "keyPins": [35, 30, 40, 28, 32], + "difficulty": "medium", + "contents": [ + { + "type": "notes", + "name": "Document Fragment 4", + "takeable": true, + "readable": true, + "text": "Document Fragment 4\n\nFourth document recovered. Almost there!", + "observations": "A fragment of classified documents" + } + ], + "observations": "A locked briefcase containing important documents" + }, + { + "type": "suitcase", + "id": "document_bag_5", + "name": "Locked Bag", + "takeable": false, + "locked": true, + "lockType": "key", + "requires": "nonexistent_key", + "keyPins": [38, 33, 28, 42, 35, 30], + "difficulty": "hard", + "contents": [ + { + "type": "notes", + "name": "Document Fragment 5", + "takeable": true, + "readable": true, + "text": "Document Fragment 5\n\nFinal document recovered! Congratulations - you've mastered lockpicking!", + "observations": "A fragment of classified documents" + } + ], + "observations": "A locked bag containing important documents" + } + ] } } } diff --git a/scripts/scenario-schema.json b/scripts/scenario-schema.json index 4b33e95..22545bf 100644 --- a/scripts/scenario-schema.json +++ b/scripts/scenario-schema.json @@ -97,7 +97,7 @@ "title": { "type": "string" }, "type": { "type": "string", - "enum": ["collect_items", "unlock_room", "unlock_object", "enter_room", "npc_conversation"] + "enum": ["collect_items", "unlock_room", "unlock_object", "enter_room", "npc_conversation", "submit_flags", "custom"] }, "status": { "type": "string", @@ -110,13 +110,19 @@ "type": "array", "items": { "type": "string" } }, + "targetFlags": { + "type": "array", + "items": { "type": "string" }, + "description": "Array of flag identifiers to submit (e.g., ['desktop-flag1', 'kali-flag1'])" + }, "targetCount": { "type": "integer" }, "currentCount": { "type": "integer" }, "showProgress": { "type": "boolean" }, "onComplete": { "type": "object", "properties": { - "unlockTask": { "type": "string" } + "unlockTask": { "type": "string" }, + "unlockAim": { "type": "string" } } } }