Zaloguj się

Jog Jajcusia

xmpp:jajcus@jajcus.net

Mój jest ten kawałek Internetu…

…złe emocje i brudne buty proszę więc zostawić przed drzwiami.

Android implementation of VPN L2TP/IPsec vulnerable to MITM attacks

This is an English version of my previous post

Introdution

Recently I have decided to try using the VPN client functionality of my Samsung Galaxy S Plus (I9001) phone. Of the four available options I have chosen the one which is supposed to be the most secure: 'L2TP/IPsec CRT VPN' (L2TP tunnel secured by IPsec, authenticated with certificates). I had to configure a matching VPN server on may Linux-based router fist. It was not trivial, but I did it – using ipsec-tools (the Racoon daemon) for IPsec and openl2tp for L2TP. It was not trivial, but at some places it seemed too easy. This raised my suspicion.

After a few simple experiments I knew the VPN connection is not secure, because of bugs (or design choices) in the Android implementation. Please remember I am talking only about my phone, running Android 2.3.3 (GINGERBREAD.XXKG3).

When things work as they should

Experiment 0.

The server is configured 'as it should be' – using a certificate with its name – 'vpn.example.org' and accepting only encrypted (IPsec) connections to the L2TP port (1701, UDP). On a phone a VPN is configured as follows:

  • VPN name: SomeNet
  • Set VPN server: vpn.example.org
  • Enable L2TP secret: off
  • Set user certificate: a user certificate for 'user@example.org', issued by the same CA which issued the server certificate.
  • Set CA certificate: Certificate of the trusted third-party CA issuing the server and client certificates.
  • DNS search domains: somenet

At the phone shell terminal I have started a ping to 192.168.0.2 (a machine in the LAN behind the VPN tunnel).

Ping answers appear a moment after I start the VPN connection from my phone.

The network traffic on the server side looks like this:

# tcpdump -l -v -n -i eth1 port 500 or port 1701 or esp
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
12:43:44.608568 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    188.33.176.187.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=6
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #2 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #3 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #4 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #5 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #6 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))))
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=20)
12:43:44.663217 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 132)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid 00000000: phase 1 R ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=1
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))))
    (vid: len=20)
12:43:45.382608 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 208)
    188.33.176.187.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident:
    (ke: key len=128)
    (nonce: n len=16)
12:43:45.407626 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 336)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid 00000000: phase 1 R ident:
    (ke: key len=128)
    (nonce: n len=16)
    (cr: len=124 type=x509sign)
12:43:55.705144 IP (tos 0x48, ttl 51, id 10624, offset 0, flags [+], proto UDP (17), length 1500)
    188.33.176.187.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident[E]: [encrypted id] (len mismatch: isakmp 1708/ip 1472)
12:43:57.256500 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted #132]
12:43:57.256644 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted #132]
12:43:57.256713 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted #132]
12:43:57.256778 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 164)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted #132]
12:43:57.415368 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 120)
    188.33.176.187.500 > 10.20.30.40.500: isakmp 1.0 msgid adbf66a8: phase 2/others I inf[E]: [encrypted hash]
12:43:58.464303 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 312)
    188.33.176.187.500 > 10.20.30.40.500: isakmp 1.0 msgid b9020aee: phase 2/others I oakley-quick[E]: [encrypted hash]
12:43:58.465297 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 176)
    10.20.30.40.500 > 188.33.176.187.500: isakmp 1.0 msgid b9020aee: phase 2/others R oakley-quick[E]: [encrypted hash]
12:43:58.517546 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 96)
    188.33.176.187.500 > 10.20.30.40.500: isakmp 1.0 msgid b9020aee: phase 2/others I oakley-quick[E]: [encrypted hash]
12:43:59.934124 IP (tos 0x48, ttl 51, id 15669, offset 0, flags [DF], proto ESP (50), length 128)
    188.33.176.187 > 10.20.30.40: ESP(spi=0x02b101a6,seq=0x1), length 108
12:44:00.195342 IP (tos 0x0, ttl 64, id 42855, offset 0, flags [DF], proto ESP (50), length 192)
    10.20.30.40 > 188.33.176.187: ESP(spi=0x0a176818,seq=0x1), length 172
12:44:00.237465 IP (tos 0x48, ttl 51, id 15670, offset 0, flags [DF], proto ESP (50), length 80)
    188.33.176.187 > 10.20.30.40: ESP(spi=0x02b101a6,seq=0x2), length 60
12:44:00.807696 IP (tos 0x0, ttl 64, id 42856, offset 0, flags [DF], proto ESP (50), length 72)
    10.20.30.40 > 188.33.176.187: ESP(spi=0x0a176818,seq=0x2), length 52
12:44:00.857370 IP (tos 0x48, ttl 51, id 15671, offset 0, flags [DF], proto ESP (50), length 96)
[...]

We can see a connection to the IKE port for authentication and key agreement, then everything is encrypted inside the IPsec ESP packets. That is exactly what I would expect.

Android does not check certificate contents

Experiment 1.

The server configuration stays the same. I am only changing the server name in the phone. Now the VPN client is configured to connect to 'badvpn.example.net' instead of 'vpn.example.org'. This is the same machine, the same IP address, just a different name. This name is not included in the server's certificate.

Expected result: phone will not connect, because the other party cannot be authenticated as 'badvpn.example.net'. Alternatively, the phone could display a warning and request confirmation before continuing.

Actual result: phone connects exactly as in the previous experiment. No error, no warning.

Conclusion: Android VPN client does not check the names in the server certificate and does not compare them with the requested server name. Anyone having a certificate from the same CA could impersonate my server, carrying out a man-in-the-middle attack. I cannot be sure I am connecting to the server requested.

To mitigate the problem, the VPN server administrator may use own, dedicated CA to issue the server certificate instead of relying on third party CA or using one CA to issue certificates for different entities. But this contraticts a bit the idea of certificate-authority-based PKI.

Experiment 2.

Phone restored to initial configuration (as in experiment 0.), but server certificate is replaced with a user cert. Not only the name in the certificate does not match server name, but other properties (e.g. key usage) is different.

Result: the same as in Experiment 1. Certificate contents seems ignored.

Conclusion: to mitigate the problem VPN administrator must use different CA to issue server certificates and a to issue client certificates.

Experiment 3.

Does Android validate server certificate at all (using the provided CA certificate)? Phone configured as in experiment 0, again, but the server certificate is replaced with a new, self-signed certificate, which cannot be validated by the CA specified on the phone.

Good news: the phone won't connect.

Though, when we look at the IP traffic entering the server it becomes interesting:

13:20:51.287718 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    31.174.234.6.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=6
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #2 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #3 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #4 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #5 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #6 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))))
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=20)
13:20:51.288533 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 132)
    10.20.30.40.500 > 31.174.234.6.500: isakmp 1.0 msgid 00000000: phase 1 R ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=1
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))))
    (vid: len=20)
13:20:52.125328 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 208)
    31.174.234.6.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident:
    (ke: key len=128)
    (nonce: n len=16)
13:20:52.147937 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 336)
    10.20.30.40.500 > 31.174.234.6.500: isakmp 1.0 msgid 00000000: phase 1 R ident:
    (ke: key len=128)
    (nonce: n len=16)
    (cr: len=124 type=x509sign)
13:21:02.502646 IP (tos 0x48, ttl 51, id 50848, offset 0, flags [+], proto UDP (17), length 1500)
    31.174.234.6.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident[E]: [encrypted id] (len mismatch: isakmp 1708/ip 1472)
13:21:05.307743 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)
    10.20.30.40.500 > 31.174.234.6.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted #132]
13:21:05.307894 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    10.20.30.40.500 > 31.174.234.6.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted #132]
13:21:05.393772 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 104)
    31.174.234.6.500 > 10.20.30.40.500: isakmp 1.0 msgid ca46c9c0: phase 2/others I inf[E]: [encrypted hash]
13:21:12.456929 IP (tos 0x48, ttl 51, id 50849, offset 0, flags [+], proto UDP (17), length 1500)
    31.174.234.6.500 > 10.20.30.40.500: isakmp 1.0 msgid 00000000: phase 1 I ident[E]: [encrypted id] (len mismatch: isakmp 1708/ip 1472)
13:21:12.457346 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 856)
    10.20.30.40.500 > 31.174.234.6.500: isakmp 1.0 msgid 00000000: phase 1 R ident[E]: [encrypted id]
13:21:12.567417 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 104)
    31.174.234.6.500 > 10.20.30.40.500: isakmp 1.0 msgid 83b1e02d: phase 2/others I inf[E]: [encrypted hash]
13:21:22.627610 IP (tos 0x48, ttl 51, id 41737, offset 0, flags [DF], proto UDP (17), length 97)
    31.174.234.6.57180 > 10.20.30.40.1701:  l2tp:[TLS](0/0)Ns=0,Nr=0 *MSGTYPE(SCCRQ) *PROTO_VER(1.0) *HOST_NAME(anonymous) *FRAMING_CAP(AS) *ASSND_TUN_ID(43840) *RECV_WIN_SIZE(1)
13:21:24.630141 IP (tos 0x48, ttl 51, id 41738, offset 0, flags [DF], proto UDP (17), length 97)
    31.174.234.6.57180 > 10.20.30.40.1701:  l2tp:[TLS](0/0)Ns=0,Nr=0 *MSGTYPE(SCCRQ) *PROTO_VER(1.0) *HOST_NAME(anonymous) *FRAMING_CAP(AS) *ASSND_TUN_ID(43840) *RECV_WIN_SIZE(1)

We can see IKE negotiation failing (as expected), but after that the phone continues with sending L2TP requests… in plain text. Connection fails, because server ignores insecure L2TP requests.

This leads us to the second problem…

When IPsec does not work, Android connects in plain text

Experiment 4.

I am disabling IPsec on the server. I am stopping the Racoon daemon, removing the 'require IPsec for L2TP' rule from the firewall and disabling the 'ipsec' plugin of openl2tp. Phone stays configured as in experiment 0. (still 'L2TP/IPset' with certificates).

Expected result: the phone won't connect, as the IPsec connection cannot be established.

Actual result: phone connects, without encryption, but disconnects soon. During the short time it is connected, the connection is functional (proved by the 'pings and pongs' flowing):

# tcpdump -l -s0 -v -v -n -i eth1 port 500 or port 1701 or esp 
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
13:41:23.517220 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    31.175.7.251.500 > 10.20.30.40.500: [udp sum ok] isakmp 1.0 msgid 00000000 cookie b058afdd0f5cf6be->0000000000000000: phase 1 I ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=6
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #2 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #3 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #4 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #5 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #6 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))))
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=20)
13:41:33.671001 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    31.175.7.251.500 > 10.20.30.40.500: [udp sum ok] isakmp 1.0 msgid 00000000 cookie b058afdd0f5cf6be->0000000000000000: phase 1 I ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=6
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #2 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #3 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #4 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #5 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #6 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))))
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=20)
13:41:43.693458 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    31.175.7.251.500 > 10.20.30.40.500: [udp sum ok] isakmp 1.0 msgid 00000000 cookie b058afdd0f5cf6be->0000000000000000: phase 1 I ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=6
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #2 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #3 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #4 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #5 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #6 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))))
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=20)
13:41:53.677525 IP (tos 0x48, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 380)
    31.175.7.251.500 > 10.20.30.40.500: [udp sum ok] isakmp 1.0 msgid 00000000 cookie b058afdd0f5cf6be->0000000000000000: phase 1 I ident:
    (sa: doi=ipsec situation=identity
        (p: #1 protoid=isakmp transform=6
            (t: #1 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #2 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=3des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #3 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #4 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=1des)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))
            (t: #5 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=sha1)(type=group desc value=modp1024))
            (t: #6 id=ike (type=lifetype value=sec)(type=lifeduration value=7080)(type=enc value=aes)(type=keylen value=0080)(type=auth value=rsa sig)(type=hash value=md5)(type=group desc value=modp1024))))
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=16)
    (vid: len=20)
13:41:55.151280 IP (tos 0x48, ttl 51, id 33891, offset 0, flags [DF], proto UDP (17), length 97)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[TLS](0/0)Ns=0,Nr=0 *MSGTYPE(SCCRQ) *PROTO_VER(1.0) *HOST_NAME(anonymous) *FRAMING_CAP(AS) *ASSND_TUN_ID(62390) *RECV_WIN_SIZE(1)
13:41:55.151975 IP (tos 0x0, ttl 64, id 36766, offset 0, flags [DF], proto UDP (17), length 162)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[TLS](62390/0)Ns=0,Nr=1 *MSGTYPE(SCCRP) *PROTO_VER(1.0) *FRAMING_CAP(AS) *BEARER_CAP(AD) FIRM_VER(264) *HOST_NAME(vpn) VENDOR_NAME(Katalix Systems Ltd. Linux-2.6.37.6-2 (i686)) *ASSND_TUN_ID(62648) *RECV_WIN_SIZE(10)
13:41:55.430864 IP (tos 0x48, ttl 51, id 33892, offset 0, flags [DF], proto UDP (17), length 48)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[TLS](62648/0)Ns=1,Nr=1 *MSGTYPE(SCCCN)
13:41:55.652497 IP (tos 0x0, ttl 64, id 36767, offset 0, flags [DF], proto UDP (17), length 40)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[TLS](62390/0)Ns=1,Nr=2 ZLB
13:41:55.939596 IP (tos 0x48, ttl 51, id 33893, offset 0, flags [DF], proto UDP (17), length 66)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[TLS](62648/0)Ns=2,Nr=1 *MSGTYPE(ICRQ) *ASSND_SESS_ID(24993) *CALL_SER_NUM(2539501115)
13:41:55.939936 IP (tos 0x0, ttl 64, id 36768, offset 0, flags [DF], proto UDP (17), length 56)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[TLS](62390/24993)Ns=1,Nr=3 *MSGTYPE(ICRP) *ASSND_SESS_ID(30984)
13:41:56.256430 IP (tos 0x48, ttl 51, id 33894, offset 0, flags [DF], proto UDP (17), length 68)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[TLS](62648/30984)Ns=3,Nr=2 *MSGTYPE(ICCN) *TX_CONN_SPEED(100000000) *FRAMING_TYPE(AS)
13:41:56.270628 IP (tos 0x0, ttl 64, id 15078, offset 0, flags [none], proto UDP (17), length 58)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {LCP, Conf-Request (0x01), id 1, length 22
    encoded length 20 (=Option(s) length 16)
    0x0000:  c021 0101 0014
      ACCM Option (0x02), length 6: 0x00000000
        0x0000:  0000 0000
      Auth-Prot Option (0x03), length 4: PAP
        0x0000:  c023
      Magic-Num Option (0x05), length 6: 0xfd374547
        0x0000:  fd37 4547}
13:41:56.652406 IP (tos 0x0, ttl 64, id 36769, offset 0, flags [DF], proto UDP (17), length 40)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[TLS](62390/0)Ns=2,Nr=4 ZLB
13:41:57.228134 IP (tos 0x48, ttl 51, id 33895, offset 0, flags [DF], proto UDP (17), length 62)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {LCP, Conf-Request (0x01), id 1, length 26
    encoded length 24 (=Option(s) length 20)
    0x0000:  c021 0101 0018
      MRU Option (0x01), length 4: 1400
        0x0000:  0578
      ACCM Option (0x02), length 6: 0x00000000
        0x0000:  0000 0000
      Magic-Num Option (0x05), length 6: 0x463dc4fb
        0x0000:  463d c4fb
      PFC Option (0x07), length 2: 
      ACFC Option (0x08), length 2: }
13:41:57.228434 IP (tos 0x0, ttl 64, id 15079, offset 0, flags [none], proto UDP (17), length 62)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {LCP, Conf-Ack (0x02), id 1, length 26
    encoded length 24 (=Option(s) length 20)
    0x0000:  c021 0201 0018
      MRU Option (0x01), length 4: 1400
        0x0000:  0578
      ACCM Option (0x02), length 6: 0x00000000
        0x0000:  0000 0000
      Magic-Num Option (0x05), length 6: 0x463dc4fb
        0x0000:  463d c4fb
      PFC Option (0x07), length 2: 
      ACFC Option (0x08), length 2: }
13:41:59.273354 IP (tos 0x0, ttl 64, id 15080, offset 0, flags [none], proto UDP (17), length 58)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {LCP, Conf-Request (0x01), id 1, length 22
    encoded length 20 (=Option(s) length 16)
    0x0000:  c021 0101 0014
      ACCM Option (0x02), length 6: 0x00000000
        0x0000:  0000 0000
      Auth-Prot Option (0x03), length 4: PAP
        0x0000:  c023
      Magic-Num Option (0x05), length 6: 0xfd374547
        0x0000:  fd37 4547}
13:41:59.562111 IP (tos 0x48, ttl 51, id 33896, offset 0, flags [DF], proto UDP (17), length 58)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {LCP, Conf-Ack (0x02), id 1, length 22
    encoded length 20 (=Option(s) length 16)
    0x0000:  c021 0201 0014
      ACCM Option (0x02), length 6: 0x00000000
        0x0000:  0000 0000
      Auth-Prot Option (0x03), length 4: PAP
        0x0000:  c023
      Magic-Num Option (0x05), length 6: 0xfd374547
        0x0000:  fd37 4547}
13:41:59.562491 IP (tos 0x0, ttl 64, id 15081, offset 0, flags [none], proto UDP (17), length 46)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {LCP, Echo-Request (0x09), id 0, length 10
    encoded length 8 (=Option(s) length 4)
    0x0000:  c021 0900 0008
      Magic-Num 0xfd374547}
13:41:59.562628 IP (tos 0x0, ttl 64, id 36770, offset 0, flags [DF], proto UDP (17), length 64)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[TLS](62390/24993)Ns=2,Nr=4 *MSGTYPE(SLI) *ACCM(send=00000000 recv=00000000 )
13:41:59.625466 IP (tos 0x48, ttl 51, id 33897, offset 0, flags [DF], proto UDP (17), length 56)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {PAP, Auth-Req (0x01), id 1, Peer username, Name password}
13:41:59.625794 IP (tos 0x0, ttl 64, id 15082, offset 0, flags [none], proto UDP (17), length 51)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {PAP, Auth-ACK (0x02), id 1, Msg Login ok}
13:41:59.629723 IP (tos 0x0, ttl 64, id 15083, offset 0, flags [none], proto UDP (17), length 48)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IPCP, Conf-Request (0x01), id 1, length 12
    encoded length 10 (=Option(s) length 6)
    0x0000:  8021 0101 000a
      IP-Addr Option (0x03), length 6: 192.168.0.1
        0x0000:  0afd 00fe}
13:42:00.035296 IP (tos 0x48, ttl 51, id 33898, offset 0, flags [DF], proto UDP (17), length 46)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {LCP, Echo-Reply (0x0a), id 0, length 10
    encoded length 8 (=Option(s) length 4)
    0x0000:  c021 0a00 0008
      Magic-Num 0x463dc4fb}
13:42:00.093597 IP (tos 0x48, ttl 51, id 33899, offset 0, flags [DF], proto UDP (17), length 40)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[TLS](62648/0)Ns=4,Nr=3 ZLB
13:42:00.156271 IP (tos 0x48, ttl 51, id 33900, offset 0, flags [DF], proto UDP (17), length 45)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {unknown ctrl-proto (0x80fd), Conf-Request (0x01), id 1, length 9
    encoded length 7 (=Option(s) length 3)
    0x0000:  80fd 0101 0007
      BSD-Comp Option (0x15), length 3:
        0x0000:  2f}
13:42:00.156540 IP (tos 0x0, ttl 64, id 15084, offset 0, flags [none], proto UDP (17), length 42)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {unknown ctrl-proto (0x80fd), Conf-Request (0x01), id 1, length 6}
13:42:00.156580 IP (tos 0x0, ttl 64, id 15085, offset 0, flags [none], proto UDP (17), length 45)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {unknown ctrl-proto (0x80fd), Conf-Reject (0x04), id 1, length 9
    encoded length 7 (=Option(s) length 3)
    0x0000:  80fd 0401 0007
      BSD-Comp Option (0x15), length 3:
        0x0000:  2f}
13:42:00.315382 IP (tos 0x48, ttl 51, id 33901, offset 0, flags [DF], proto UDP (17), length 66)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IPCP, Conf-Request (0x01), id 1, length 30
    encoded length 28 (=Option(s) length 24)
    0x0000:  8021 0101 001c
      IP-Comp Option (0x02), length 6: VJ-Comp (0x2d):
        0x0000:  002d 0f01
      IP-Addr Option (0x03), length 6: 0.0.0.0
        0x0000:  0000 0000
      Pri-DNS Option (0x81), length 6: 0.0.0.0
        0x0000:  0000 0000
      Sec-DNS Option (0x83), length 6: 0.0.0.0
        0x0000:  0000 0000}
13:42:00.315702 IP (tos 0x0, ttl 64, id 15086, offset 0, flags [none], proto UDP (17), length 48)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IPCP, Conf-Reject (0x04), id 1, length 12
    encoded length 10 (=Option(s) length 6)
    0x0000:  8021 0401 000a
      IP-Comp Option (0x02), length 6: VJ-Comp (0x2d):
        0x0000:  002d 0f01}
13:42:00.433811 IP (tos 0x48, ttl 51, id 33902, offset 0, flags [DF], proto UDP (17), length 48)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IPCP, Conf-Ack (0x02), id 1, length 12
    encoded length 10 (=Option(s) length 6)
    0x0000:  8021 0201 000a
      IP-Addr Option (0x03), length 6: 192.168.0.1
        0x0000:  0afd 00fe}
13:42:00.721457 IP (tos 0x48, ttl 51, id 33903, offset 0, flags [DF], proto UDP (17), length 42)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {unknown ctrl-proto (0x80fd), Conf-Ack (0x02), id 1, length 6}
13:42:00.822080 IP (tos 0x48, ttl 51, id 33904, offset 0, flags [DF], proto UDP (17), length 42)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {unknown ctrl-proto (0x80fd), Conf-Request (0x01), id 2, length 6}
13:42:00.822317 IP (tos 0x0, ttl 64, id 15087, offset 0, flags [none], proto UDP (17), length 42)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {unknown ctrl-proto (0x80fd), Conf-Ack (0x02), id 2, length 6}
13:42:00.988689 IP (tos 0x48, ttl 51, id 33905, offset 0, flags [DF], proto UDP (17), length 60)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IPCP, Conf-Request (0x01), id 2, length 24
    encoded length 22 (=Option(s) length 18)
    0x0000:  8021 0102 0016
      IP-Addr Option (0x03), length 6: 0.0.0.0
        0x0000:  0000 0000
      Pri-DNS Option (0x81), length 6: 0.0.0.0
        0x0000:  0000 0000
      Sec-DNS Option (0x83), length 6: 0.0.0.0
        0x0000:  0000 0000}
13:42:00.988990 IP (tos 0x0, ttl 64, id 15088, offset 0, flags [none], proto UDP (17), length 60)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IPCP, Conf-Nack (0x03), id 2, length 24
    encoded length 22 (=Option(s) length 18)
    0x0000:  8021 0302 0016
      IP-Addr Option (0x03), length 6: 192.168.1.1
        0x0000:  0afb 000a
      Pri-DNS Option (0x81), length 6: 192.168.0.1
        0x0000:  0afd 00fe
      Sec-DNS Option (0x83), length 6: 192.168.0.3
        0x0000:  0afb 00fe}
13:42:01.460383 IP (tos 0x48, ttl 51, id 33906, offset 0, flags [DF], proto UDP (17), length 60)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IPCP, Conf-Request (0x01), id 3, length 24
    encoded length 22 (=Option(s) length 18)
    0x0000:  8021 0103 0016
      IP-Addr Option (0x03), length 6: 192.168.1.1
        0x0000:  0afb 000a
      Pri-DNS Option (0x81), length 6: 192.168.0.1
        0x0000:  0afd 00fe
      Sec-DNS Option (0x83), length 6: 192.168.0.3
        0x0000:  0afb 00fe}
13:42:01.460687 IP (tos 0x0, ttl 64, id 15089, offset 0, flags [none], proto UDP (17), length 60)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IPCP, Conf-Ack (0x02), id 3, length 24
    encoded length 22 (=Option(s) length 18)
    0x0000:  8021 0203 0016
      IP-Addr Option (0x03), length 6: 192.168.1.1
        0x0000:  0afb 000a
      Pri-DNS Option (0x81), length 6: 192.168.0.1
        0x0000:  0afd 00fe
      Sec-DNS Option (0x83), length 6: 192.168.0.3
        0x0000:  0afb 00fe}
13:42:02.157390 IP (tos 0x48, ttl 51, id 33907, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3720, length 64}
13:42:02.158470 IP (tos 0x0, ttl 64, id 15090, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49734, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3720, length 64}
13:42:02.851139 IP (tos 0x48, ttl 51, id 33908, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 82, length 64}
13:42:02.851307 IP (tos 0x0, ttl 64, id 15091, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18867, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 82, length 64}
13:42:03.184976 IP (tos 0x48, ttl 51, id 33909, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3721, length 64}
13:42:03.185852 IP (tos 0x0, ttl 64, id 15092, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49735, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3721, length 64}
13:42:03.820573 IP (tos 0x48, ttl 51, id 33910, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 83, length 64}
13:42:03.820664 IP (tos 0x0, ttl 64, id 15093, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18868, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 83, length 64}
13:42:04.176450 IP (tos 0x48, ttl 51, id 33911, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3722, length 64}
13:42:04.177522 IP (tos 0x0, ttl 64, id 15094, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49736, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3722, length 64}
13:42:04.848115 IP (tos 0x48, ttl 51, id 33912, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 84, length 64}
13:42:04.848241 IP (tos 0x0, ttl 64, id 15095, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18869, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 84, length 64}
13:42:05.179624 IP (tos 0x48, ttl 51, id 33913, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3723, length 64}
13:42:05.186429 IP (tos 0x0, ttl 64, id 15096, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49737, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3723, length 64}
13:42:05.840298 IP (tos 0x48, ttl 51, id 33914, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 85, length 64}
13:42:05.840420 IP (tos 0x0, ttl 64, id 15097, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18870, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 85, length 64}
13:42:06.158010 IP (tos 0x48, ttl 51, id 33915, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3724, length 64}
13:42:06.159102 IP (tos 0x0, ttl 64, id 15098, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49738, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3724, length 64}
13:42:06.818195 IP (tos 0x48, ttl 51, id 33916, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 86, length 64}
13:42:06.818324 IP (tos 0x0, ttl 64, id 15099, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18871, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 86, length 64}
13:42:07.124790 IP (tos 0x48, ttl 51, id 33917, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3725, length 64}
13:42:07.125777 IP (tos 0x0, ttl 64, id 15100, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49739, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3725, length 64}
13:42:07.816515 IP (tos 0x48, ttl 51, id 33918, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 87, length 64}
13:42:07.816624 IP (tos 0x0, ttl 64, id 15101, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18872, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 87, length 64}
13:42:08.128595 IP (tos 0x48, ttl 51, id 33919, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3726, length 64}
13:42:08.129682 IP (tos 0x0, ttl 64, id 15102, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49740, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3726, length 64}
13:42:08.874084 IP (tos 0x48, ttl 51, id 33920, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 88, length 64}
13:42:08.874267 IP (tos 0x0, ttl 64, id 15103, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18873, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 88, length 64}
13:42:09.203690 IP (tos 0x48, ttl 51, id 33921, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3727, length 64}
13:42:09.204799 IP (tos 0x0, ttl 64, id 15104, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49741, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3727, length 64}
13:42:09.939166 IP (tos 0x48, ttl 51, id 33922, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 89, length 64}
13:42:09.939270 IP (tos 0x0, ttl 64, id 15105, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18874, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 89, length 64}
13:42:10.247071 IP (tos 0x48, ttl 51, id 33923, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3728, length 64}
13:42:10.248183 IP (tos 0x0, ttl 64, id 15106, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49742, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3728, length 64}
13:42:10.871466 IP (tos 0x48, ttl 51, id 33924, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 90, length 64}
13:42:10.871557 IP (tos 0x0, ttl 64, id 15107, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18875, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 90, length 64}
13:42:11.212565 IP (tos 0x48, ttl 51, id 33925, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3729, length 64}
13:42:11.213609 IP (tos 0x0, ttl 64, id 15108, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49743, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3729, length 64}
13:42:11.853452 IP (tos 0x48, ttl 51, id 33926, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.1: ICMP echo request, id 871, seq 91, length 64}
13:42:11.853581 IP (tos 0x0, ttl 64, id 15109, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 64, id 18876, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.1 > 192.168.1.1: ICMP echo reply, id 871, seq 91, length 64}
13:42:12.247625 IP (tos 0x48, ttl 51, id 33927, offset 0, flags [DF], proto UDP (17), length 122)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    192.168.1.1 > 192.168.0.2: ICMP echo request, id 22606, seq 3730, length 64}
13:42:12.248997 IP (tos 0x0, ttl 64, id 15110, offset 0, flags [none], proto UDP (17), length 122)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {IP (tos 0x0, ttl 63, id 49744, offset 0, flags [none], proto ICMP (1), length 84)
    192.168.0.2 > 192.168.1.1: ICMP echo reply, id 22606, seq 3730, length 64}
13:42:12.423101 IP (tos 0x48, ttl 51, id 33928, offset 0, flags [DF], proto UDP (17), length 54)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[](62648/30984) {LCP, Term-Request (0x05), id 2, length 18
    encoded length 16 (=Option(s) length 12)
    0x0000:  c021 0502 0010}
13:42:12.433080 IP (tos 0x0, ttl 64, id 15111, offset 0, flags [none], proto UDP (17), length 42)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[](62390/24993) {LCP, Term-Ack (0x06), id 2, length 6}
13:42:13.214877 IP (tos 0x48, ttl 51, id 33929, offset 0, flags [DF], proto UDP (17), length 64)
    31.175.7.251.55137 > 10.20.30.40.1701: [udp sum ok]  l2tp:[TLS](62648/0)Ns=4,Nr=3 *MSGTYPE(StopCCN) *ASSND_TUN_ID(62390) *RESULT_CODE(6)
13:42:13.215212 IP (tos 0x0, ttl 64, id 36771, offset 0, flags [DF], proto UDP (17), length 64)
    10.20.30.40.1701 > 31.175.7.251.55137: [udp sum ok]  l2tp:[TLS](62390/24993)Ns=3,Nr=5 *MSGTYPE(CDN) *RESULT_CODE(3) *ASSND_SESS_ID(30984)

I don't know what is the direct reason of the connection interruption. Maybe if I knew I could stop the phone from disconnecting the insecure tunnel.

Even though the connection does not last, it may be enough to carry out some kind of attack. In fact the traffic dump above shows us information that should be kept hidden:

{PAP, Auth-Req (0x01), id 1, Peer username, Name password}

Yes, it is the username and password, plain text. These are not required for a secure L2TP/IPsec connection, but Android insist on entering this passwords and some VPN set-ups may require that for extra authentication or accounting. The username/password pair may be used for other services in the organisation, so it should never leak out that easy.

Please note that configuring the VPN server to use CHAP instead of PAP doesn't help – at this stage the client is communicating with anybody, so it is the potential MITM attacker who can choose the PPP authentication protocol.

All a man-in-the-middle have to do to eavesdrop or take over the connection is to block the IKE negotiation (e.g. by blocking the port 500).

Conclusions

VPN is about secure connection to a trusted network over insecure, untrusted network. The Android VPN client doesn't provide the trust to the other VPN end and does not necessarily protect the connection from eavesdropping.

Anyone able to get between the phone and the VPN server may be able to:
- Take over the connection, if only he has a certificate issued by the trusted CA.
- Get the PPP username and password and take over the connection, for at least 10 seconds, otherwise.

The fact that Androids sets the default route to the VPN probably does not make things better…

P.S.: I have reported the issues to security@android.com a week ago. The only reply I got was the automatic response that 'they will follow up with me shortly, unless the thing I am reporting is not a security issue'. I treat no actual answer in a week as saying 'we don't treat this as a security issue'.

P.S. 2: The article is anonymized a bit: 'vpn.example.org' (10.20.30.40) – the VPN server, 'badvpn.example.net' – its alternative name, 192.168.0.1 – LAN IP address of the server, 192.168.0.2 another test machine in the LAN (for ping tests), 192.168.1.1 – IP address of the phone in the VPN.

P.S. 3: You may use the Google+ entry for comments, as commenting on the Jogger.pl platforms seems a bit broken.

Dodaj komentarz do wpisu „Android implementation of VPN L2TP/IPsec vulnerable to MITM attacks”