Created
March 28, 2020 11:20
-
-
Save pry0cc/5e24d50717adce20dfa8fb877757f0eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host="$1" | |
remote_url="https://$host" | |
exe_url="$remote_url/epa/scripts/win/nsepa_setup.exe" | |
decom_dir="/tmp/extract/$RANDOM" | |
mkdir -p "$decom_dir" | |
echo "Downloading $exe_url" | |
wget --quiet $exe_url -O $decom_dir/nsepa.zip | |
echo "Decompiling client..." | |
7z e $decom_dir/nsepa.zip -o$decom_dir 2>&1 > /dev/null | |
version=$(strings $decom_dir/* | sed 's/|/\n/g' | sed 's/}/\n/g' | grep "SetProgressProgressProductFeatureCitrix Gateway Endpoint Analysis" | sort -u | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p') | |
rm -rf $decom_dir | |
echo "Detected Version is $version" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment