-
-
Save FollowMeDown/e5bfc7e1e0e3c8de1172e7a9d58073f5 to your computer and use it in GitHub Desktop.
Connecting to Cisco's AnyConnect SSL VPN on MacOS (bypassing the EOL'd Cisco Secure Desktop)
This file contains 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 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
$DIR/csd-responder.sh "$@" 2>&1 | sed -e "s/^/ [csd] /" |
This file contains 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 | |
echo "$0""$@" | |
env | grep CSD | sort | sed -e "s/^/ENV: /" | |
# location is usually "Default" | |
location=$(wget -O - -q "https://$CSD_HOSTNAME/CACHE/sdesktop/data.xml?reusebrowser=1" | grep 'location name=' | head -1 | sed -e 's/.*"\(.*\)".*/\1/') | |
POST_DATA=$(mktemp) | |
CURL_CMD=$(mktemp) | |
agent="AnyConnect Linux" | |
plat=linux-x86_64 | |
ver=4.2.03013 | |
cat > $POST_DATA <<-END | |
endpoint.policy.location="Default"; | |
endpoint.enforce="success"; | |
endpoint.fw["IPTablesFW"]={}; | |
endpoint.fw["IPTablesFW"].exists="true"; | |
endpoint.fw["IPTablesFW"].enabled="ok"; | |
endpoint.as["ClamAS"]={}; | |
endpoint.as["ClamAS"].exists="true"; | |
endpoint.as["ClamAS"].activescan="ok"; | |
endpoint.av["ClamAV"]={}; | |
endpoint.av["ClamAV"].exists="true"; | |
endpoint.av["ClamAV"].activescan="ok"; | |
END | |
cat > $CURL_CMD <<-END | |
curl \\ | |
--insecure \\ | |
--user-agent "$agent $ver" \\ | |
--header "X-Transcend-Version: 1" \\ | |
--header "X-Aggregate-Auth: 1" \\ | |
--header "X-AnyConnect-Platform: $plat" \\ | |
--cookie "sdesktop=$CSD_TOKEN" \\ | |
--data-ascii $POST_DATA \\ | |
"https://$CSD_HOSTNAME/+CSCOE+/sdesktop/scan.xml?reusebrowser=1" | |
END | |
cat $CURL_CMD | sed -e "s/^/CURL: /" | |
cat $POST_DATA | sed -e "s/^/POST: /" | |
. $CURL_CMD | |
echo "curl exited with $?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment