vectors

This tag loads vectors from the events part of the XSS cheat sheet.

Created by: hackvertor
Installed 1 times

Category: XSS

Created on: Friday, October 11, 2024 at 8:35:43 PM

Updated on: Saturday, October 12, 2024 at 5:44:01 PM

This is a built in tag
Tag arguments
[
   {
      "type": "string",
      "help": "This provides the tag name",
      "defaultValue": "*"
   },
   {
      "type": "boolean",
      "help": "Shows vectors with user interaction or not",
      "defaultValue": "false"
   }
]
Code
class vectors {
  encode(input, tagName, requiresInteraction) {
    const output = [];
    for (const [event, obj] of Object.entries(
      hv.variables.xssCheatSheet.events,
    )) {
      obj.tags
        .filter((tagObj) => tagObj.interaction === requiresInteraction)
        .filter((tagObj) =>
          tagName === "*" ? true : tagObj.tag === tagName || tagObj.tag === "*",
        )
        .forEach((tagObj) => output.push(tagObj.code.replaceAll("*", tagName)));
    }
    return output.join("\n");
  }
}