linux tips
时间:2006-04-13 来源:我爱臭豆腐
检查空口令:
awk -F: '($2 == "") { print $1 }' /etc/shadow
正常执行后应该没有任何显示.
如果是发现有输出显示的话就证明这个用户没有口令.
执行例子:
root@testpc:[/root]awk -F: '($2 == "") { print $1 }' /etc/shadow
test
root@testpc:[/root]cat /etc/shadow|grep test
test::13251:0:99999:7:::
检查tcp/udp所有监听的服务以及进程名称:
root@testpc:[/etc/pam.d]netstat -tulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:32768 *:* LISTEN 1060/rpc.statd
tcp 0 0 testpc:32769 *:* LISTEN 1197/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 1041/portmap
tcp 0 0 *:auth *:* LISTEN 1197/xinetd
tcp 0 0 *:ssh *:* LISTEN 1183/sshd
tcp 0 0 testpc:ipp *:* LISTEN 1161/cupsd
tcp 0 0 testpc:smtp *:* LISTEN 1217/sendmail: acce
udp 0 0 *:32768 *:* 1060/rpc.statd
udp 0 0 *:812 *:* 1060/rpc.statd
udp 0 0 *:sunrpc *:* 1041/portmap
udp 0 0 *:ipp *:* 1161/cupsd
awk -F: '($2 == "") { print $1 }' /etc/shadow
正常执行后应该没有任何显示.
如果是发现有输出显示的话就证明这个用户没有口令.
执行例子:
root@testpc:[/root]awk -F: '($2 == "") { print $1 }' /etc/shadow
test
root@testpc:[/root]cat /etc/shadow|grep test
test::13251:0:99999:7:::
检查tcp/udp所有监听的服务以及进程名称:
root@testpc:[/etc/pam.d]netstat -tulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:32768 *:* LISTEN 1060/rpc.statd
tcp 0 0 testpc:32769 *:* LISTEN 1197/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 1041/portmap
tcp 0 0 *:auth *:* LISTEN 1197/xinetd
tcp 0 0 *:ssh *:* LISTEN 1183/sshd
tcp 0 0 testpc:ipp *:* LISTEN 1161/cupsd
tcp 0 0 testpc:smtp *:* LISTEN 1217/sendmail: acce
udp 0 0 *:32768 *:* 1060/rpc.statd
udp 0 0 *:812 *:* 1060/rpc.statd
udp 0 0 *:sunrpc *:* 1041/portmap
udp 0 0 *:ipp *:* 1161/cupsd
相关阅读 更多 +