diff --git a/dev-db/sqlmap/Manifest b/dev-db/sqlmap/Manifest index 1e1bc8a8b..fd07d49e2 100644 --- a/dev-db/sqlmap/Manifest +++ b/dev-db/sqlmap/Manifest @@ -1 +1 @@ -DIST sqlmap-1.2.11.tar.gz 7426205 BLAKE2B b14fee649d80f9310a0f9e2c1010cfa642499d902131c70de7a82b0dca18182f3a1d45d4f59b76c0d87eebbe4fd4200186bdf5391602fbf5b85eff8d90d686d2 SHA512 af4439bbb78ca0a7d30e477fc01f88b8e0b644ed99beb0fbb0c5b666e4ffab6a193e5df505e8eb7a3bee2cd9922c5dc7ae101b6d27fe6f092c43bfcf0e2487e2 +DIST sqlmap-1.2.12.tar.gz 7429235 BLAKE2B c40ad614f43a3338f458653b5da23d7cf4e8fce60e84c01b3e3fc2faa0afb49bdcc0bff259cdf490095eb611dd8ce6f4abb8a4e8e16e6e01a621255348d38478 SHA512 0955cee78db484dd7bde34fadebadc067326dd1e9a53151b0e1eb6e877af4a2da49e37146ffdb327c44255dd862b84bb0510024f1e267e69a7aaec964d4c5130 diff --git a/dev-db/sqlmap/files/sqlmap.bash-completion b/dev-db/sqlmap/files/sqlmap.bash-completion new file mode 100644 index 000000000..f4170f1d6 --- /dev/null +++ b/dev-db/sqlmap/files/sqlmap.bash-completion @@ -0,0 +1,157 @@ +# bash completion for sqlmap by Korznikov Alexander +# cp sqlmap_bash_completion /etc/bash_completion.d/sqlmap + +tamper=$(ls /usr/share/sqlmap/tamper|grep -v "__" |sed ':a;N;$!ba;s/\n/ /g') + +_sqlmap() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=`_get_pword` + + case $prev in + + # List directory content + --tamper) + COMPREPLY=( $( compgen -W "$tamper" -- "$cur" ) ) + return 0 + ;; + --output-dir|-t|-l|-m|-r|--load-cookies|--proxy-file|--sql-file|--shared-lib|--file-write) + _filedir + return 0 + ;; + -c) + _filedir ini + return 0 + ;; + --method) + COMPREPLY=( $( compgen -W 'GET POST PUT' -- "$cur" ) ) + return 0 + ;; + --auth-type) + COMPREPLY=( $( compgen -W 'Basic Digest NTLM PKI' -- "$cur" ) ) + return 0 + ;; + --tor-type) + COMPREPLY=( $( compgen -W 'HTTP SOCKS4 SOCKS5' -- "$cur" ) ) + return 0 + ;; + -v) + COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- "$cur" ) ) + return 0 + ;; + --dbms) + COMPREPLY=( $( compgen -W 'mysql mssql access postgres' -- "$cur" ) ) + return 0 + ;; + --level|--crawl) + COMPREPLY=( $( compgen -W '1 2 3 4 5' -- "$cur" ) ) + return 0 + ;; + --risk) + COMPREPLY=( $( compgen -W '0 1 2 3' -- "$cur" ) ) + return 0 + ;; + --technique) + COMPREPLY=( $( compgen -W 'B E U S T Q' -- "$cur" ) ) + return 0 + ;; + -s) + _filedir sqlite + return 0 + ;; + --dump-format) + COMPREPLY=( $( compgen -W 'CSV HTML SQLITE' -- "$cur" ) ) + return 0 + ;; + -x) + _filedir xml + return 0 + ;; + esac + + if [[ "$cur" == * ]]; then + COMPREPLY=( $( compgen -W '-h --help -hh --version -v -d -u --url -l -x -m -r -g -c --method \ + --data --param-del --cookie --cookie-del --load-cookies \ + --drop-set-cookie --user-agent --random-agent --host --referer \ + --headers --auth-type --auth-cred --auth-private --ignore-401 \ + --proxy --proxy-cred --proxy-file --ignore-proxy --tor --tor-port \ + --tor-type --check-tor --delay --timeout --retries --randomize \ + --safe-url --safe-freq --skip-urlencode --csrf-token --csrf-url \ + --force-ssl --hpp --eval -o --predict-output --keep-alive \ + --null-connection --threads -p --skip --dbms --dbms-cred \ + --os --invalid-bignum --invalid-logical --invalid-string \ + --no-cast --no-escape --prefix --suffix --tamper --level \ + --risk --string --not-string --regexp --code --text-only \ + --titles --technique --time-sec --union-cols --union-char \ + --union-from --dns-domain --second-order -f --fingerprint \ + -a --all -b --banner --current-user --current-db --hostname \ + --is-dba --users --passwords --privileges --roles --dbs --tables \ + --columns --schema --count --dump --dump-all --search --comments \ + -D -T -C -X -U --exclude-sysdbs --where --start --stop \ + --first --last --sql-query --sql-shell --sql-file --common-tables \ + --common-columns --udf-inject --shared-lib --file-read --file-write \ + --file-dest --os-cmd --os-shell --os-pwn --os-smbrelay --os-bof \ + --priv-esc --msf-path --tmp-path --reg-read --reg-add --reg-del \ + --reg-key --reg-value --reg-data --reg-type -s -t --batch \ + --charset --crawl --csv-del --dump-format --eta --flush-session \ + --forms --fresh-queries --hex --output-dir --parse-errors \ + --pivot-column --save --scope --test-filter --update \ + -z --alert --answers --beep --check-waf --cleanup \ + --dependencies --disable-coloring --gpage --identify-waf \ + --mobile --page-rank --purge-output --smart \ + --sqlmap-shell --wizard' -- "$cur" ) ) + # this removes any options from the list of completions that have + # already been specified somewhere on the command line, as long as + # these options can only be used once (in a word, "options", in + # opposition to "tests" and "actions", as in the find(1) manpage). + onlyonce=' -h --help -hh --version -v -d -u --url -l -x -m -r -g -c \ + --drop-set-cookie --random-agent \ + --ignore-401 \ + --ignore-proxy --tor \ + --check-tor \ + --skip-urlencode \ + --force-ssl --hpp -o --predict-output --keep-alive \ + --null-connection -p \ + --invalid-bignum --invalid-logical --invalid-string \ + --no-cast --no-escape \ + --text-only \ + --titles \ + -f --fingerprint \ + -a --all -b --banner --current-user --current-db --hostname \ + --is-dba --users --passwords --privileges --roles --dbs --tables \ + --columns --schema --count --dump --dump-all --search --comments \ + -D -T -C -X -U --exclude-sysdbs \ + --sql-shell --common-tables \ + --common-columns --udf-inject \ + --os-shell --os-pwn --os-smbrelay --os-bof \ + --priv-esc --reg-read --reg-add --reg-del \ + -s -t --batch \ + --eta --flush-session \ + --forms --fresh-queries --hex --parse-errors \ + --save --update \ + -z --beep --check-waf --cleanup \ + --dependencies --disable-coloring --identify-waf \ + --mobile --page-rank --purge-output --smart \ + --sqlmap-shell --wizard ' + COMPREPLY=( $( \ + (while read -d ' ' i; do + [[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] && + continue + # flatten array with spaces on either side, + # otherwise we cannot grep on word boundaries of + # first and last word + COMPREPLY=" ${COMPREPLY[@]} " + # remove word from list of completions + COMPREPLY=( ${COMPREPLY/ ${i%% *} / } ) + done + printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}" + ) ) + +# else +# _filedir bat + fi +} && +complete -F _sqlmap sqlmap diff --git a/dev-db/sqlmap/sqlmap-1.2.11.ebuild b/dev-db/sqlmap/sqlmap-1.2.12.ebuild similarity index 100% rename from dev-db/sqlmap/sqlmap-1.2.11.ebuild rename to dev-db/sqlmap/sqlmap-1.2.12.ebuild diff --git a/dev-db/sqlmap/sqlmap-9999.ebuild b/dev-db/sqlmap/sqlmap-9999.ebuild index 30428d410..6096c19fd 100644 --- a/dev-db/sqlmap/sqlmap-9999.ebuild +++ b/dev-db/sqlmap/sqlmap-9999.ebuild @@ -4,7 +4,7 @@ EAPI=6 PYTHON_COMPAT=( python2_7 ) -inherit python-single-r1 +inherit python-single-r1 bash-completion-r1 if [[ ${PV} == "9999" ]]; then inherit git-r3 @@ -51,4 +51,6 @@ src_install () { cp -R * "${ED}"/usr/share/${PN}/ python_fix_shebang "${ED}"/usr/share/${PN} dosym "${EPREFIX}"/usr/share/${PN}/sqlmap.py /usr/bin/${PN} + + newbashcomp "${FILESDIR}"/sqlmap.bash-completion sqlmap }