Created
January 9, 2024 08:36
-
-
Save uncelvel/afbdf14569d6da41807e4a54263422d9 to your computer and use it in GitHub Desktop.
audit.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host=$(hostname) | |
/sbin/chkconfig -list > 01.1.services.txt | |
/bin/cat /etc/xinetd.conf > 01.2.etc_xinetdconf.txt | |
/bin/cat /etc/xinetd.d/r* > 01.3.etc_xinetdd_r.txt | |
/bin/ls -al /home/* > 01.4.home_dirs.txt | |
/bin/cat /etc/hosts.equiv > 02.${host}_host_equiv.txt | |
/bin/ls -l /etc/hosts.equiv > 03.${host}_perm_equiv.txt | |
/bin/cat /etc/passwd > 04.${host}_etc_passwd.txt | |
/bin/more /etc/shadow > 05.etc_shadow.txt | |
/usr/bin/ypcat passwd > 06.passwd.txt | |
/bin/grep umask /etc/bashrc > 07.${host}_bash_umask.txt | |
/bin/grep umask /etc/profile > 08.${host}_umask.txt | |
/bin/grep -r umask /home/ > 09.${host}_umask_users.txt | |
/bin/ls -l /etc/passwd > 10.${host}_perm_etcpasswd.txt | |
/bin/ls -l /etc/shadow > 11.${host}_perm_shadowpasswd.txt | |
/usr/sbin/netstat -an | grep LISTEN > 12.netstat.txt | |
/bin/cat /etc/vsftpd/vsftpd.conf > 13.etc_vsftpd_vsftpdconf.txt | |
/bin/cat /etc/vsftpd.ftpusers > 14.${host}_vsftpuser.txt | |
/bin/cat /etc/vsftpd.user_list > 15.${host}_vsftpuser2.txt | |
/bin/cat /etc/ftpaccess > 16.${host}_wuftpuser.txt | |
/bin/ls -al /root/.* > 17.${host}_root_dir.txt | |
/bin/cat /etc/login.defs > 18.etc_logindefs.txt | |
/bin/cat /etc/pam.d/system-auth > 19.etc_pamd_systemauth.txt | |
/usr/bin/ls -l /var/log/ > 20.var_log.txt | |
/bin/cat /etc/pam.d/login > 21.etc_pamd_login.txt | |
/bin/cat /etc/pam.d/system-auth > 22.etc_pamd_systemauth.txt | |
/bin/ls -l /etc/security/opasswd > 23.tc_security_opasswd.txt | |
/usr/bin/cat /etc/profile > 24.etc_profile.txt | |
/usr/bin/cat /root/.profile > 25.root_profile.txt | |
/bin/more /etc/syslog.conf > 26.etc_syslog.txt | |
/bin/more /var/log/secure > 27.var_log_syslog.txt | |
/bin/more /var/log/messages > 28.var_log_message.txt | |
/usr/bin/lastlog > 29.lastlog.txt | |
/usr/bin/w > 30.w.txt | |
/usr/bin/who > 31.who.txt | |
/usr/bin/finger > 32.finger.txt | |
/usr/bin/rwho > 33.rwho.txt | |
/usr/bin/users > 34.users.txt | |
/usr/bin/last > 35.last.txt | |
/bin/cat /etc/security/access.conf > 36.${host}_sec_access.txt | |
/bin/cat /var/log/secure > 37.${host}_secure_log.txt | |
/bin/cat /etc/group > 38.etc_group.txt | |
/bin/cat /etc/group | grep root > 39.${host}_root_grp.txt | |
/bin/cat /etc/ftpusers > 40.${host}_ftpusers.txt | |
/usr/bin/cat /.profile > 41.${host}_root_profile.txt | |
/usr/bin/find / -type d -perm -2 -exec ls -dlL {} \; > 42.${host}_wwdir.txt | |
/usr/bin/find / -type f -perm -00102 -exec ls -dlL {} \; > 43.${host}_wwfile.txt | |
/find -perm +1 -exec echo {} \; > 44.binaries.txt | |
/usr/bin/find / -user root -type f -perm -4000 -exec ls -al {} \; > 45.${host}_suid.txt | |
/usr/bin/find / -user root -type f -perm -2000 -exec ls -al {} \; > 46.${host}_sgid.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment