Skip to content

Tips & Recipes

Practical tips, configuration reference, and workflow recipes for getting the most out of Weaponized VSCode.

Configuration Reference

Core Settings

SettingTypeDefaultDescription
weaponized.lhoststring$LHOSTAttacker IP for reverse shells. Maps to $LHOST env var
weaponized.lportinteger6879Attacker port for reverse shells. Maps to $LPORT
weaponized.listenoninteger8890Web delivery listen port. Maps to $LISTEN_ON
weaponized.envsobject{}Extra environment variables injected into terminals

Tool Paths

SettingTypeDefaultDescription
weaponized.hashcatstringhashcatHashcat binary path
weaponized.msf.venomstringmsfvenommsfvenom binary path
weaponized.msf.consolestringmsfconsolemsfconsole binary path
weaponized.msf.resourcefilestringMetasploit resource file path

Terminal Commands

SettingTypeDefaultDescription
weaponized.netcatstringrlwrap -I -cAr netcat -lvvp ${config:weaponized.lport}Netcat handler command
weaponized.webdeliverystringsimplehttpserver -listen 0.0.0.0:${config:weaponized.listenon} -verbose -uploadWeb delivery server command

Scanners

SettingTypeDefaultDescription
weaponized.scannersobject(see below)Map of scanner name → command template

Default scanners:

json
{
  "rustscan": "rustscan -a $TARGET -- -A",
  "wfuzz subdomain": "wfuzz -c -w ${config:weaponized.user_vars.TOP_DNS} -H 'Host: FUZZ.$TARGET' --hc 400 http://$TARGET",
  "ffuf subdomain": "ffuf -w ${config:weaponized.user_vars.TOP_DNS} -H 'Host: FUZZ.$TARGET' -u http://$TARGET",
  "nuclei": "nuclei -target $TARGET",
  "dirsearch": "dirsearch -u http://$TARGET",
  "feroxbuster": "feroxbuster --url http://$TARGET"
}

User Variables

SettingTypeDefaultDescription
weaponized.user_varsobject(Kali paths)User-defined variables, referenced via ${config:weaponized.user_vars.X}

Default user variables include common Kali paths:

json
{
  "WORDLIST": "/usr/share/wordlists",
  "ROCKYOU": "/usr/share/wordlists/rockyou.txt",
  "SECLIST": "/usr/share/wordlists/seclists",
  "TOP_DNS": "/usr/share/wordlists/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt"
}

Recording

SettingTypeDefaultDescription
weaponized.terminal-log.enabledbooleanfalseAuto-start terminal recording on activation
weaponized.terminal-log.pathstring${workspaceFolder}/.vscode/.terminal.logLog file path
weaponized.terminal-log.levelenumcommand-onlyRecording mode: command-only, output-only, command-and-output, netcat-handler

AI & MCP

SettingTypeDefaultDescription
weaponized.ai.enabledbooleantrueEnable @weapon chat and MCP server
weaponized.mcp.portinteger25789MCP HTTP server port

Environment Variable Quick Reference

Target Variables (Auto-set from YAML host blocks)

VariableSourceDescription
$TARGEThostname (or RHOST if no domain)Primary target identifier
$RHOSTip fieldTarget IP address
$IPip fieldSame as RHOST
$DOMAINfirst alias or hostnameTarget domain
$DC_IPip (when is_dc: true)Domain Controller IP
$DC_HOSTfirst alias (when is_dc: true)Domain Controller hostname
$HOST_{name}ip fieldMulti-host: IP by hostname
$IP_{name}ip fieldMulti-host: IP by hostname

Credential Variables (Auto-set from YAML credentials blocks)

VariableSourceDescription
$USERuser fieldCurrent username
$USERNAMEuser fieldSame as USER
$PASSpassword fieldCurrent password
$PASSWORDpassword fieldSame as PASS
$NT_HASHnt_hash fieldCurrent NTLM hash
$LOGINlogin fieldCurrent login domain
$CURRENT_USERuser fieldAlias for USER
$CURRENT_PASSpassword fieldAlias for PASS
$USER_{name}user fieldMulti-user: username by name
$PASS_{name}password fieldMulti-user: password by name
$NT_HASH_{name}nt_hash fieldMulti-user: hash by name

Connection Variables (From settings.json)

VariableSourceDescription
$LHOSTweaponized.lhostAttacker IP
$LPORTweaponized.lportAttacker port
$LISTEN_ONweaponized.listenonWeb delivery port
$PROJECT_FOLDERworkspace rootProject directory path

Practical Recipes

Recipe 1: Full Enumeration Workflow

  1. Create projectweapon.setup
  2. Add first hostWeapon: Create note → host → target.htb
  3. Edit the host note → set IP to 10.10.10.10, save
  4. Set as current → click "set as current" CodeLens above the YAML block
  5. Run scanWeapon: Run scanner → select rustscan
  6. Record output → start terminal recorder in command-and-output mode
  7. Review results → document open ports in the host note
  8. Create findings → for each vulnerability, Weapon: Create note → finding

Recipe 2: Credential Harvesting and Reuse

  1. Capture credentialsWeapon: Create note → user → admin@corp.local
  2. Fill in YAML → set password and/or NT hash
  3. Set as current → credentials are now in all terminal env vars
  4. Use with tools → in any terminal: impacket-psexec $LOGIN/$USER:$PASS@$TARGET
  5. Dump for sharingWeapon: Dump users → impacket format → copy to colleague

Recipe 3: Payload and Handler Pipeline

  1. Generate payloadWeapon: Create msfvenom payload
    • Select windows/x64/meterpreter/reverse_tcp, format exe
    • LHOST and LPORT auto-populated
  2. Start handler → option to auto-start handler is offered during payload creation
    • Or manually: open terminal dropdown → "meterpreter handler"
  3. Deliver payload → open terminal dropdown → "web delivery"
    • Use the displayed download commands to transfer the payload
  4. Catch shell → the handler terminal catches the meterpreter session

Recipe 4: AI-Assisted Engagement

The extension provides two independent AI integration paths — use either or both:

Path A: Copilot Chat (@weapon)

  1. Get suggestions@weapon /suggest in Copilot Chat — recommends next steps based on current targets and credentials
  2. Generate commands@weapon /generate kerberoasting attack for the current domain
  3. Analyze output → select terminal output, then @weapon /analyze

Path B: MCP Server (external AI clients)

  1. Install MCP configWeapon: Install MCP server → writes .vscode/mcp.json
  2. Open your MCP client → e.g. Claude Code, Cursor, or any MCP-compatible tool
  3. Ask for analysis → "Read terminal 1 and tell me what the nmap scan found"
  4. Auto-create findings → "Create a finding for each critical service you identified"

See AI & MCP Integration for full setup details.

Recipe 5: Report Generation

  1. Link your notes → use [[wiki-links]] throughout: [[target.htb]], [[admin]], [[smb-signing]]
  2. Check the graphFoam: Show graph → verify attack path makes sense
  3. Generate reportWeapon: Create note → report
  4. Review → the report includes host details, privilege escalation path, and Mermaid diagram

Customization Tips

Adding Custom Scanners

json
{
  "weaponized.scanners": {
    "nikto": "nikto -h http://$TARGET",
    "gobuster": "gobuster dir -u http://$TARGET -w ${config:weaponized.user_vars.SECLIST}/Discovery/Web-Content/directory-list-2.3-medium.txt",
    "enum4linux": "enum4linux-ng -A $TARGET",
    "bloodhound-python": "bloodhound-python -d $DOMAIN -u $USER -p $PASS -dc $DC_HOST -c all"
  }
}

Custom Environment Variables

Add project-specific variables that are injected into every terminal:

json
{
  "weaponized.envs": {
    "PROXY": "socks5://127.0.0.1:1080",
    "BURP": "http://127.0.0.1:8080",
    "SCOPE": "*.corp.local"
  }
}

Overriding Wordlist Paths (macOS/custom Linux)

json
{
  "weaponized.user_vars": {
    "WORDLIST": "/opt/wordlists",
    "ROCKYOU": "/opt/wordlists/rockyou.txt",
    "SECLIST": "/opt/wordlists/seclists",
    "TOP_DNS": "/opt/wordlists/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt"
  }
}

Migrating from v0.4.x

If you used the shell-based Weaponized VSCode (versions before 1.0), here's what changed:

Command Mapping

v0.4.x (Shell)v1.0 (Extension)Notes
weapon_vscode projectmkdir project && code project + weapon.setupNo shell launcher needed
set_current_host hostnameWeapon: Switch current host or CodeLens "set as current"GUI with QuickPick
set_current_user usernameWeapon: Switch current user or CodeLens "set as current"GUI with QuickPick
dump_hostsWeapon: Dump all hosts4 output formats
dump_usersWeapon: Dump all user credentials5 output formats (adds nxc)
current_statusWeapon: Dump all hosts (env format)Or check env vars in terminal
update_host_to_env(automatic)Env vars update on file save
update_user_cred_to_env(automatic)Env vars update on file save
Tasks: Run Task → msfvenomWeapon: Create msfvenom payloadDirect command, no task.json
Tasks: Run Task → hashcatWeapon: Crack hashes with hashcatDirect command
Tasks: Run Task → rustscanWeapon: Run scanner over targetConfigurable scanners
Tasks: Run Task → run selectionCodeLens "Run command in terminal"Click above any code block
Foam: Create Note From TemplateWeapon: Create noteSame templates, better UX

Architecture Changes

Componentv0.4.xv1.0
Environment variablesShell scripts (.vscode/env.zsh, createhackenv.sh) sourced on terminal startVS Code EnvironmentVariableCollection API — injected into all terminals automatically
YAML parsingyq command-line toolNative TypeScript YAML parser (built into extension)
Host/user switchingset_current_host/set_current_user zsh functionsExtension commands with QuickPick UI + CodeLens inline buttons
State storage.vscode/env.zsh file rewritten by shell scriptsVS Code workspaceState (persistent key-value store)
Terminal profiles.zshrc aliases and functionsVS Code Terminal Profile API providers
Knowledge baseNoneEmbedded snippets (GTFOBins, LOLBAS, BloodHound)
AI integrationNone@weapon Copilot Chat + embedded MCP server
Code executionManual copy-paste or "run selection" taskCodeLens buttons on shell/http blocks
Report generationManualAutomated from Foam graph

What's Still the Same

  • Markdown notes are the source of truth — YAML host and credentials blocks work exactly the same way
  • Foam integration — wiki-links, graph visualization, templates
  • Terminal profiles — same 4 profiles (meterpreter, msfconsole, netcat, web-delivery), now native
  • .vscode/.zshrc helpers — still available for utility functions (differ, ntlm, url, proxys)
  • Project isolation — each workspace is independent, env vars don't cross-talk

TIP

Your existing v0.4.x project notes are fully compatible with v1.0. Just open the project folder, run weapon.setup to ensure the scaffolding is up to date, and start using the new extension commands. No note migration needed.

FAQ

Q: The extension doesn't activate when I open my project folder. A: The extension activates when it detects specific files (.foam/templates/*.md, .vscode/settings.json, hosts/**/*.md, etc.). Run weapon.setup to create the expected structure.

Q: Environment variables aren't showing up in my terminal. A: Open a new terminal after setting the current host/user. Existing terminals don't pick up env var changes. Also verify the YAML block syntax — it must be ```yaml host or ```yaml credentials with the type keyword after yaml.

Q: The MCP server port is already in use. A: Change weaponized.mcp.port in settings, or let the extension auto-assign a port (it falls back to an OS-assigned port if the default is occupied). Re-run Weapon: Install MCP server to update .vscode/mcp.json.

Q: Can I use this without Foam? A: The extension works for most features (commands, tasks, terminals, MCP) without Foam. However, graph visualization, wiki-links, and report generation require Foam. It's strongly recommended.

Q: How do I add more note templates? A: Add .md files to .foam/templates/. They'll appear in Foam's template picker. The extension's Weapon: Create note command uses its own built-in templates for the 5 standard types.