diff --git a/README.md b/README.md index 90e5b1df6..72dcb9882 100644 --- a/README.md +++ b/README.md @@ -62,14 +62,14 @@ root@kali:~# searchsploit afd windows local Exploit Title | Path | (/usr/share/exploitdb/platforms/) ---------------------------------------------------------------------------------------- ----------------------------------- -Microsoft Windows XP - 'afd.sys' Local Kernel Denial of Service | windows/dos/17133.c +Microsoft Windows (x86) - 'afd.sys' Privilege Escalation (MS11-046) | win_x86/local/40564.c +Microsoft Windows - 'AfdJoinLeaf' Privilege Escalation (MS11-080) (Metasploit) | windows/local/21844.rb Microsoft Windows - 'afd.sys' Local Kernel Exploit (PoC) (MS11-046) | windows/dos/18755.c +Microsoft Windows 7 (x64) - 'afd.sys' Dangling Pointer Privilege Escalation (MS14-040) | win_x86-64/local/39525.py +Microsoft Windows 7 (x86) - 'afd.sys' Dangling Pointer Privilege Escalation (MS14-040) | win_x86/local/39446.py +Microsoft Windows XP - 'afd.sys' Local Kernel Denial of Service | windows/dos/17133.c Microsoft Windows XP/2003 - 'afd.sys' Privilege Escalation (K-plugin) (MS08-066) | windows/local/6757.txt Microsoft Windows XP/2003 - 'afd.sys' Privilege Escalation (MS11-080) | windows/local/18176.py -Microsoft Windows - 'AfdJoinLeaf' Privilege Escalation (MS11-080) (Metasploit) | windows/local/21844.rb -Microsoft Windows 7 (x86) - 'afd.sys' Dangling Pointer Privilege Escalation (MS14-040) | win_x86/local/39446.py -Microsoft Windows 7 (x64) - 'afd.sys' Dangling Pointer Privilege Escalation (MS14-040) | win_x86-64/local/39525.py -Microsoft Windows (x86) - 'afd.sys' Privilege Escalation (MS11-046) | win_x86/local/40564.c ---------------------------------------------------------------------------------------- ----------------------------------- root@kali:~# root@kali:~# searchsploit -p 39446 diff --git a/searchsploit b/searchsploit index ae1a693af..046bae613 100755 --- a/searchsploit +++ b/searchsploit @@ -1,6 +1,6 @@ #!/bin/bash # Name: SearchSploit - Exploit-DB's CLI search tool -# Version: 3.8.5 (Release date: 2017-09-18) +# Version: 3.8.6 (Release date: 2017-20-23) # Written by: Offensive Security, Unix-Ninja, and g0tmi1k # Homepage: https://github.com/offensive-security/exploit-database # Manual: https://www.exploit-db.com/searchsploit/ @@ -199,8 +199,10 @@ function updategit() # If conflicts, clean and try again if [[ "$?" -ne 0 ]]; then echo -e "\n[-] Git conflict" - git clean -d -fx "" - git pull upstream master + git clean -d -fx "" \ + || sudo git clean -d -fx "" + git pull upstream master \ + || sudo git pull upstream master fi echo -e "\n[*] Git update finished." @@ -547,11 +549,11 @@ if [[ "${GETPATH}" -eq 1 ]]; then ## Linux (Will require $DISPLAY) if hash xclip 2>/dev/null; then echo -ne "${location}" | xclip -selection clipboard 2>/dev/null - echo "Copied EDB-ID ${edbdb}'s path to the clipboard." + echo "Copied EDB-ID #${edbdb}'s path to the clipboard." ## OSX elif hash pbcopy 2>/dev/null; then echo -ne "${location}" | pbcopy - echo "Copied EDB-ID ${edbdb}'s path to the clipboard." + echo "Copied EDB-ID #${edbdb}'s path to the clipboard." fi fi @@ -688,8 +690,26 @@ fi ## Magic search Fu +## Print JSON format (full options) ("--json")? +if [[ "${JSON}" -eq 1 ]]; then + ## Web link format ("--www")? + if [[ "${WEBLINK}" -eq 1 ]]; then + OUTPUT="$( eval ${SEARCH} \ + | awk -F ',' '{ printf "\\r\\t\\t'{'\"Exploit\":\"%s\",\"URL\":\"https://www.exploit-db.com/exploits/%s/\"},\n", $2, $1 }' ) " + ## Just the EDB-ID ("--id")? + elif [[ "${EDBID}" -eq 1 ]]; then + OUTPUT="$( eval ${SEARCH} \ + | awk -F ',' '{ printf "\\r\\t\\t'{'\"Exploit\":\"%s\",\"EDB-ID\":\"%s\"},\n", $2, $1 }' ) " + ## Default JSON + else + OUTPUT="$( eval ${SEARCH} \ + | awk -F ',' '{ printf "\\r\\t\\t'{'\"Exploit\":\"%s\",\"Platform\":\"%s\",\"Type\":\"%s\",\"Date\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":\"%s\"},\n", $2, $5, $6, $4, $3, $1 }' ) " + fi + OUTPUT="$( echo -e ${OUTPUT} \ + | sort \ + | sed '$ s/,$//g' )" ## Web link format ("--www")? -if [[ "${WEBLINK}" -eq 1 ]]; then +elif [[ "${WEBLINK}" -eq 1 ]]; then OUTPUT="$( eval ${SEARCH} \ | awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $2, "https://www.exploit-db.com/exploits/"$1"/"}' \ | sort )" @@ -698,12 +718,6 @@ elif [[ "${EDBID}" -eq 1 ]]; then OUTPUT="$( eval ${SEARCH} \ | awk -F ',' '{ printf "%-'${FORMAT}'s | %s\n", $2, $1 }' \ | sort )" -## Print JSON format (full options) ("--json")? -elif [[ "${JSON}" -eq 1 ]]; then - OUTPUT="$( eval ${SEARCH} \ - | awk -F ',' '{ printf "\r\t\t'{'\"Exploit\":\"%s\",\"Platform\":\"%s\",\"Type\":\"%s\",\"Date\":\"%s\",\"Path\":\"'${gitpath}/'%s\",\"EDB-ID\":\"%s\"},\n", $2, $5, $6, $4, $3, $1 }' \ - | sort \ - | sed '$ s/,$//g' )" ## Default view else OUTPUT="$( eval ${SEARCH} \