Services

Can we stop or start the service as our current user? What actions take place as a result of being able to stop and start services

# Print process binaries/paths and permissions
ps aux | awk ‘{print $11}’ |xargs -r ls -la 2>/dev/null |awk ‘!x[$0]++’

# List all cron jobs. What tasks or jobs is the system configured to run and at which times
cat /etc/crontab && ls -als /etc/cron.*

# Contents of Xinetd services
cat /etc/xinetd.d/*

# Like Known Services (SysV)
chkconfig —list

# Get CouchDB Version
couchdb -V

# List install packages (debian)
# What software packages are installed on the system, what versions and are the versions out=of-date and vulnerable to existing exploits?
dpkg -l
searchsploit “httpd 2.2”

# Find world-writeable cron jobs
# Are there any custom jobs or tasks configured as root that are world writeable. Can we modify any of the existing tasks at all?
find /etc/cron* -type f -perm - o+w -exec ls -l {} \\;

# Find cron jobs owned by other users
find /etc/cron* -user <username>

# Find services in /etc/init.d not owned by root and list their permissions
find /etc/init.d/ ! -uid 0 -type f 2>/dev/null |xargs ls -la

# Most recent logins
lastlog

# Loaded PCI devices
lspci

# Loaded USB devices
lsusb

#Get mysql version
mysql -version

# Dump Samba user database information
pdbedit -L -w
pdbedit -L -v

# List running processes
ps auxwww
ps -ef

# Get Postgres Version
psql -V

# List all running services (Debian,CentOS,Redhat,Ubuntu)
service —status-all

# Print the status of a service (Debian,CentOS)
service <service> status

service service_name start/stop

# Can we sudo known binaries that allow breaking out of a shell?
sudo -l | grep vim
sudo -l | grep nmap
sudo -l | grep vi

# List all systems services (Debian,CentOS,Redhat)
systemctl list-unit-files