Disabling protocol filtering worked. I've sent the pcapng files in a PM, I didn't feel comfortable uploading those anywhere public.
Here's some code to reproduce the problem:
server.py
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 8080))
s.listen(1)
conn, addr = s.accept()
try:
data = conn.recv(1024)
print(data)
except Exception:
pass
conn.close()
client.cs
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace this_is_broken
{
class Program
{
static void Main(string[] args)
{
var client = new TcpClient();
client.Connect(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8080));
var stream = client.GetStream();
var greeting = Encoding.UTF8.GetBytes("hello server!"); // adding \n, \0, or \r anywhere inside this string will allow it to pass through
stream.Write(greeting, 0, greeting.Length);
client.Close();
}
}
}
Edit:
For convenience, here's the client written in python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 8080))
s.send('hello server!'.encode()) # adding \n, \0, or \r anywhere inside this string will allow it to pass through
input()
The recv call ends up blocking until the socket either is closed, or until \n, \0, or \r is written to the stream.