Remove leading slash on path results & add manual references in

This commit is contained in:
g0tmi1k 2017-03-17 10:55:36 +00:00
parent 641870e4f7
commit 19f77d26f4

View file

@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
# Name: SearchSploit - Exploit-DB's CLI search tool # Name: SearchSploit - Exploit-DB's CLI search tool
# Version: 3.7.3 (Release date: 2016-12-20) # Version: 3.7.4 (Release date: 2017-03-17)
# 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/
# #
## NOTE: ## NOTE:
# Exit code '0' means finished normally # Exit code '0' means finished normally
@ -67,6 +68,8 @@ function usage()
echo " ${progname} -t oracle windows" echo " ${progname} -t oracle windows"
echo " ${progname} -p 39446" echo " ${progname} -p 39446"
echo echo
echo " For more examples, see the manual: https://www.exploit-db.com/searchsploit/"
echo
echo "=========" echo "========="
echo " Options " echo " Options "
echo "=========" echo "========="
@ -323,7 +326,7 @@ function nmapxml()
done done
## Read in from file (so there are no duplicates - ...but unable to print out IPs) ## Read in from file (so there are no duplicates - ...but unable to print out IPs)
cat /tmp/searchsploit.tmp /tmp/searchsploit.out 2>/dev/null | tr '[:upper:]' '[:lower:]' | awk '!x[$0]++' | while read software; do cat /tmp/searchsploit.out /tmp/searchsploit.tmp 2>/dev/null | tr '[:upper:]' '[:lower:]' | awk '!x[$0]++' | while read software; do
searchsploitout searchsploitout
done done
} }
@ -584,7 +587,7 @@ if [[ "${JSON}" -eq 0 ]]; then
else else
echo "| Path" echo "| Path"
printf "%-${COL1}s " printf "%-${COL1}s "
echo "| (${gitpath}/platforms)" echo "| (${gitpath}/platforms/)"
fi fi
drawline drawline
## Print JSON header ## Print JSON header
@ -598,7 +601,7 @@ fi
## JSON require full options ## JSON require full options
if [[ "${JSON}" -eq 1 ]]; then if [[ "${JSON}" -eq 1 ]]; then
## Read in id, title, path, type, date, plateform separated between commas ## Read in id, title, path, type, date, platform separated between commas
SEARCH="awk -F '[,]' '{print \$1\",\"\$2\",\"\$3\",\"\$4\",\"\$6\",\"\$7}' \"${csvpath}\"" SEARCH="awk -F '[,]' '{print \$1\",\"\$2\",\"\$3\",\"\$4\",\"\$6\",\"\$7}' \"${csvpath}\""
else else
## Read in id, title and path, separated between commas (as these are the only visible fields) ## Read in id, title and path, separated between commas (as these are the only visible fields)
@ -659,7 +662,7 @@ elif [[ "${JSON}" -eq 1 ]]; then
else else
OUTPUT="$( eval ${SEARCH} \ OUTPUT="$( eval ${SEARCH} \
| awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $3, $2 }' \ | awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $3, $2 }' \
| sed 's/| platforms/| /' )" | sed 's_| platforms/_| _' )"
fi fi