SearchSploit - tweaked output of '-p'

This commit is contained in:
g0tmi1k 2016-03-19 22:00:59 +00:00
parent 1f858f098b
commit 308309b359

View file

@ -196,15 +196,15 @@ if [[ "${GETPATH}" -eq 1 ]]; then
edbdb="$( echo ${TAGS} | tr -dc '0-9' )" edbdb="$( echo ${TAGS} | tr -dc '0-9' )"
## Check files.csv ## Check files.csv
location=$( cut -d, -f2 "${csvpath}" | grep -m 1 -E "/${edbdb}(\..*)?$" ) location=$( cut -d, -f2 "${csvpath}" | grep -m 1 -E "/${edbdb}(\..*)?$" )
title=$( grep -m 1 "${location}" "${csvpath}" | cut -d, -f3 ) title=$( grep -m 1 "${location}" "${csvpath}" | cut -d, -f3 | sed 's/"//g')
## Join paths ## Join paths
location="${gitpath}/${location}" location="${gitpath}/${location}"
## Did we find the exploit? ## Did we find the exploit?
if [[ -f "${location}" ]]; then if [[ -f "${location}" ]]; then
## Display out ## Display out
echo " EDB-ID: ${title}" echo "Exploit: ${title}"
echo "Exploit: ${location}" echo " Path: ${location}"
echo "" echo ""
## Are any copy programs available? ## Are any copy programs available?
@ -212,11 +212,11 @@ if [[ "${GETPATH}" -eq 1 ]]; then
## Linux ## Linux
if hash xclip 2>/dev/null; then if hash xclip 2>/dev/null; then
echo -ne "${location}" | xclip -selection clipboard echo -ne "${location}" | xclip -selection clipboard
echo "Copied exploit path to the clipboard." echo "Copied the file path to the clipboard."
## OSX ## OSX
elif hash pbcopy 2>/dev/null; then elif hash pbcopy 2>/dev/null; then
echo -ne "${location}" | pbcopy echo -ne "${location}" | pbcopy
echo "Copied exploit path to the clipboard." echo "Copied the file path to the clipboard."
fi fi
fi fi
@ -224,7 +224,7 @@ if [[ "${GETPATH}" -eq 1 ]]; then
exit 0 exit 0
else else
## Feedback ## Feedback
echo "Could not find exploit ${edbdb}" echo "Could not find exploit EDB-ID #${edbdb}"
## Quit ## Quit
exit 1 exit 1