How to find out If Program/Application is compiled with TCP Wrappers Or Not?

本文介绍如何使用ldd命令检查特定守护进程是否支持TCP Wrapper,以及如何通过strings命令确定服务是否由tcp_wrapper处理,适用于Red Hat Enterprise Linux所有版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://access.redhat.com/solutions/47176

 SOLUTION 已验证 - 已更新 2013年十一月17日04:12 - 

English 

环境

  • Red Hat Enterprise Linux (All versions)
  • tcp_wrappers

问题

  • How to find out which application are compiled with tcp_wrapper support?
  • How to find out If Program/Application is compiled with TCP Wrappers Or Not?

决议

Use ldd command to determine whether a given executable daemon /path/to/daemon supports TCP Wrapper.

Raw

 $ ldd /path/to/daemon | grep libwrap.so

If this command returns any output, then the daemon supports TCP Wrapper.

Raw

# ldd /usr/sbin/vsftpd | grep libwrap
libwrap.so.0 => /lib64/libwrap.so.o (0x000xxxxxxxx)

ldd is used to see if libwrap.so is a dependency or not. Some services don't use 'libwrap' library. For these services, execute following command.

Raw

# strings $(which <service_name>) | grep hosts
e.g.
hosts_access
/etc/hosts.allow
/etc/hosts.deny

If the results contain /etc/hosts.{allow,deny}, the service is handled by tcpwrapper.

NOTE: xinetd is a TCP wrapped super service. A service on xinetd can be restricted by xinetd with libwrap, even if the service program doesn't link to libwrap.so. Refer to another solution for the detail of xinetd.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值