shells
cat /etc/shells
# Displays the list of available login shells on the system.
cat /etc/shells | while read shell; do ls -l $shell 2>/dev/null; done
# Reads each shell listed in /etc/shells and checks its file permissions using ls -l. Errors (e.g., non-existing files) are redirected to /dev/null to avoid clutter.
find / -perm -4000 2>/dev/null
# Searches the entire filesystem (/) for SUID binaries (files with the set-user-ID bit enabled). Errors (e.g., permission denied) are suppressed by redirecting them to /dev/null.
find / -exec /bin/rbash -p \; -quit
# Searches the entire filesystem (/) and executes /bin/rbash (a restricted shell) with the -p flag, which prevents privilege reduction. The -quit ensures that the command stops after the first match is found and executed.Last updated