Skip to content

Got "couldn't init manager error" when launching ecapture in docker container. #403

@pfmiles

Description

@pfmiles

Trying to run ecapture from cmd line, in a Docker container, as root. It emits error:

root@test-xhunterbase-56b679589-w7nmz:/tmp/ecapture-v0.6.3-linux-x86_64# ./ecapture --libssl="/usr/lib/x86_64-linux-gnu/libssl.so.1.1" --gnutls="/usr/lib/x86_64-linux-gnu/libgnutls.so.30" --nspr="/usr/lib/x86_64-linux-gnu/libnspr4.so" tls
2023/10/13 14:08:29 Your environment is a container. We will not detect the BTF config.
tls_2023/10/13 14:08:29 ECAPTURE :: ecapture Version : linux_x86_64:0.6.3-20230927-f0cfbdf:5.15.0-1046-azure
tls_2023/10/13 14:08:29 ECAPTURE :: Pid Info : 29690
tls_2023/10/13 14:08:29 ECAPTURE :: Kernel Info : 4.19.24
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        module initialization
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        master key keylogger: ecapture_masterkey.log
tls_2023/10/13 14:08:29 ECAPTURE ::     Module.Run()
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        UPROBE MODEL
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        origin version:OpenSSL 1.1.1n, as key:openssl 1.1.1n
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        HOOK type:2, binrayPath:/usr/lib/x86_64-linux-gnu/libssl.so.1.1
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        libPthread:/lib/x86_64-linux-gnu/libpthread.so.0
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        Hook masterKey function:SSL_write
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        Your kernel version is less than 5.2, the following parameters will be ignored:[target_pid, target_uid, target_port]
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        BPF bytecode filename:user/bytecode/openssl_1_1_1j_kern_less52.o
tls_2023/10/13 14:08:29 EBPFProbeOPENSSL        module run failed, [skip it]. error:couldn't init manager error:operation not permitted , couldn't adjust RLIMIT_MEMLOCK
tls_2023/10/13 14:08:29 EBPFProbeGNUTLS module initialization
tls_2023/10/13 14:08:29 ECAPTURE ::     Module.Run()
tls_2023/10/13 14:08:29 EBPFProbeGNUTLS BPF bytecode filename:user/bytecode/gnutls_kern_less52.o
tls_2023/10/13 14:08:29 EBPFProbeGNUTLS HOOK type:2, binrayPath:/usr/lib/x86_64-linux-gnu/libgnutls.so.30
tls_2023/10/13 14:08:29 EBPFProbeGNUTLS module run failed, [skip it]. error:couldn't init manager error:operation not permitted , couldn't adjust RLIMIT_MEMLOCK
tls_2023/10/13 14:08:29 EBPFProbeNSPR   module initialization
tls_2023/10/13 14:08:29 ECAPTURE ::     Module.Run()
tls_2023/10/13 14:08:29 EBPFProbeNSPR   BPF bytecode filename:user/bytecode/nspr_kern_less52.o
tls_2023/10/13 14:08:29 EBPFProbeNSPR   HOOK type:2, binrayPath:/usr/lib/x86_64-linux-gnu/libnspr4.so
tls_2023/10/13 14:08:29 EBPFProbeNSPR   module run failed, [skip it]. error:couldn't init manager error:operation not permitted , couldn't adjust RLIMIT_MEMLOCK 
tls_2023/10/13 14:08:29 ECAPTURE ::     No runnable modules, Exit(1)

It seems all of three possible tls hooking modules failed to run. And all of those point to a same error: couldn't init manager error:operation not permitted , couldn't adjust RLIMIT_MEMLOCK

To Reproduce
Steps to reproduce the behavior:
Just download ecapture binary(amd64 version), then unzip it and run the command in a bash repl.

Expected behavior

Screenshots

Linux Server/Android (please complete the following information):

  • Env:
  • KUBERNETES_SERVICE_PORT_HTTPS=443
    KUBERNETES_SERVICE_PORT=6443
    HOSTNAME=test-xhunterbase-56b679589-w7nmz
    LANGUAGE=en_US.UTF-8
    TEST_XHUNTERBASE_SVC_PORT_22_TCP=tcp://172.21.10.6:22
    JAVA_HOME=/opt/jdk
    PWD=/tmp/ecapture-v0.6.3-linux-x86_64
    LS_OPTIONS=--color=auto
    TEST_XHUNTERBASE_SVC_PORT_22_TCP_PORT=22
    HOME=/root
    LANG=en_US.UTF-8
    KUBERNETES_PORT_443_TCP=tcp://172.21.0.1:443
    TEST_XHUNTERBASE_SVC_PORT_10000_TCP_PORT=10000
    TEST_XHUNTERBASE_SVC_PORT_10000_TCP=tcp://172.21.10.6:10000
    TEST_XHUNTERBASE_SVC_PORT_10000_TCP_ADDR=172.21.10.6
    TEST_XHUNTERBASE_SVC_PORT_10000_TCP_PROTO=tcp
    TERM=xterm-256color
    TEST_XHUNTERBASE_SVC_PORT_22_TCP_ADDR=172.21.10.6
    aliyun_log_crd_user_defined_id=k8s-group-c3e4daee1064f4158891f67a0e996ef7a
    SHLVL=2
    TEST_XHUNTERBASE_SVC_PORT=tcp://172.21.10.6:22
    KUBERNETES_PORT_443_TCP_PROTO=tcp
    KUBERNETES_PORT_443_TCP_ADDR=172.21.0.1
    TEST_XHUNTERBASE_SVC_PORT_22_TCP_PROTO=tcp
    TEST_XHUNTERBASE_SVC_SERVICE_PORT_TEST_XHUNTERBASE_SVC_22_22=22
    TEST_XHUNTERBASE_SVC_SERVICE_PORT_TEST_XHUNTERBASE_SVC_10000_10000=10000
    TEST_XHUNTERBASE_SVC_SERVICE_PORT=22
    KUBERNETES_SERVICE_HOST=172.26.19.176
    LC_ALL=en_US.UTF-8
    KUBERNETES_PORT=tcp://172.21.0.1:443
    KUBERNETES_PORT_443_TCP_PORT=443
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk/bin
    TEST_XHUNTERBASE_SVC_SERVICE_HOST=172.21.10.6
    OLDPWD=/tmp
    _=/usr/bin/env
  • OS: Debian 11 "bullseye"
  • Arch: amd64
  • Kernel Version: 4.19.24-7.34.cbp.al7.x86_64
  • Version: v0.6.3-linux-x86_64

Additional context
I'm running a debian 11 linux image in a docker container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions