buggy code

pull/1770/head
Gurkirat Singh 2021-01-09 23:56:33 +05:30
parent 5032b15efc
commit c7ceb18c6d
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 32 additions and 31 deletions

View File

@ -9,45 +9,46 @@ if _command_exists wpscan; then
cur=$(_get_cword)
prev=$(_get_pword)
local SINGLES=$(compgen -W "-h -v -f -o -t -e -U -P")
local DOUBLES=$(compgen -W "--url --help --hh --version --ignore-main-redirect --banner --no-banner --max-scan-duration --format --output --detection-mode --user-agent --ua --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tls-checks --proxy --proxy-auth --cookie-string --cookie-jar --force --update --no-update --api-token --wp-content-dir --wp-plugins-dir --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --plugins-threshold --themes-list --themes-detection --themes-version-all --themes-version-detection --themes-threshold --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --login-uri --stealthy --random-user-agent")
local OPTS=("${SINGLES[@]}" "${DOUBLES[@]}")
local D=(--url --help --hh --version --ignore-main-redirect --banner --no-banner --max-scan-duration --format --output --detection-mode --user-agent --ua --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tls-checks --proxy --proxy-auth --cookie-string --cookie-jar --force --update --no-update --api-token --wp-content-dir --wp-plugins-dir --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --plugins-threshold --themes-list --themes-detection --themes-version-all --themes-version-detection --themes-threshold --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --login-uri --stealthy --random-user-agent)
local S=(-h -v -f -o -t -e -U -P)
echo "${D[@]} ${S[@]}"
local OPTS=($(compgen -W "${S[@]} ${D[@]}"))
local DETECTION="mixed active passive"
case $prev in
--format | -f)
COMPREPLY=("$(compgen -W "cli cli-no-color json" -- "$cur")")
return 0
;;
# --format | -f)
# COMPREPLY=("$(compgen -W "cli cli-no-color json" "$cur")")
# return 0
# ;;
--detection-mode | *detection)
COMPREPLY=("$(compgen -W "$DETECTION" -- "$cur")")
return 0
;;
# --detection-mode | *detection)
# COMPREPLY=("$(compgen -W "mixed active passive" "$cur")")
# return 0
# ;;
--enumerate | -e)
case $prev in
vp | ap | p)
COMPREPLY=("$(compgen -W "vt at t tt cb dbe u m" -- "$cur")")
return 0
;;
vt | at | t)
COMPREPLY=("$(compgen -W "vp ap p tt cb dbe u m" -- "$cur")")
return 0
;;
*)
COMPREPLY=("$(compgen -W "vp ap p vt at t tt cb dbe u m" -- "$cur")")
return 0
;;
esac
;;
# --enumerate | -e)
# case $prev in
# vp | ap | p)
# COMPREPLY=("$(compgen -W "vt at t tt cb dbe u m" "$cur")")
# return 0
# ;;
# vt | at | t)
# COMPREPLY=("$(compgen -W "vp ap p tt cb dbe u m" "$cur")")
# return 0
# ;;
# *)
# COMPREPLY=("$(compgen -W "vp ap p vt at t tt cb dbe u m" "$cur")")
# return 0
# ;;
# esac
# ;;
--password-attack)
COMPREPLY=("$(compgen -W "wp-login xmlrpc xmlrpc-multicall" -- "$cur")")
;;
# --password-attack)
# COMPREPLY=("$(compgen -W "wp-login xmlrpc xmlrpc-multicall" "$cur")")
# ;;
## HANDLE ALL OTHER
*)
# COMPREPLY=("$(compgen -W "$OPTS" "$cur")")
for OPT in "${OPTS[@]}"; do
if [[ "$OPT" == "$2"* ]]; then
COMPREPLY+=("$OPT")