commit:     0c2636d824eb25536bd113fba5e2f783568558ff
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Fri Mar 11 16:08:38 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr  5 03:13:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c2636d8

dev-db/sqlmap: new ebuild

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/24494
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-db/sqlmap/Manifest                     |   1 +
 dev-db/sqlmap/files/sqlmap.bash-completion | 158 +++++++++++++++++++++++++++++
 dev-db/sqlmap/metadata.xml                 |  20 ++++
 dev-db/sqlmap/sqlmap-1.6.2.ebuild          |  60 +++++++++++
 dev-db/sqlmap/sqlmap-9999.ebuild           |  60 +++++++++++
 5 files changed, 299 insertions(+)

diff --git a/dev-db/sqlmap/Manifest b/dev-db/sqlmap/Manifest
new file mode 100644
index 000000000000..c37adc6febf9
--- /dev/null
+++ b/dev-db/sqlmap/Manifest
@@ -0,0 +1 @@
+DIST sqlmap-1.6.2.tar.gz 7258723 BLAKE2B 
cc972eda5351683904e4c9d4f7e0ab9c127c22de597397e976060808812032b2041f68ab2d737784e499a20a7ca930167427390ca178269d744ee71738e5c270
 SHA512 
a3057486f5096fb2a242296b4ceeb1c500246fbd322c3e52f71e72cd91d1c676ca6f7746becf887625e45d0b14443a669410b28bd6a995124a6e8006c4534976

diff --git a/dev-db/sqlmap/files/sqlmap.bash-completion 
b/dev-db/sqlmap/files/sqlmap.bash-completion
new file mode 100644
index 000000000000..47e11297ed89
--- /dev/null
+++ b/dev-db/sqlmap/files/sqlmap.bash-completion
@@ -0,0 +1,158 @@
+# bash completion for sqlmap by Korznikov Alexander
+# source: 
http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html
+# 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/metadata.xml b/dev-db/sqlmap/metadata.xml
new file mode 100644
index 000000000000..9be066d6c8f4
--- /dev/null
+++ b/dev-db/sqlmap/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person" proxied="yes">
+               <email>mario.haust...@hrz.tu-chemnitz.de</email>
+               <name>Mario Haustein</name>
+       </maintainer>
+       <maintainer type="person">
+               <email>s...@gentoo.org</email>
+               <name>Sam James</name>
+       </maintainer>
+       <longdescription>
+               sqlmap is an open source penetration testing tool that 
automates the
+               process of detecting and exploiting SQL injection flaws and 
taking over
+               of database servers.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">sqlmapproject/sqlmap</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/dev-db/sqlmap/sqlmap-1.6.2.ebuild 
b/dev-db/sqlmap/sqlmap-1.6.2.ebuild
new file mode 100644
index 000000000000..1844e8ba2536
--- /dev/null
+++ b/dev-db/sqlmap/sqlmap-1.6.2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..10} )
+PYTHON_REQ_USE="sqlite"
+
+inherit bash-completion-r1 python-single-r1 wrapper
+
+DESCRIPTION="An automatic SQL injection and database takeover tool"
+HOMEPAGE="https://sqlmap.org/";
+
+if [[ ${PV} == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/sqlmapproject/sqlmap";
+else
+       
SRC_URI="https://github.com/sqlmapproject/sqlmap/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+# sqlmap (GPL-2+)
+# ansitrm (BSD)
+# beautifulsoup (BSD)
+# bottle (MIT)
+# charder (LGPL-2.1+)
+# clientform (BSD)
+# colorama (BSD)
+# fcrypt (BSD-2)
+# identitywaf (MIT)
+# keepalive (LGPL-2.1+)
+# magic (MIT)
+# multipartpost (LGPL-2.1+)
+# ordereddict (MIT)
+# prettyprint (BSD-2)
+# pydes (public-domain)
+# six (MIT)
+# socks (BSD)
+# termcolor (BSD)
+# wininetpton (public-domain)
+LICENSE="BSD BSD-2 GPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT=0
+
+RDEPEND="${PYTHON_DEPS}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DOCS=( doc/ README.md )
+
+src_install () {
+       einstalldocs
+
+       insinto "/usr/share/${PN}/"
+       doins -r *
+       python_optimize "${ED}/usr/share/${PN}"
+
+       make_wrapper "${PN}" \
+               "${EPYTHON} /usr/share/${PN}/sqlmap.py"
+
+       newbashcomp "${FILESDIR}"/sqlmap.bash-completion sqlmap
+}

diff --git a/dev-db/sqlmap/sqlmap-9999.ebuild b/dev-db/sqlmap/sqlmap-9999.ebuild
new file mode 100644
index 000000000000..1844e8ba2536
--- /dev/null
+++ b/dev-db/sqlmap/sqlmap-9999.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..10} )
+PYTHON_REQ_USE="sqlite"
+
+inherit bash-completion-r1 python-single-r1 wrapper
+
+DESCRIPTION="An automatic SQL injection and database takeover tool"
+HOMEPAGE="https://sqlmap.org/";
+
+if [[ ${PV} == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/sqlmapproject/sqlmap";
+else
+       
SRC_URI="https://github.com/sqlmapproject/sqlmap/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+# sqlmap (GPL-2+)
+# ansitrm (BSD)
+# beautifulsoup (BSD)
+# bottle (MIT)
+# charder (LGPL-2.1+)
+# clientform (BSD)
+# colorama (BSD)
+# fcrypt (BSD-2)
+# identitywaf (MIT)
+# keepalive (LGPL-2.1+)
+# magic (MIT)
+# multipartpost (LGPL-2.1+)
+# ordereddict (MIT)
+# prettyprint (BSD-2)
+# pydes (public-domain)
+# six (MIT)
+# socks (BSD)
+# termcolor (BSD)
+# wininetpton (public-domain)
+LICENSE="BSD BSD-2 GPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT=0
+
+RDEPEND="${PYTHON_DEPS}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DOCS=( doc/ README.md )
+
+src_install () {
+       einstalldocs
+
+       insinto "/usr/share/${PN}/"
+       doins -r *
+       python_optimize "${ED}/usr/share/${PN}"
+
+       make_wrapper "${PN}" \
+               "${EPYTHON} /usr/share/${PN}/sqlmap.py"
+
+       newbashcomp "${FILESDIR}"/sqlmap.bash-completion sqlmap
+}

Reply via email to