On Wed, 25 Nov 2026, 08:17 Jean-François Stenuit, <[email protected]> wrote:

>
> ,
>
> The 'bindshell' test in chkrootkit produced a false "Potential bindshell
> installed: infected ports: 511" warning. Root cause: the detection regex
> matches a hexadecimal fragment of an IPv6 address as if it were a port
> number, not an actual open port.
>


thanks, yes. a patch to fix this would be welcome - you could try reporting
it to upstream, i think they changed this code in the last release. but i
suspect you might need to help them fix it


> -- Root cause --
>
> bindshell() in /usr/sbin/chkrootkit builds the following command
> (abbreviated, PORT list includes 511):
>
>     ${netstat} -an | ${egrep} "^(tcp.*LIST|udp).*[.:]${P}[^0-9.:]"
>

i think you are correct, although i have  not looked in detail.



> On this system ${netstat} resolves to `ss` (via _chk_netstat_or_ss), so
> the actual command is `ss -an`. One of the lines produced by `ss -an` is
> the IPv6 link-local socket used by ntpd for NTP (UDP/123) on a VPN tun
> interface, using a kernel-generated RFC 7217 "stable-privacy" address:
>
>     udp   UNCONN    0      0      [fe80::947d:511e:d141:daaf]%tun0:123
> [::]:*
>




> -- Suggested fix --
>
>
>
>     ${egrep} "^(tcp.*LIST|udp)[^[]*(\]:| [0-9.]+:)${P}([[:space:]]|$)"
>




> (illustrative only - not tested against every netstat/ss output variant
> chkrootkit has to support)
>

i think just netstat and ss. upstream seems to care about some bsd as well,
i think


. Alternatively, parsing with awk on the
> address:port column specifically (splitting on the last ':') would be
> more robust than a single egrep
>

i suspect upstream would prefer egrep

Reply via email to