Merge pull request #90 from g0tmi1k/searchsploit

Better EDB-ID detection - able to put in path and it will extract the value
This commit is contained in:
g0tmi1k 2017-06-13 13:50:12 +01:00 committed by GitHub
commit 6bf2cee7fc

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.7.5 (Release date: 2017-04-21) # Version: 3.7.6 (Release date: 2017-06-13)
# 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/
@ -508,7 +508,7 @@ fi
if [[ "${GETPATH}" -eq 1 ]]; then if [[ "${GETPATH}" -eq 1 ]]; then
for exploit in $(echo ${TAGS}); do for exploit in $(echo ${TAGS}); do
## Get EDB-ID from input ## Get EDB-ID from input
edbdb="$( echo ${exploit} | tr -dc '0-9' )" edbdb="$( echo ${exploit} | rev | cut -d '/' -f1 | rev | cut -d'.' -f1 | 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}(\..*)?$" )