Ensure TARGET_OS is exported (#280)

This commit is contained in:
TheDragonkeeper 2017-10-25 20:59:25 +01:00 committed by Sebastian Kinne
parent 5a77792c1d
commit b894aa5842

View File

@ -20,9 +20,9 @@ function GET() {
"TARGET_OS")
ScanForOS=$(nmap -Pn -O $TARGET_IP -p1)
[[ $ScanForOS == *"Too many fingerprints"* ]] && ScanForOS=$(nmap -Pn -O --osscan-guess $TARGET_IP)
[[ $ScanForOS == *"Windows"* ]] && OSfound='WINDOWS' && return
[[ $ScanForOS == *"Linux"* ]] && OSfound='LINUX' && return
[[ $ScanForOS == *"Apple"* ]] && OSfound='MACOS' && return
[[ $ScanForOS == *"Windows"* ]] && export TARGET_OS='WINDOWS' && return
[[ $ScanForOS == *"Linux"* ]] && export TARGET_OS='LINUX' && return
[[ $ScanForOS == *"Apple"* ]] && export TARGET_OS='MACOS' && return
export TARGET_OS='UNKNOWN'
;;
esac