-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] DTLS support #473
Comments
The discussion about DTLS has continued in the other issue. I think this comment provides helpful links |
The discussion about DTLS doesn't seem to be continuing within the MacOS discussion (which has switched to PPP). I've seen significant differences in performance with the Forticlient DTLS enabled under windows. It doesn't sound like the official forticlient for linux will be getting this any time soon. Is there anything I can do to help test any suggestions here? |
Fortinet servers appear to use a standard DTLS handshake, running on the same UDP port as the HTTPS interface runs on… for example, I have access to a server with its HTTPS/PPP interface on TCP port 10443
That last line is a response from the server. I presume Fortinet is similar to every other TLS+UDP VPN out there, and there's some initial exchange of a cookie/secret needed to establish the DTLS connection after the TLS connection has been established. |
@joshualamorie, I have recently gotten Fortinet fully working in OpenConnect (see #650 (comment)). OpenConnect already knows how to speak DTLS (since the Cisco AnyConnect protocol uses it), so implementing Fortinet-compatible DTLS is unlikely to be too complicated. However, we'll need to figure out the details of how the DTLS connection is initiated, authenticated, encapsulated… so MITM captures from the official Fortinet client will almost certainly be required. |
It would help if there were clear instructions on how to use MITM, I cannot get it to run on the same machine I work from. |
Start by capturing the traffic on the wire; it's actually possible that it's in the DTLS handshake (with PSK) instead of inside it. |
As far as I can tell, Fortinet servers do not use DTLS-PSK. Connecting to a real Fortinet server with DTLS-PSK, based on the gnutls-cli docs. (Only allow PSK) (Allow all standard KX) UPDATE: It's possible that they do use DTLS-PSK, but also require a specific session ID to get the server to respond (what Cisco AnyConnect servers do too). Although the fact that they allow non-PSK connections and respond with |
I've now MITM The only MITM tool for DTLS that I'm aware of is https://github.com/travelping/capwap-mitm … unless someone knows another more general-purpose one? (@dwmw2?) This guy did some decryption of DTLS packets from Fortinet in 2017, and his screenshots confirm that the Fortinet-PPP-in-DTLS encapsulation is identical to TLS (6-byte Fortinet header precedes PPP packet: The only thing left to figure out, really, is how the connection is initiated. If anyone has access to a Fortinet server for which they control the certificate and private key, this'll be a piece of cake to decrypt. |
I figured out how the DTLS session is initiated, and it's quite easy. Client sends…
Server responds with either
You can reproduce this yourself by authenticating, capturing the cookie, fetching the XML config¹, not starting the TLS tunnel², calculating the total packet length, and then doing…
¹ As with many SSL VPN protocols, fetching the "config" somehow activates/enables the tunnel endpoint |
@dlenski thanks for the results of your analysis. This will help implementing DTLS support in openfortivpn. to anyone: please feel free to open a pull request for this |
DTLS support would be great :) |
We now have working a Fortinet DTLS implementation in OpenConnect. https://gitlab.com/openconnect/openconnect/-/commits/ppp_dtls_wip I certainly don't want to detract from anyone adding this support to OpenFortivpn, but it would be excellent to have some of you test our DTLS support in OpenConnect. (Ping @emelenas, who helped me figure out how to get Fortinet 2FA working in OpenConnect. 🙏) This is the largest group of savvy FLOSS-friendly Fortinet users out there, and both projects can benefit from additional documentation of the protocol, and understanding of corner cases and unusual behavior.
|
@dlenski
|
oh, I found it later on branch https://gitlab.com/openconnect/openconnect/commits/ppp_protocols |
It will be in the upcoming 9.00 release. For now you have to build from git (http://www.infradead.org/openconnect/building.html) or use the bleeding-edge builds from https://copr.fedorainfracloud.org/coprs/dwmw2/openconnect/ for Fedora/RHEL/Windows. |
Don't use the ppp_protocols branch; it's all merged to master now. |
hmm, it seems I have no luck today. My old debian jessie is also not helping. I cannot test on a rhel based. I wanted to try on a server with a 10Gbps link. Now with ppp_protocols branch I get a segmentation fault
|
We should probably take this to https://gitlab.com/openconnect/openconnect/-/merge_requests/169 rather than continuing an OpenConnect discussion here? The master branch is at commit 0cfdb7b871fd04c7a500001d2d0961779adf0ed5 which definitely includes Fortinet support, having merged the ppp_protocols branch and fixed that segfault (https://gitlab.com/openconnect/openconnect/-/issues/235) |
@zez3 did you get it working? |
@dwmw2 I found this later |
I can connect with DTLS on openconnect. Is this feature in the pipes for openfortivpn? |
I bet no updates on that feature, right ? |
see here
#428 (comment)
The text was updated successfully, but these errors were encountered: