Hooking on L4 Level with process information

3 messages, 2 authors, 2017-08-29 · open the first message on its own page

Hooking on L4 Level with process information

From: Ravish Kumar <hidden>
Date: 2017-08-29 02:04:53

Hi,

I want to hook tcp/udp packets on L4 Layer and based on process
information , content want to deny or allow packets.

Netfilter provides pre/post Routing hooks but not sure that will be
right place so thought of asking whether my approach is right.
Also how i can get process information whether this packet is send by
this process.

Thoughts /source code reference would be appreciated.

Regards,
Ravish

Re: Hooking on L4 Level with process information

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-08-29 03:19:03

On Tue, 29 Aug 2017 07:34:51 +0530
Ravish Kumar [off-list ref] wrote:
Hi,

I want to hook tcp/udp packets on L4 Layer and based on process
information , content want to deny or allow packets.

Netfilter provides pre/post Routing hooks but not sure that will be
right place so thought of asking whether my approach is right.
Also how i can get process information whether this packet is send by
this process.

Thoughts /source code reference would be appreciated.

Regards,
Ravish
There is not a 1:1 relationship between sockets/files and processes.

Re: Hooking on L4 Level with process information

From: Ravish Kumar <hidden>
Date: 2017-08-29 03:36:39

Not convinced with this .

A process open a socket and that socket is associated with that
particular process unless it shares the file descriptors.
Can you explain why it is not related , at a time a socket will be
opened by a particular process.

On Tue, Aug 29, 2017 at 8:49 AM, Stephen Hemminger
[off-list ref] wrote:
On Tue, 29 Aug 2017 07:34:51 +0530
Ravish Kumar [off-list ref] wrote:
quoted
Hi,

I want to hook tcp/udp packets on L4 Layer and based on process
information , content want to deny or allow packets.

Netfilter provides pre/post Routing hooks but not sure that will be
right place so thought of asking whether my approach is right.
Also how i can get process information whether this packet is send by
this process.

Thoughts /source code reference would be appreciated.

Regards,
Ravish
There is not a 1:1 relationship between sockets/files and processes.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help