我正在尝试使用 openconnect (协议 Global Protect) 连接到企业 vpn:
perret at perret-pc in ~
$ openconnect --protocol=gp [vpn-address]
POST [vpn-address]/ssl-vpn/prelogin.esp?tmp=tmp&clientVer=4100&clientos=Linux
Connected to 185.183.115.255:443
SSL negotiation with [vpn-address]
Connected to HTTPS on [vpn-address]
POST [vpn-address]/global-protect/prelogin.esp?tmp=tmp&clientVer=4100&clientos=Linux
SAML authentication via POST to <html>
<body>
<form id="myform" method="POST" action="[corporate-address]/auth/realms/vpgrp/protocol/saml">
<input type="hidden" name="SAMLRequest" value="PHNhbWxwOkF1dGhuUmVxdWVzdCB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiBBc3NlcnRpb25Db25zdW1lclNlcnZpY2VVUkw9Imh0dHBzOi8vdnBuLnZlZXBlZS50ZWNoOjQ0My9TQU1MMjAvU1AvQUNTIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9zc29jby5wbGF0Zm9ybS52cGdycC5uZXQvYXV0aC9yZWFsbXMvdnBncnAvcHJvdG9jb2wvc2FtbCIgSUQ9Il85YTkwNDYyMzQyY2YyMWU0ZmE0YzUyYmVmOTRjZDNhNSIgSXNzdWVJbnN0YW50PSIyMDE5LTA4LTAyVDIxOjUyOjE0WiIgUHJvdG9jb2xCaW5kaW5nPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YmluZGluZ3M6SFRUUC1QT1NUIiBWZXJzaW9uPSIyLjAiPjxzYW1sOklzc3VlciB4bWxuczpzYW1sPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj5odHRwczovL3Zwbi52ZWVwZWUudGVjaDo0NDMvU0FNTDIwL1NQPC9zYW1sOklzc3Vlcj48L3NhbWxwOkF1dGhuUmVxdWVzdD4=" />
<input type="hidden" name="RelayState" value="GCkAANn0plw4NzIwNDY4YmM4ZGE2ZjcwMzU3ZWQ5M2E0NjI5ZDE2Yw==" />
</form>
<script>
document.getElementById('myform').submit();
</script>
</body>
</html>
is required.
Must specify destination form field by appending :field_name to login URL.
Failed to parse server response
Failed to obtain WebVPN cookie
我不太确定这部分:
Must specify destination form field by appending :field_name to login URL.
我以为会是这样的:
openconnect --protocol=gp [vpn-address]:myform
POST https://vpn.veepee.tech:myform/ssl-vpn/prelogin.esp?tmp=tmp&clientVer=4100&clientos=Linux
getaddrinfo failed for host 'vpn.veepee.tech:myform': Name or service not known
Failed to open HTTPS connection to vpn.veepee.tech:myform
Failed to obtain WebVPN cookie
但正如您所见,它也不起作用。
任何想法?
这可能和这部分源代码有关:https://github.com/dlenski/openconnect/blob/master/auth-globalprotect.c#L91