Skip to content

ossec-remoted not listening IPv4 #1611

@samysberg

Description

@samysberg

-- OS: Ubuntu Server 18.04.01 (Linux 4.15.0-43-generic).
-- OSSEC version: 3.1.0-5732bionic (from atomic's ubuntu repo).
-- System context: this was tested and replicated on a plain semi-vanilla install on a VirtualBox VM. After OS installation I added a mate-desktop and the VirtualBox Guest Additions. Anyways, the results were the same I had on the remote VPS server (same distro/kernel, no desktop/GUI, no VirtualBox stuff, no kernel tainting of any kind).
-- Simplest path to replicate the problem:

  1. install ossec server;
  2. create some agent;
  3. restart ossec server (and it wont listen on IPv4 even with ossec.conf properly set up).

-- Some tests I did after those three steps:

  1. netstat:
root@vmtester:/root #   netstat -tulpan
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      507/systemd-resolve 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      592/cupsd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      592/cupsd           
udp        0      0 127.0.0.53:53           0.0.0.0:*                           507/systemd-resolve 
udp        0      0 192.168.0.136:68        0.0.0.0:*                           497/systemd-network 
udp        0      0 0.0.0.0:631             0.0.0.0:*                           876/cups-browsed    
udp        0      0 0.0.0.0:33891           0.0.0.0:*                           591/avahi-daemon: r 
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           591/avahi-daemon: r 
udp6       0      0 :::5353                 :::*                                591/avahi-daemon: r 
udp6       0      0 :::1514                 :::*                                8387/ossec-remoted  
udp6       0      0 :::59057                :::*                                591/avahi-daemon: r 

1.1) netstat after specifying an IPv4 address:
Sorry that I'm not pasting it (nor the next test results) here, but it was very odd: ossec-remoted was listening on udp 1514 , BUT, at a local IPv6 address number ending with the IPv4 address that I specified on ossec.conf. And nothing was listening on IPv4.
2) netcat on IPv4 UDP 1514 :
Result is that the agent stream was indeed being delivered at the IPv4 UDP 1514 on server machine. And ossec server couldn't get any info from the agent.
3) ossec server logs on debug level 2:
Not a thing about IPv4. But mentions IPv6 binding (not sure now, but I think it said it couldn't bind to IPv6).
-- Sorry for the missing ctrl+v's on the tests but I really had to post this issue today (better than tomnever). And thanks to the developer team for everything! 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions