Linux Information Gathering and Situational Awareness
As with Windows getting a situational awareness is important. Having a familiarity with BASH is important in order to be confident with your enumeration skills. You must save these results for off line analysis, as this can be used for privilege escalation later. There are several different distributions of Linux as we all know, they can be broken down in a few major groups Debian/SlackWare/RHEL/Arch.
First we will want to find out the environment which we are in, since often times in production an Administrator and more over management is worried to say the least during patching especially when it comes to "critical infrastructure", so we often find that only major issues are patched at best, an operator should keep this in mind during this phase when landing on a machine.
Finding out about OS
Finding out about the networks
Check Routing
Checking active connections (TCP)
Checking Active Ports and Services on those ports:
Disk enumeration
Must be admin to view contents of shadow
View Passwords
Groups
Sudoers
Sticky Bits Files (File Permissions)
World Writable Directories & Files
Files owned by current user
Permissions to root and home
Last logged on users
Processes running as root
Distribution Specific
Installed Packages for RHEL/Centos or Debian
Debian
RHEL/CentOs
RHEL/Centos startup processes
Debian startup (older pre-systemd)
Debian Startup (Newer)
Checking Cron for user
*Note: if you are in sudoers you can always change that password then start issuing commands and a super user.
Gathering information about the machine which you are currently on is important as applications installed can be exploited to give an operator privileges.
As with Windows getting a situational awareness is important. Having a familiarity with BASH is important in order to be confident with your enumeration skills. You must save these results for off line analysis, as this can be used for privilege escalation later. There are several different distributions of Linux as we all know, they can be broken down in a few major groups Debian/SlackWare/RHEL/Arch.
First we will want to find out the environment which we are in, since often times in production an Administrator and more over management is worried to say the least during patching especially when it comes to "critical infrastructure", so we often find that only major issues are patched at best, an operator should keep this in mind during this phase when landing on a machine.
Finding out about OS
Code
cat /etc/*-release
cat /etc/issue
uname -arFinding out about the networks
Code
cat /etc/sysconfig/network
cat /etc/resolv.conf
cat /etc/nsswitch.conf
ifconfig -aCheck Routing
Code
route
arp -aChecking active connections (TCP)
Code
netstat -antpChecking Active Ports and Services on those ports:
Code
netstat -pDisk enumeration
Code
df
mount
cat /etc/fstabMust be admin to view contents of shadow
View Passwords
Code
cat /etc/passwd
cat /etc/shadowGroups
Code
cat /etc/groupSudoers
Code
cat /etc/sudoersSticky Bits Files (File Permissions)
Code
find / -perm -g=s -o -perm -4000 ! -type l -maxdepth 3 -exec ls -ld {} \; 2>/dev/nullWorld Writable Directories & Files
Code
find / -perm -222 -type d 2>/dev/null
find / -type f -perm 0777 2>/dev/nullFiles owned by current user
Code
find / -user $(whoami) 2>/dev/nullPermissions to root and home
Code
ls -ahlR /home/
ls -ahlR /root/
[code]
Logged on users
[code]
wLast logged on users
Code
lastProcesses running as root
Code
ps -ef | grep rootDistribution Specific
Installed Packages for RHEL/Centos or Debian
Debian
Code
dpkg -lRHEL/CentOs
Code
rpm -qaRHEL/Centos startup processes
Code
chkconfig --list | grep $(runlevel | awk '{ print $2}'):onDebian startup (older pre-systemd)
Code
ls /etc/init.d/Debian Startup (Newer)
Code
systemctl list-units -t service --no-legend --allChecking Cron for user
Code
crontab -u username -l*Note: if you are in sudoers you can always change that password then start issuing commands and a super user.
Gathering information about the machine which you are currently on is important as applications installed can be exploited to give an operator privileges.

