mirror of
https://github.com/mozilla/cipherscan.git
synced 2024-11-22 14:23:41 +01:00
Refuse to proceed if no HOST[:PORT] is provided after the options.
Prior to this patch, if the user fails to provide a host:port after specifying cipherscan options, the script runs sed on an empty variable (failing with a syntax error) and then asttempts to cipherscan the target ':443'. This adds a simple test to ensure that a target was actually provided.
This commit is contained in:
parent
28555b03f0
commit
d81ee1c801
@ -1350,6 +1350,11 @@ done
|
|||||||
|
|
||||||
# echo parameters left: $@
|
# echo parameters left: $@
|
||||||
|
|
||||||
|
if (( $# < 1 )); then
|
||||||
|
echo "The final argument must be a valid HOST[:PORT], but none was provided." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
TEMPTARGET=$(sed -e 's/^.* //'<<<"${@}")
|
TEMPTARGET=$(sed -e 's/^.* //'<<<"${@}")
|
||||||
HOST=$(sed -e 's/:.*//'<<<"${TEMPTARGET}")
|
HOST=$(sed -e 's/:.*//'<<<"${TEMPTARGET}")
|
||||||
PORT=$(sed -e 's/.*://'<<<"${TEMPTARGET}")
|
PORT=$(sed -e 's/.*://'<<<"${TEMPTARGET}")
|
||||||
|
Loading…
Reference in New Issue
Block a user