Skip to content

how to get ipv6 tuple info for -m text #724

Closed
@chilli13

Description

@chilli13

As feat #684 and #695 already support get 4-tuple info for decrypt ssl data from UUID. But the kernel hook function such as sys_connect, __sys_accept4, tcp_v4_destroy_sock only works for ipv4 connection, is there any solutions to obtain ipv6 tuple info? Thks @Asphaltt

{"time":"2025-01-02T14:43:25+08:00","message":"UUID:18605_18605_nginx_32_0_192.168.10.201:35740-192.168.10.41:443, Name:HTTPRequest, Type:1, Length:81\nGET /2.txt HTTP/1.1\r\nHost: zhm.test.com\r\nAccept: */*\r\nUser-Agent: curl/7.71.1\r\n\r\n"}

code kretprobe_connect only deal with AF_INET, and AF_INET6 packet will be dropped.

static __inline int kretprobe_connect(struct pt_regs *ctx, int fd, struct sock *sk, const bool active) {
    ... ...
    u16 address_family = 0;
   ... ...
       bpf_probe_read_kernel(&address_family, sizeof(address_family), &sk->__sk_common.skc_family);
    if (address_family != AF_INET) {
        return 0;
    }
  ... ...

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededpasueLong period of no response, or waiting for a reply.questionFurther information is requestedtodoTo complete it in the future

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions