× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The entire script:

#!/bin/sh
pwd
mkdir -p $HOSTNAME/tmp/UNIXresults
chmod -777 $HOSTNAME/tmp/UNIXresults
# this will tell you the hostname
hostname > $HOSTNAME/tmp/UNIXresults/ABOUT.fil
ifconfig >> $HOSTNAME/tmp/UNIXresults/ABOUT.fil
date >> $HOSTNAME/tmp/UNIXresults/ABOUT.fil
# Legal warning banner
echo 'outputting warning banner'
cat /etc/issue > $HOSTNAME/tmp/UNIXresults/WRNBN.fil
cat /etc/issue.net >> $HOSTNAME/tmp/UNIXresults/WRNBN.fil
cat /etc/motd >> $HOSTNAME/tmp/UNIXresults/WRNBN.fil
# SU restrictions
echo 'outputting sudoers'
cat /etc/sudoers > $HOSTNAME/tmp/UNIXresults/SUDOERS.fil
# users
echo 'outputting users'
cat /etc/passwd > $HOSTNAME/tmp/UNIXresults/USERS.fil
# groups
echo 'outputting groups'
cat /etc/group > $HOSTNAME/tmp/UNIXresults/GROUPS.fil
# System log files
echo 'this will tell you what is configured in the syslog'
cat /etc/rsyslog.conf > $HOSTNAME/tmp/UNIXresults/SYSLOG.fil
cat /etc/syslog.conf >> $HOSTNAME/tmp/UNIXresults/SYSLOG.fil
# PAM configuration
echo 'this will tell what to investigate about the PAM configuration -
this is NOT a complete output of ALL PAM configs! If questions please
discuss with the UNIX admin!'
cat /etc/pam.d/system-auth > $HOSTNAME/tmp/UNIXresults/PAM.fil
cat /etc/security/pwquality.conf >> $HOSTNAME/tmp/UNIXresults/PAM.fil
cat /etc/pam.d/su |grep pam_wheel.so >> $HOSTNAME/tmp/UNIXresults/PAM.fil
# SSHD configuration
echo 'options available to limit which users and group can access the
system via SSH'
cat /etc/ssh/sshd_config |grep "^AllowUsers" >
$HOSTNAME/tmp/UNIXresults/SSHD.fil
cat /etc/ssh/sshd_config |grep "^AllowGroups" >>
$HOSTNAME/tmp/UNIXresults/SSHD.fil
cat /etc/ssh/sshd_config |grep "^DenyUsers" >>
$HOSTNAME/tmp/UNIXresults/SSHD.fil
cat /etc/ssh/sshd_config |grep "^DenyGroups" >>
$HOSTNAME/tmp/UNIXresults/SSHD.fil
# World writable files
echo 'lists world writable files - if exist in sensitive directories
discuss with system administrator'
find / -perm -2 ! -type l -ls > $HOSTNAME/tmp/UNIXresults/WWW.fil
# SUID & SGUID files
echo 'lists files with the SUID & SGUID bit set - if exist in sensitive
directories discuss with system administrator'
find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -lg {} \;
2>/dev/null > $HOSTNAME/tmp/UNIXresults/GUIDandSUID.fil
tar -cf $HOSTNAME/tmp/UNIXresults.tar $HOSTNAME/tmp/UNIXresults/*.fil
rm -f $HOSTNAME/tmp/UNIXresults/*.fil
rmdir $HOSTNAME/tmp/UNIXresults
exit 0




Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.