Debian Codegraph @

misc/zsh/_medusa

raw
1 #compdef medusa
2
3 # Copy this file to your global zsh site-functions directory
4 # ex: /usr/local/share/zsh/site-functions
5
6 # Written by Bismark ([email protected])
7 # Date: 09/22/2008
8 #
9 # Modified by Bismark ([email protected])
10 # Date: 01/24/2010
11 # Changes:
12 # Removed completion prompts for options that do not have a value
13 # Added option removal for conflicting options.
14 #
15 # Modified by Bismark ([email protected])
16 # Date: 05/12/2015
17 # Changes:
18 # Fixed -C combo option to properly search for a file
19
20 typeset -A opt_args
21
22 _select_module() {
23 local modules
24 modules=( $(medusa -d | grep + | awk '/.mod/ {print $2}' | cut -d"." -f 1) )
25 _wanted select-module expl 'Module' compadd "$@" -a - modules
26 }
27
28 _medusa()
29 {
30 local expl context state line ret=1
31 local -A opt_args
32
33 _arguments \
34 '-b[Suppress startup banner]' \
35 '-O[File to append log information to.]:Log file:_files' \
36 '-M[Name of the module to execute (without the .mod extension)]:Module:_select_module' \
37 '*-m[Parameter to pass to the module.]:Module Parameters' \
38 '-d[Dump all known modules.]:Dump Modules' \
39 '-n[Use for non-default TCP port number.]:tcp port' \
40 '-s[Enable SSL.]' \
41 '-g[Give up after trying to connect for NUM seconds (default 3).]:Retry seconds' \
42 '-r[Sleep number of seconds between retry attempts (default 3).]:Sleep seconds' \
43 '-R[Attempted retries before giving up. The total number of attempts will be retries + 1.]:Retries' \
44 '-t[Total number of logins to be tested concurrently]:Concurrent Logins' \
45 '-T[Total number of hosts to be tested concurrently.]:Concurrent Hosts' \
46 '-L[Parallelize logins using one username per thread.]' \
47 '-f[Stop scanning host after first valid username/password found.]' \
48 '-F[Stop audit after first valid username/password found on any host.]' \
49 '-q[Display module’s usage information.]' \
50 '-v[Verbose level (0 - 6)]:Verbosity:(0 1 2 3 4 5 6)' \
51 '-w[Error debug level (0 - 10)]:Debug:(0 1 2 3 4 5 6 7 8 9 10)' \
52 '-V[Display version]' \
53 "-e[Additional password checks]:Additional password checks:_values 'Additional password checks' 'n[No Password]' 's[Password = Username]' 'ns[No Password & Password = Username]'":'(n s ns)' \
54 '(-H -C)-h[Target hostname or IP address.]:Hostname or IP Address' \
55 '(-h -C)-H[Read Targets from a file.]:Hosts file:_files' \
56 '(-U -u -P -p)-C[File containing combo entries. (see man page)]:Combo file:_files' \
57 '(-U -C)-u[Username.]:Username' \
58 '(-P -C)-p[Password.]:Password' \
59 '(-u -C)-U[Read Usernames from a file.]:Username file:_files' \
60 '(-P -C)-P[Read Passwords from a file.]:Password file:_files' && return 0
61
62 return 1
63 }
64 _medusa "$@"