How to intercept packets during handshake using Socket Filters in NKE?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=wmJoHQdvBHRMUOaycFtLyWkbP6fy2XkkAwGdAp7pGGE=; b=q0cFezyjjJxcDEAMH9vgoy1YA+wa6BcgxXmDyl8QPtwfwdU2gdRzzkgjfoQz9q4yet 4VJFoFHuaARXwsfDmWeeTp387keuQLDi9ZOl+4V/47ZqhMije1SItcMBgTHEMIX64Sfz q02v6QcJZ7aDZLI/dYqzFsZg/AhgNeNz90b24= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=dAD079TvAKWX8cck15x7Vo/5iLwWhhcOHlvq1upS6mbT+rIVKNd6/sVnv5goMmNA6w ZNfOLF76N108nQw4HrauNPQrLhxc9oNXkYVev5zs0mAMqRHjiB2x3AEvLoEWIpzo1nlV yZk1PyDhRaRGUcRurfPBXcsxxPxlPF9XkaDD4= Hi fellow kernel developers, I'm writing this network kernel extension to inject packets during TCP handshake. The client initiating a TCP connection sends a packet, with a selected sequence number and SYN flag on, to the remote server. As soon as the server receives client's request, it replies with a packet containing both SYN+ACK numbers. I'll inject my packets after server's confirmation, using the SYN and ACK numbers provided in packet sent by server. I tried to intercept the data I need in sf_data_in_func, yet packets during handshake don't go though sf_data_in_func (or out). Therefore, 1) Is there any way to get the TCP parameters of a particular socket_t without using filters? 2) Is there any way of intercepting packets during handshake using Socket filters? I was also thinking that I can use both IP and Socket filters, former for reading TCP parameters and latter for connection tracking. But that could mean a ton of works and potentially buggy kernel extension. Can you suggest me of a better solution if the existing kernel APIs don't fit? Thanks, Mike Chen. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike Chen