You are not logged in.

#1 2024-04-17 16:25:09

kaeru
Member
Registered: 2024-04-17
Posts: 1

Xinetd issue on docker

I am facing some strange behavior when i try to use xinetd on docker. I have a binary into a container and xinetd should run it on a given port. When i run the container it is created and starts just fine, but i can't actually connect to the port and execute the binary for around 5 minutes. Then everything works. A friend with arch have the same issue while all the other guys with different distributions doesn't. We all have the same version of docker.
Here are the files we all used to setup the container:

Docker compose:

 services:
  leakers:
    build:
      context: path_to_binary_folder
      dockerfile: debug_dir/Dockerfile
    command: /usr/sbin/xinetd -dontfork
    volumes:
      - ./debug_dir/xinetd:/etc/xinetd.d/leakers:ro
    ports:
      - 6666:6666
    expose:
      - 6666
    cap_add:
      - CAP_SYS_PTRACE
    security_opt:
      - seccomp:unconfined

Dockerfile:

FROM ubuntu:22.04

RUN apt-get update && apt-get install -y xinetd
RUN useradd -d /challenge -s /bin/false -c "" challenge
COPY leakers /home/challenge/leakers
COPY debug_dir/run.sh /home/challenge/run.sh
RUN chown -R challenge /home/challenge
USER challenge

run.sh:

#!/bin/sh

/home/challenge/leakers

xinetd

service leakers
{
    disable = no
    type = UNLISTED
    wait = no
    server = /home/challenge/run.sh
    socket_type = stream
    protocol = tcp
    user = challenge
    port = 6666
    flags = REUSE
}

leakers is the name of the binary i am trying to execute right now, but it shows the same behavior with every binary i tried.

Offline

Board footer

Powered by FluxBB