Linux Custom Enum Script

#!/bin/bash

echo "Current user:"
whoami

echo "Contents of current directory:"
ls -la

echo "Command history:"
history

echo "System information:"
uname -a

echo "Checking for known kernel exploits (Last Resort):"
# Add your kernel exploit checking command here

echo "Checking sudo privileges (If you have credentials):"
sudo -l

echo "Searching for files with specific name and setuid permissions:"
find / -type f -name "*WHATEVER*" -perm -4000 -ls 2>/dev/null

echo "Searching for files with 'flag' in the name:"
find / -type f -name "*flag*" -exec ls -l {} + 2>/dev/null

echo "Contents of system-wide crontab:"
cat /etc/crontab

echo "Contents of user's crontab:"
crontab -e

echo "Checking system path:"
echo $PATH

echo "Contents of NFS exports (if applicable):"
cat /etc/exports

echo "Checking file capabilities:"
getcap -r / 2>/dev/null

# Add any additional Linux enumerating commands below:

# Example:
# echo "Checking system users:"
# cat /etc/passwd

# Example:
# echo "Checking system services:"
# systemctl list-units --type=service

# Example:
# echo "Checking open network ports:"
# netstat -tuln

# Note: Be cautious when running enumeration commands as some of them may require elevated privileges or may take a long time to execute.

Last updated