Merge pull request #98 from g0tmi1k/searchsploit

Fix #97 & More Display Output
This commit is contained in:
g0tmi1k 2017-08-29 11:52:07 +01:00 committed by GitHub
commit e3a111f58c

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Name: SearchSploit - Exploit-DB's CLI search tool # Name: SearchSploit - Exploit-DB's CLI search tool
# Version: 3.8.2 (Release date: 2017-06-26) # Version: 3.8.3 (Release date: 2017-08-29)
# Written by: Offensive Security, Unix-Ninja, and g0tmi1k # Written by: Offensive Security, Unix-Ninja, and g0tmi1k
# Homepage: https://github.com/offensive-security/exploit-database # Homepage: https://github.com/offensive-security/exploit-database
# Manual: https://www.exploit-db.com/searchsploit/ # Manual: https://www.exploit-db.com/searchsploit/
@ -197,6 +197,7 @@ function updategit()
fi fi
echo -e "\n[*] Git update finished." echo -e "\n[*] Git update finished."
echo "[i] Path: ${gitpath}/platforms/"
exit 6 exit 6
} }
@ -565,7 +566,7 @@ if [[ "${GETPATH}" -eq 1 ]]; then
if [[ "${MIRROR}" -eq 1 ]]; then if [[ "${MIRROR}" -eq 1 ]]; then
cp -i "${location}" "$( pwd )/" cp -i "${location}" "$( pwd )/"
echo "Copied to '$( pwd )/'" echo "Copied to: $( pwd )/$( basename ${location} )"
echo -e "\n" echo -e "\n"
fi fi
else else
@ -693,9 +694,9 @@ elif [[ "${EDBID}" -eq 1 ]]; then
## Print JSON format (full options) ("--json")? ## Print JSON format (full options) ("--json")?
elif [[ "${JSON}" -eq 1 ]]; then elif [[ "${JSON}" -eq 1 ]]; then
OUTPUT="$( eval ${SEARCH} \ OUTPUT="$( eval ${SEARCH} \
| awk -F ',' '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Platform\":\"%s\",\"Type\":\"%s\",\"Date\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $2, $5, $6, $4, $3, $1 }' \ | awk -F ',' '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Platform\":\"%s\",\"Type\":\"%s\",\"Date\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":\"%s\"},\n", $2, $5, $6, $4, $3, $1 }' \
| sed '$ s/,$//g' \ | sort \
| sort )" | sed '$ s/,$//g' )"
## Default view ## Default view
else else
OUTPUT="$( eval ${SEARCH} \ OUTPUT="$( eval ${SEARCH} \