Generate an OpenConnect Cisco Secure Desktop (CSD) file that bypasses AnyConnect hostscan requirements.
This script parses an AnyConnect client connection and outputs a CSD file that can be used with OpenConnect. The CSD file will perform a POST request to the AnyConnect server, giving the illusion a hostscan took place. Even if the AnyConnect server does not publish binaries for your Operating System (OS), you will still be able to connect. This is due to the fact that OpenConnect allows you to specify which OS you are connecting from. This means you can be on a Linux and pretend to be a Windows client!
WARNING: Doing this will bypass the checks hostscan performs. This may be against your companies policy. By using this script and the resulting CSD file, you are releasing me of any liability. This script is for educational purposes only.
*Note: You will need to install go. That process won't be covered here.
sudo go run hostscan-bypass.go -l <YOUR IP> -p 443 -r <TARGET VPN URL>:443 -s
- Use AnyConnect and connect to
<YOUR IP>
- Wait. You do not need to enter in any credentials for hostscan to start. By default, the CSD file will be named
hostscan-bypass.sh
. - Make the CSD file executable (otherwise OpenConnect can't use it):
chmod +x hostscan-bypass.sh
- Finally, connect:
sudo openconnect --csd-wrapper=hostscan-bypass.sh <VPN URL> --os=win
hostscan-bypass.go
was hacked off of tcpprox. Thanks @staaldraad!- Fromzy, who happened to posted the most simple CSD example
- @bmaddy, who posted examples and resources that aided in the completion of this project