# test-quicconnection # # 20210602 initial Version # Simple QUIC Reachability Test param ( [string]$remotesystem = "play.google.com", # remote host or IP-Address [int]$remoteudpport=443, # user https/udp port [int]$sourceudpport=0 # use any high port #[string]$remoteip = "www.facebook.com" #[string]$remoteip = "172.217.20.67" # ip von www.google.com ) $udpClient = new-Object System.Net.Sockets.Udpclient($sourceudpport) $udpClient.Client.ReceiveTimeout = 1000 # QUIC Packet from an Wireshark Connection to play.google.com $byteBuffer = @(0xc7,0xff,0x00,0x00,0x1d,0x08,0xaa,0xb1,0x22,0x79,0xc4,0x13,0xd3,0x56,0x00,0x37, 0x00,0x87,0xca,0x2e,0xe5,0x06,0xce,0xbd,0x4e,0xf7,0x0f,0xa2,0x7c,0x57,0x05,0x8d, 0x21,0xf9,0x4f,0xde,0xb3,0xad,0x9a,0x75,0xff,0x26,0xbb,0xe5,0x5d,0xd8,0xd3,0x85, 0x21,0x72,0x50,0x51,0x23,0x9d,0xbb,0xfe,0xc6,0xdd,0x98,0xcd,0xa3,0xc2,0xe9,0x83, 0x43,0x29,0x37,0x1f,0x49,0xa6,0xd8,0x44,0xe9,0x43,0x64,0x70,0xed,0x8b,0x49,0xcb, 0x89,0x14,0xb4,0x3e,0x63,0x02,0x65,0xe9,0x1d,0x0c,0x93,0xa7,0x04,0xaa,0xfa,0x84, 0x3f,0x18,0x2f,0x68,0x3a,0xbd,0x32,0x59,0x85,0x63,0x3e,0x48,0x11,0xb3,0xd6,0x98, 0xda,0x30,0xc6,0x30,0x59,0xe3,0xef,0x6e,0x40,0xfd,0x4c,0x57,0x97,0xa2,0x4e,0x93, 0x3f,0xef,0x4f,0x98,0x83,0x79,0xa2,0x58,0x79,0xb0,0xfa,0x2b,0x00,0xa4,0x13,0x7b, 0x09,0x27,0x66,0x81,0x4f,0xe4,0xce,0x06,0x79,0xd7,0x0c,0x62,0x09,0x09,0x78,0xc7, 0xcb,0x2c,0x4b,0x86,0x1b,0xbd,0xe2,0x65,0x2c,0x48,0x2b,0x8f,0xc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60,0x17,0x7f,0x17,0x2e,0x5c,0x30, 0x66,0x38,0xe5,0x0d,0x3d,0x70,0x22,0xbb,0x4f,0xc2,0x74,0x33,0xd1,0xef,0xba,0xc7, 0x90,0x88,0x0f,0xfb,0x86,0x26,0xfe,0x8a,0x98,0xce,0xfa,0x41,0x44,0xb3,0x4d,0x84, 0xa2,0x2e,0x15,0x12,0x1d,0x9c,0x09,0x71,0xf7,0xdc,0x6c,0x41,0x24,0x12,0xbf,0x34, 0x98,0x2a,0x2e,0xa6,0xd8,0xbf,0x18,0xdd,0x14,0xd8,0x02,0xc0,0x16,0x81,0x27,0xdb, 0xb1,0x65,0xcf,0x47,0x92,0xff,0x18,0x01,0x80,0x36,0x56,0xdf,0xe9,0xee,0x68,0xc4, 0x4d,0x37,0x7b,0xe7,0xdd,0x22,0x03,0x72,0x7e,0x21,0xec,0x08,0x30,0x75,0x95,0x2d, 0x05,0x69,0x7a,0x25,0x23,0x5e,0x28,0x03,0x0d,0x4a,0x3d,0xdf,0xe6,0xd6,0xad,0x2c, 0x60,0xb9,0x4a,0xa9,0xf1,0x7b,0xdc,0x3d,0x84,0x83,0xe6,0xf1,0xcc,0x75,0xee,0xda, 0xc9,0x9b,0x42,0x9f,0x3d,0x99,0xef,0x3d,0x2a,0xcc,0x7c,0xdb,0x53,0x79,0x57,0xea, 0x2b,0xaa,0x3d,0x05,0x5a,0x7f,0x9c,0xa2,0xef,0x5a,0x06,0xb6,0xca,0x6d,0x94,0xdf, 0xd7,0x98,0xf7,0x9a,0x4c,0x2e,0x74,0x4c,0xe4,0x37,0xd8,0x2f,0x58,0xeb,0x19,0xeb, 0x62,0x97,0x6e,0x29,0xc8,0xa5,0xab,0x59,0x33,0x24,0xd8,0xc6,0x82,0x91,0x81,0x45, 0x8a,0xa3,0xd3,0x95,0xf2,0xad,0xca,0x1a,0x2c,0x03,0x13,0x6a,0x90,0xfa,0xf9,0x37, 0x09,0xd0,0x6b,0x12,0x86,0x06,0x66,0x0e,0x77,0xf8,0x24,0xe0,0x6d,0xc3,0xbc,0x40, 0x54,0x96,0xb7,0x71,0x96,0x07,0x25,0x5f,0x42,0x27,0xa9,0xc0,0x33,0xa5,0x9d,0x56, 0xec,0x59,0x4a,0x1a,0x38,0xb0,0x20,0xc0,0x1a,0xb7,0x47,0xe9,0xf3,0x58,0x9e,0x10, 0xfe,0xae,0xff,0x55,0x80,0x40,0x26,0x68,0xeb,0xcb,0xe0,0x75,0x68,0xb5,0x73,0xd5, 0xe4,0x1f,0x27,0x18,0x47,0x4e,0xe1,0x52,0x3c,0x3f,0xc3,0x29,0xbd,0x8f,0xef,0x74, 0x6d,0xd2,0x19,0x77,0x1f,0x5b,0x5f,0x6b,0x36,0xa7,0x16,0x21,0x0f,0x3c,0x5c,0xbe, 0x63,0x03,0x86,0x16,0x01,0xe0,0x9c,0xcb,0x76,0x96,0xa5,0xc4,0xc8,0xe8,0x42,0x66, 0x30,0x37,0x47,0xb4,0xa3,0x61,0x98,0xfe,0x46,0xac,0x94,0x98,0x70,0x3e,0x28,0x7d, 0x58,0x10,0x4e,0xc8,0x25,0xec,0x84,0xe8,0xb5,0xa5,0x23,0x3e,0xbe,0x9c,0xc4,0xce, 0x93,0x2f,0x2b,0xab,0x73,0xee,0x5c,0x65,0xbe,0x33,0x60,0x62,0x9e,0x7a,0x0d,0x75, 0xe9,0x9d,0x81,0xb5,0x49,0xfd,0x39,0xfe,0x86,0x6a,0xbd,0x4a,0x37,0x28,0xc7,0x17, 0xfa,0xdc,0xfb,0x19,0xd5,0x24,0x8c,0x64,0x5e,0xc5,0xbd,0x37,0xa0,0xcf,0x6a,0x92, 0x8c,0x9a,0xdc,0x46,0x70,0x9a,0xe8,0x29,0x71,0xa2,0xdc,0xc5,0xed,0xfa,0xa8,0x72, 0x0b,0x51,0x1e,0x9b,0x9f,0x2f,0x26,0x37,0x6c,0x36,0xb1,0xd4,0xec,0x02,0x02,0x22, 0x7e,0x4d,0xac,0x90,0xcb,0x0c,0x6a,0x42,0x06,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20,0x0f,0xb9,0x69,0xcc,0x3c,0x28,0xe2,0x01,0xe0,0xe6,0x01,0xf4,0x27, 0x86,0xdf,0xbf,0xe6,0x07,0xb1,0xb1,0xed,0x08,0xd1,0x32,0x46,0x1d,0x04,0x89,0xce, 0x0e,0x57,0xc7,0x1e,0x69,0x65,0xda,0xb8,0xef,0x82,0x18,0x7b,0x40,0xc7,0xaf,0xed, 0xda,0x1d) $RemoteIpEndPoint = New-Object System.Net.IPEndPoint([system.net.IPAddress]::Parse("0.0.0.0"),0); $sentbytes = $udpClient.Send($byteBuffer, $byteBuffer.length, $remotesystem, $remoteudpport) try { $receive=$udpClient.Receive([ref]$remoteIpEndpoint) write-Verbose "TTL Answer received" $result=[System.BitConverter]::ToString($receive); if ($result.Substring(3,11) -eq "FF-00-00-1D") { write-Verbose "QUIC- Draft-29 Header found" Write-Output "200 OK" } else { write-Verbose "No QUIC- Draft-29 Header found" Write-Output "400 UNKNOWN" } } catch [System.ObjectDisposedException] { write-Verbose "ObjectDisposedException:" Write-Output "600 ObjectDisposedException" } catch [System.Net.Sockets.SocketException] { if ($_.Exception.SocketErrorCode -eq [System.Net.Sockets.SocketError]::TimedOut){ Write-Verbose "SocketException: Timeout" Write-Output "500 Timeout" } else { Write-Verbose "SocketException: $($_.Exception.SocketErrorCode)" Write-Output "600 SocketException $($_.Exception.SocketErrorCode)" } } catch { write-Verbose "Unhandled Error $_" Write-Output "600 UNHANDLED_ERROR" $_ }