From 2b920958228c25aa04ccfe9074451fc2beb84eac Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Tue, 20 Dec 2016 11:14:28 +0000 Subject: [PATCH] Better solution for #64 --- searchsploit | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/searchsploit b/searchsploit index 83e977370..08fb310a0 100755 --- a/searchsploit +++ b/searchsploit @@ -615,25 +615,29 @@ else fi +## Strip un-wanted values +SEARCH="${SEARCH} | sed 's/\"//g'" + + ## Magic search Fu ## Web link format ("--www")? if [[ "${WEBLINK}" -eq 1 ]]; then OUTPUT="$( eval ${SEARCH} \ - | awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, "https://www.exploit-db.com/exploits/"$1"/"}' )" + | awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $3, "https://www.exploit-db.com/exploits/"$1"/"}' )" ## Just the EDB-ID ("--id")? elif [[ "${EDBID}" -eq 1 ]]; then OUTPUT="$( eval ${SEARCH} \ - | awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, $1 }' )" + | awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $3, $1 }' )" ## Print JSON format (full options) ("--json")? elif [[ "${JSON}" -eq 1 ]]; then OUTPUT="$( eval ${SEARCH} \ - | awk -F "\"*,\"*" '{ printf "\r\t\t'{'\"Exploit\":\"%s,\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $3, $2, $1 }' \ + | awk -F ',' '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $3, $2, $1 }' \ | sed '$ s/,$//g' )" ## Default view else OUTPUT="$( eval ${SEARCH} \ - | awk -F "\"*,\"*" '{ printf "%-'${FORMAT}'s | %s\n", $3, $2 }' \ - | sed "s/| platforms/| /" )" + | awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $3, $2 }' \ + | sed 's/| platforms/| /' )" fi