show more detailed results with JSON output
This commit is contained in:
parent
66117c63f5
commit
0c1feefa49
1 changed files with 14 additions and 8 deletions
20
searchsploit
20
searchsploit
|
@ -590,14 +590,20 @@ if [[ "${JSON}" -eq 0 ]]; then
|
||||||
## Print JSON header
|
## Print JSON header
|
||||||
else
|
else
|
||||||
echo "{"
|
echo "{"
|
||||||
echo " \"SEARCH\": \"${TAGS}\","
|
printf "\t\"SEARCH\": \"${TAGS}\",\n"
|
||||||
echo " \"RESULTS\": ["
|
printf "\t\"DB_PATH\": \"${gitpath}\",\n"
|
||||||
|
printf "\t\"RESULTS\": [\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
## Read in id, title and path, separated between commas (as these are the only visible fields)
|
## JSON require full options
|
||||||
SEARCH="awk -F '[,]' '{print \$1\",\"\$2\",\"\$3}' \"${csvpath}\""
|
if [[ "${JSON}" -eq 1 ]]; then
|
||||||
|
## Read in id, title, path, type, date, plateform separated between commas
|
||||||
|
SEARCH="awk -F '[,]' '{print \$1\",\"\$2\",\"\$3\",\"\$4\",\"\$6\",\"\$7}' \"${csvpath}\""
|
||||||
|
else
|
||||||
|
## Read in id, title and path, separated between commas (as these are the only visible fields)
|
||||||
|
SEARCH="awk -F '[,]' '{print \$1\",\"\$2\",\"\$3}' \"${csvpath}\""
|
||||||
|
fi
|
||||||
|
|
||||||
## EXACT search command ("-e")?
|
## EXACT search command ("-e")?
|
||||||
if [[ "${EXACT}" -eq 1 ]]; then
|
if [[ "${EXACT}" -eq 1 ]]; then
|
||||||
|
@ -647,7 +653,7 @@ 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\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $3, $2, $1 }' \
|
| awk -F ',' '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Platform\":\"%s\",\"Type\":\"%s\",\"Date\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":%s},\n", $3, $5, $6, $4, $2, $1 }' \
|
||||||
| sed '$ s/,$//g' )"
|
| sed '$ s/,$//g' )"
|
||||||
## Default view
|
## Default view
|
||||||
else
|
else
|
||||||
|
@ -671,7 +677,7 @@ if [[ "${JSON}" -eq 0 ]]; then
|
||||||
drawline
|
drawline
|
||||||
## Print JSON footer
|
## Print JSON footer
|
||||||
else
|
else
|
||||||
echo " ]"
|
printf "\t]\n"
|
||||||
echo "}"
|
echo "}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue