TCP Wrappers is a security tool for Linux and Unix-like systems that allows you to control access to network services based on the hostname or IP address of the client. TCP Wrappers works by intercepting incoming connection requests and checking them against a configuration file (/etc/hosts.allow
and /etc/hosts.deny
) to determine whether the connection should be allowed or denied.
To find out if a program is compiled with TCP Wrappers support, you can use the ldd
command to list the dynamic dependencies of the program. If the program is linked to the libwrap.so
library, it is compiled with TCP Wrappers support.
For example:
ldd program
This will show the dynamic dependencies of the program
executable. If libwrap.so
is listed, the program is compiled with TCP Wrappers support.
Alternatively, you can use the lsof
command to list the open files of the program. If the program
executable has the /etc/hosts.allow
or /etc/hosts.deny
files open, it is using TCP Wrappers.
For example:
lsof -p PID
This will show the open files of the process with ID PID
. If /etc/hosts.allow
or /etc/hosts.deny
are listed, the program is using TCP Wrappers.
By using these