Nopilot: setup and debugging

Get the lab installed and your debugging tools working. No exploitation on this page, just the toolkit. When you can do everything here, open the flag console and start.

Read this first. Nopilot is deliberately vulnerable. Install it only for the workshop, keep it to the lab folders, and do not open untrusted or real projects with it enabled. Uninstall it when you are done (instructions at the bottom).

1. What you need

No Node install is required to run the lab.

2. Install the extension

Any one of these:

UI

  1. Open the Extensions view (Ctrl/Cmd+Shift+X).
  2. Click the ... menu at the top, then Install from VSIX...
  3. Pick nopilot.vsix. Reload if prompted.

Command palette

  1. Ctrl/Cmd+Shift+P, then Extensions: Install from VSIX...
  2. Pick nopilot.vsix.

CLI

code --install-extension nopilot.vsix
# or:  cursor --install-extension nopilot.vsix
# or:  codium --install-extension nopilot.vsix

Verify

Open any folder. The Nopilot icon appears in the activity bar and the chat sidebar auto-focuses. Type hello and it should answer.

3. The debugging toolkit

These are the skills the flag console rewards. Get each working once here.

Webview developer tools

The chat sidebar is a web page (a webview). To inspect it:

  1. Focus the Nopilot chat.
  2. Ctrl/Cmd+Shift+P, then Developer: Open Webview Developer Tools.
  3. Use the Elements tab to read the DOM and the Console to run JavaScript in the page.

If you see more than one frame, pick the active one. This is where you inspect rendered content and watch postMessage traffic:

window.addEventListener('message', e => console.log(e.data));

Attach a debugger to the extension host

The privileged half of the extension runs in a Node process. Attach to it:

  1. Close all editor windows.
  2. Relaunch with the inspector on:
    code --inspect-extensions=9229
  3. Open a Chromium browser at chrome://inspect, click Configure, add localhost:9229, then click inspect on the target that appears.
  4. In the Sources tab, open the extension's out/extension.js, set a breakpoint, and drive the extension to hit it. Inspect locals in the Scope pane.

Working from source instead? Open the extension/ folder and press F5 (Run Extension) to launch an Extension Development Host with the debugger already attached.

Read the installed source

What ships is compiled, and it lives on disk. Find it:

~/.vscode/extensions/vscodelab.nopilot-*/      # VS Code
~/.cursor/extensions/vscodelab.nopilot-*/      # Cursor
~/.vscode-oss/extensions/vscodelab.nopilot-*/  # VSCodium
%USERPROFILE%\.vscode\extensions\              # Windows

The bundle is out/extension.js; the manifest is package.json.

Unpack the .vsix

A .vsix is a zip. Take it apart without installing:

unzip nopilot.vsix -d nopilot-unpacked
# contents land under nopilot-unpacked/extension/

Read the logs

Extensions log where you can watch them:

4. Next

Open the flag console, collect the setup flags to prove each tool works, then move on to the bug hints. The slides cover the concepts.

Uninstall when done

code --uninstall-extension vscodelab.nopilot

Or in the Extensions view: find Nopilot, gear icon, Uninstall.