Skip to content

Instantly share code, notes, and snippets.

@Bonveio
Last active November 1, 2021 01:23
Show Gist options
  • Select an option

  • Save Bonveio/1bee2de6c460d4b5b5f16d34741da98a to your computer and use it in GitHub Desktop.

Select an option

Save Bonveio/1bee2de6c460d4b5b5f16d34741da98a to your computer and use it in GitHub Desktop.
Experimental OpenVPN v2.5+ bypass client big packet [patchfile]
--- src/openvpn/socket.c 2021-10-04 19:01:33.000000000 +0800
+++ src/openvpn/socket.c 2021-10-05 19:01:33.000000000 +0800
@@ -2778,8 +2777,0 @@
-
- if (sb->len < 1 || sb->len > sb->maxlen)
- {
- msg(M_WARN, "WARNING: Bad encapsulated packet length from peer (%d), which must be > 0 and <= %d -- please ensure that --tun-mtu or --link-mtu is equal on both peers -- this condition could also indicate a possible active attack on the TCP link -- [Attempting restart...]", sb->len, sb->maxlen);
- stream_buf_reset(sb);
- sb->error = true;
- return false;
- }

[WARNING] Do not use this patch for Production builds. this patch aims to bypass bigger client peers and automatically accept them to server

To use:

curl -sL 'ovpn source link tar.gz' -o ovpn.tgz
tar -xf ovpn.tgz && cd openvpn-*
curl -sL 'this gist link rawlink to socket.c' -o bonv.patch
patch -p0 -s < bonv.patch && rm -f bonv.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment