Use the awk command to find hidden superusers and passwords in the system.

  

1. Determine that there are several users with uid 0 in the system (that is, users with superuser privileges)

# Awk -F: '$3==0 {print $1}' /etc/passwd

Second, the user with the password in the detection system is empty

# awk -F: 'length($2) ==2 {print $1}' /etc/shadow

Description: The password file defined in this example has a password field length of 2. For systems such as centos, if the password is empty, two will be used. ! ! Indicates, therefore, its length is 2, while the normal user and the password is not empty, is stored encrypted, and its length is much larger than 2.

Copyright © Windows knowledge All Rights Reserved