Skip to main content

utils dump autocomplete

Summary

Dump autocomplete to stdout

What it does

Create an autocomplete file for the shell of your choice, given that it is either bash or zsh

Tool functionality

This tool produces autocomplete files for bash or zsh for the sipvicious command. The output is sent to standard output and should be saved to the correct location depending on your system.

Video demonstration

sipvicious utils dump autocomplete

Command format

sipvicious utils dump autocomplete [flags]

Flags

  -f, --format string   Specify type of shell (bash|zsh) (default "bash")

Flags inherited from parent commands

  -C, --config string       configuration file to use (may be JSON, TOML or YAML)
      --debug               set log level to debug
  -T, --duration duration   Stop the tool after a certain amount of time; e.g. 30s
      --logfile string      specify a log filename
      --results string      specify the filename for the result output, defaults to standard output. See documentation for information on file extension meanings

Examples

sipvicious utils dump autocomplete

Advanced examples

To create the bash autocomplete file, one would typically run this tool as follows:

# to dump the file to the bash auto-complete directory on most Linux systems:
sipvicious utils dump autocomplete | sudo tee /etc/bash_completion.d/sipvicious

# to load the config explicitly without logging out and back in:
source /etc/bash_completion.d/sipvicious 

Full flag documentation

Flag: -C, --config

Specify a configuration file which may be a JSON, TOML and YAML config format. To get the default settings and figure out which settings are available, one may run the sipvicious utils dump config command. This is typically used to create a template configuration that can then be edited as need be.

These settings may be overwritten when the corresponding flag is explicitly set, if one is present.

Flag: --debug

Tells the logger to print out debug messages.

Flag: -T, --duration

Specify the maximum duration of the attack so that it stops after a certain time. Examples include:

  • 30s
  • 10m
  • 24h

Flag: -f, --format

Specify the value of zsh if that is your shell. By default, it outputs to bash format.

Flag: --logfile

When the logfile flag is specified, a log file is created in the location specified and logs are generated in this file instead of being sent to standard output. If the filename ends with a .json file extension, then the output format is in JSON, otherwise it defaults to text format.

Flag: --results

When the results flag is specified, upon completing the test, it outputs the results to the specified filename. The format for this output file is text unless the filename ends with a .json file extension. In that case, the result output is that of JSON.

The schema for the JSON output for this submodule can be found here.

JSON schema

The following is the JSON schema for the JSON output of this tool:

{
  "type": "object",
  "properties": {
    "status": {
      "type": "object",
      "properties": {
        "returncode": { "type": "integer" },
        "description": { "type": "string" }
      }
    },
    "targets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "target": { "type": "string" },
          "status": {
            "type": "object",
            "properties": {
              "returncode": { "type": "integer" },
              "description": { "type": "string" }
            }
          },
          "results": {
            "type": "object",
            "properties": {
            }
          },
          "issues": {
            "type": "object",
            "properties": {
            }
          }
        }
      }
    }
  }
}