Send a custom response to a browser (socket NKE filter)
Send a custom response to a browser (socket NKE filter)
- Subject: Send a custom response to a browser (socket NKE filter)
- From: eveningnick eveningnick <email@hidden>
- Date: Wed, 27 Apr 2011 16:06:39 +0300
Hi
I am developing a parental control application.
I have written a simple NKE kext, that registers an sf_data_out_func()
callback, and checks if the packet is the browser's GET request, and
performs checking of some HTTP-headers. If they do not satisfy some
criteria, the callback returns 1 (and the browser's "send()" function
consequently returns an error) - the browser displays a message
"Connection error".
I am wondering, if using this socket filter i could display a custom
message in a browser's window (for example, the text "The request has
been blocked by the filter"), instead of just "Connection error".
I can get a socket_t pointer in the sf_attach_func() and put it as a
'cookie' returned in sf_data_out_func(). Also i can "swallow" a packet
(by returning EJUSTRETURN instead of returning an error) in
sf_data_out_func().
But i am unsure how could i "falsify" the response of the web server
to say "The request has been blocked".
Could you please help me please? Is it feasible at all on the "socket
filter" level?
Thank you!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden