Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Debugging QuickActions

SirBitesalot edited this page Jan 24, 2021 · 1 revision

To debug QuickActions open the settings window and check "Enable Quick Action Debugging" and set the "Quick Action Debugging Port" Default is 9222:

Dont forget to check "Allow QuickActions" aswell.

If you already had a save loaded you need to either reload it or restart the application now.

To actually debug QuickActions we recommend Visual Studio Code. If you dont already have it installed download and install it now.

Start Visual Studio Code and open File->Preferences->Settings:

Search for "Launch" and click on "Edit in settings.json":

And add the following json (change the port number according to your CyberCAT settings):

{
    "name": "Attach to ClearScript V8 on port 9222",
    "type": "node",
    "request": "attach",
    "protocol": "inspector",
    "address": "localhost",
    "port": 9222
}

Like shown below:

Now you can open the "QuickAction" folder in Visual Studio Code.

Go to: File->Open Folder

Now navigate to the "QuickAction" folder located in the CyberCAT Directory and click "Select Folder"

Once opened you can now open the "script.js" of a QuickAction:

Now you can set a breakpoint:

Before attaching to the script engine you need to execute one QuickAction inside CyberCAT so the script engine actually runs.

After executing a QuickAction of your choice go back to Visual Studio Code and click Run->Start Debugging:

If everything worked correctly you should now hit your breakpoint when executing the QuickAction: