Skip to main content

New Mode (Vulnerability Discovery)

The --new mode is designed for vulnerability discovery challenges where you need to identify and locate a vulnerability in the source code.

Usage​

node src/index.js --new --url "..."

What it collects​

  1. Challenge title -- from the vulnerability category or page heading
  2. Vulnerability category -- extracted from the "Vulnerability Category" section in the challenge UI
  3. Highlighted file contents -- enables the "Highlighted files only" filter and collects the relevant source files

Behavior​

This mode automatically:

  • Finds and enables the "Highlighted files only" toggle to focus on the vulnerable files
  • Clicks through file tabs to collect each file's source code
  • Strips line numbers from code when they appear as sequential prefixes
  • Removes code markers (CB### patterns) from the output

Output format​

# Cross-Site Scripting

Vulnerability Category: Cross-Site Scripting

### app.js
\`\`\`
const express = require('express');
// file contents...
\`\`\`

### index.html
\`\`\`
<html>
<!-- file contents... -->
</html>
\`\`\`

When to use​

Use --new when the Secure Code Warrior challenge asks you to identify or locate a vulnerability, rather than choosing a fix from multiple options.