Fix: searchsploit Nmap parsing loses version data.
Modified searchsploit's Nmap XML parsing to correctly extract software versions. Also, these versions are no longer split on '.'.
This commit is contained in:
parent
3cde8c39d6
commit
8298b27c9c
1 changed files with 2 additions and 2 deletions
|
@ -315,7 +315,7 @@ function searchsploitout() {
|
||||||
|
|
||||||
## Try and remove terms that could confuse searches
|
## Try and remove terms that could confuse searches
|
||||||
#software=$( echo "${software}" | sed 's_/_ _g' )
|
#software=$( echo "${software}" | sed 's_/_ _g' )
|
||||||
software=$( echo "${software}" | sed -e 's/[^a-zA-Z0-9]/ /g' )
|
software=$( echo "${software}" | sed -e 's/[^a-zA-Z0-9.]/ /g' )
|
||||||
|
|
||||||
if [[ "${VERBOSE}" -eq 1 ]]; then
|
if [[ "${VERBOSE}" -eq 1 ]]; then
|
||||||
## Loop each word?
|
## Loop each word?
|
||||||
|
@ -378,7 +378,7 @@ function nmapxml() {
|
||||||
|
|
||||||
## Read in XMP (IP, name, service and version)
|
## Read in XMP (IP, name, service and version)
|
||||||
xmllint --xpath '//address/@addr|//service/@name|//service/@product|//service/@version' "${FILE}" \
|
xmllint --xpath '//address/@addr|//service/@name|//service/@product|//service/@version' "${FILE}" \
|
||||||
| sed -e $'s/addr=/\\\n[IP] /g; s/name=/\\\n[NAME] /g; s/product=/\\\n[PRODUCT] /g;s/" version="/\\\n[VERSION] /g; s/"//g' \
|
| sed -e $'s/addr=/\\\n[IP] /g; s/name=/\\\n[NAME] /g; s/product=/\\\n[PRODUCT] /g; s/version=/\\\n[VERSION] /g; s/"//g' \
|
||||||
| grep -v '\[IP\].*\:' \
|
| grep -v '\[IP\].*\:' \
|
||||||
| while read line; do
|
| while read line; do
|
||||||
type=$( echo "${line}" | cut -d" " -f 1 )
|
type=$( echo "${line}" | cut -d" " -f 1 )
|
||||||
|
|
Loading…
Add table
Reference in a new issue