Merge branch 'g0tmi1k-searchsploit'
This commit is contained in:
commit
37ddb2eb21
1 changed files with 9 additions and 9 deletions
18
searchsploit
18
searchsploit
|
@ -11,8 +11,8 @@
|
||||||
# Exit code '6' means updated from GitHub
|
# Exit code '6' means updated from GitHub
|
||||||
|
|
||||||
|
|
||||||
## OS settings
|
## OS settings (get the path of where the script is stored + database file)
|
||||||
gitpath="${0%/*}"
|
gitpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
csvpath="${gitpath}/files.csv"
|
csvpath="${gitpath}/files.csv"
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ SEARCH=""
|
||||||
LANG=C
|
LANG=C
|
||||||
|
|
||||||
|
|
||||||
## If we cannot find files.csv in ${gitpath}
|
## If we cannot find files.csv
|
||||||
if [[ ! -f "${csvpath}" ]]; then
|
if [[ ! -f "${csvpath}" ]]; then
|
||||||
echo '[!] Could not find: ' ${csvpath}
|
echo '[!] Could not find: ' ${csvpath}
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -363,25 +363,25 @@ fi
|
||||||
## Magic search Fu
|
## Magic search Fu
|
||||||
## Web link format?
|
## Web link format?
|
||||||
if [[ "${WEBLINK}" -eq 1 ]]; then
|
if [[ "${WEBLINK}" -eq 1 ]]; then
|
||||||
OUTPUT="$(awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, "https://www.exploit-db.com/exploits/"$1"/"}' "${csvpath}" \
|
OUTPUT="$( awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, "https://www.exploit-db.com/exploits/"$1"/"}' "${csvpath}" \
|
||||||
| eval "${SEARCH}")"
|
| eval "${SEARCH}" )"
|
||||||
## Just the EDB-ID?
|
## Just the EDB-ID?
|
||||||
elif [[ "${EDBID}" -eq 1 ]]; then
|
elif [[ "${EDBID}" -eq 1 ]]; then
|
||||||
OUTPUT="$(awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, $1}' "${csvpath}" \
|
OUTPUT="$( awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, $1}' "${csvpath}" \
|
||||||
| eval "${SEARCH}" )"
|
| eval "${SEARCH}" )"
|
||||||
## Print JSON format (full options)
|
## Print JSON format (full options)
|
||||||
elif [[ "${JSON}" -eq 1 ]]; then
|
elif [[ "${JSON}" -eq 1 ]]; then
|
||||||
OUTPUT="$(awk -F "\"*,\"*" '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $3, $2, $1}' "${csvpath}" \
|
OUTPUT="$( awk -F "\"*,\"*" '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $3, $2, $1}' "${csvpath}" \
|
||||||
| eval "${SEARCH}" \
|
| eval "${SEARCH}" \
|
||||||
| sed '$ s/,$//g' )"
|
| sed '$ s/,$//g' )"
|
||||||
## Default view
|
## Default view
|
||||||
else
|
else
|
||||||
OUTPUT=$OUTPUT"$(awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, $2}' "${csvpath}" \
|
OUTPUT="$( awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, $2}' "${csvpath}" \
|
||||||
| eval "${SEARCH}" \
|
| eval "${SEARCH}" \
|
||||||
| sed "s/| platforms/| ./" )"
|
| sed "s/| platforms/| ./" )"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $OUTPUT
|
echo "${OUTPUT}"
|
||||||
|
|
||||||
## Print footer if not in JSON
|
## Print footer if not in JSON
|
||||||
if [[ "${JSON}" -eq 0 ]]; then
|
if [[ "${JSON}" -eq 0 ]]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue