-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from PoCInnovation/16-feature-flag-to-include-…
…data-when-http-method-post-for-posting-data feat: added --data and --method
- Loading branch information
Showing
8 changed files
with
99 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,43 @@ | ||
#!/bin/bash | ||
_bruteforce() { | ||
local cur prev opts methods | ||
|
||
_bruteforce_completion() { | ||
local cur prev opts | ||
cur="${COMP_WORDS[COMP_CWORD]}" | ||
prev="${COMP_WORDS[COMP_CWORD-1]}" | ||
opts="--threads -v --status-codes --header --body --wordlist" | ||
|
||
if [[ ${COMP_CWORD} -eq 1 ]]; then | ||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | ||
elif [[ ${COMP_CWORD} -eq 2 ]]; then | ||
case "${prev}" in | ||
--threads) | ||
COMPREPLY=( $(compgen -W "1 2 4 8 16 32" -- "${cur}") ) | ||
;; | ||
--status-codes) | ||
COMPREPLY=( $(compgen -W "200 401 403 404 429 500" -- "${cur}") ) | ||
;; | ||
--header|--body|--wordlist) | ||
COMPREPLY=() | ||
;; | ||
esac | ||
else | ||
COMPREPLY=( $(compgen -W "http:// https://" -- "${cur}") ) | ||
opts="-v --threads --status-codes --header --body --wordlist --method --data" | ||
|
||
methods="POST GET PUT PATCH DELETE HEAD OPTIONS" | ||
|
||
case "$prev" in | ||
--threads) | ||
COMPREPLY=( $(compgen -W "1 2 4 8 16 32" -- "$cur") ) | ||
return 0 | ||
;; | ||
--status-codes) | ||
COMPREPLY=( $(compgen -W "200 401 403 404 429 500" -- "$cur") ) | ||
return 0 | ||
;; | ||
--method) | ||
COMPREPLY=( $(compgen -W "$methods" -- "$cur") ) | ||
return 0 | ||
;; | ||
--wordlist) | ||
COMPREPLY=( $(compgen -f -- "$cur") ) | ||
return 0 | ||
;; | ||
--header|--body|--data) | ||
return 0 | ||
;; | ||
*) | ||
;; | ||
esac | ||
|
||
if [[ "$cur" == http* ]]; then | ||
COMPREPLY=( $(compgen -W "http:// https://" -- "$cur") ) | ||
return 0 | ||
fi | ||
|
||
COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) | ||
} | ||
|
||
complete -F _bruteforce_completion bruteforce | ||
complete -F _bruteforce bruteforce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters