home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / carp / carp.anlz < prev    next >
Text File  |  1992-03-10  |  5KB  |  107 lines

  1. BEGIN { test = 0 }
  2.  
  3. # assumes all checks print out something like:
  4. #
  5. # "**** foo.chk ****"
  6. #
  7. # when the verbose flag is true
  8. #
  9. /^\*\*\*\*/ { check = $2 }
  10.  
  11. {if (test == 1) testing = $0 " " }
  12.  
  13. #
  14. #  IMPORTANT - exception list!
  15. #
  16. #  Be very careful of regular expressions and other awk stuff...
  17. # ()'s, *'s, ?'s, /'s, etc. are all trouble.  Backquote if in doubt.
  18. #
  19. #  Sample list:
  20. #
  21. #  Hassled by mail warning?
  22. # /Warning!  \/usr\/spool\/mail is _World_ writable!/ {next}
  23. #
  24. #  Brave... or stupid?
  25. # _World_ writable!/ {next}
  26. #
  27. #  Kill off YP messages...
  28. #  /YG/ {next}
  29. #  /YP/ {next}
  30.  
  31. #
  32. # START THE CHECKING
  33. #
  34. # level 0 checks:
  35. #
  36. /A "+" entry in/ {print FILENAME, check, testing "0"; next }
  37. # Assume bugs are all bad :-)
  38. /ould have a hole\/bug/ {print FILENAME, check, testing "0"; next }
  39. # kuang telling us we're in deep yoghurt, or something like that...
  40. /DO ANYTHING/ {print FILENAME, check, testing "0"; next }
  41. # writable password file really sucks:
  42. /\/etc\/passwd.*_World_/ {print FILENAME, check, testing "0"; next }
  43.  
  44. # level 1 checks:
  45. #
  46. /uudecode is suid!/ {print FILENAME, check, testing "1"; next }
  47. /rexd is enabled in/ {print FILENAME, check, testing "1"; next }
  48. /User.*home directory.*is mode/ {print FILENAME, check, testing "1"; next }
  49. /User.*:.*is mode/ {print FILENAME, check, testing "1"; next }
  50. /tftp is enabled on/ {print FILENAME, check, testing "1"; next }
  51. /uudecode is enabled in/ {print FILENAME, check, testing "1"; next }
  52. /Password file, line.*is blank/ {print FILENAME, check, testing "1"; next }
  53. /Password file, line.*nonnumeric user id:/ {print FILENAME, check, testing "1"; next }
  54. /(in cron_file) is World writable!/ {print FILENAME, check, testing "1"; next }
  55. /File.*(inside root executed file) is _World_ writable!/ {print FILENAME, check, testing "1"; next }
  56. /File.*(in .*) is _World_ writable!/ {print FILENAME, check, testing "1"; next }
  57. /Directory.*is _World_ writable and in roots path!/ {print FILENAME, check, testing"1"; next }
  58. /ftp's home directory should not be/ {print FILENAME, check, testing "1"; next }
  59. /and.*ass.*are the same/ {print FILENAME, check, testing "1"; next }
  60. /should be mode 555/ {print FILENAME, check, testing "1"; next }
  61. /should be be empty/ {print FILENAME, check, testing "1"; next }
  62.  
  63. # level 2 checks:
  64. #
  65. /is _World_ writable!/ {print FILENAME, check, testing "2" }
  66. /Duplicate Group(s) found in/ {print FILENAME, check, testing "2"; next }
  67. /Group.*has duplicate user/ {print FILENAME, check, testing "2"; next }
  68. /Group file, line.*onnumeric group id:/ {print FILENAME, check, testing "2"; next }
  69. /Group file, line.*blank/ {print FILENAME, check, testing "2"; next }
  70. /Group file, line.*does not have 4 fields:/ {print FILENAME, check, testing "2"; next }
  71. /Group file, line.*nonalphanumeric user id:/ {print FILENAME, check, testing "2"; next }
  72. /Group file, line.*group has password:/ {print FILENAME, check, testing "2"; next }
  73. /Password Problem: Guessed:/ {print FILENAME, check, testing "2"; next }
  74. /Password Problem: null passwd:/ {print FILENAME, check, testing "2"; next }
  75. /Password file, line.*no password:/ {print FILENAME, check, testing "    2"; next }
  76. /Duplicate uid.* found in/ {print FILENAME, check, testing "2"; next }
  77. /Password file, line.*user.*has uid = 0 and is not root/ {print FILENAME, check, testing "2"; next }
  78. /Password file, line.*nonalphanumeric login:/ {print FILENAME, check, testing "2"; next }
  79. /Password file, line.*invalid login directory:/ {print FILENAME, check, testing "2"; next }
  80. /Password file, line.*nonnumeric group id:/ {print FILENAME, check, testing "2"; next }
  81. /Password file, line.*negative user id:/ {print FILENAME, check, testing "2"; next }
  82. /Password file, line.*does not have 7 fields:/ {print FILENAME, check, testing "2"; next }
  83. /Password file, line.*uid.*chars/ {print FILENAME, check, testing "2"; next }
  84. /User.*home directory bar is not a directory!/ {print FILENAME, check, testing "2"; next }
  85. /NFS file system.*exported with no restrictions!/ {print FILENAME, check, testing "2"; next }
  86. /Root's umask set to/ {print FILENAME, check, testing "2"; next }
  87. /is in roots path/ {print FILENAME, check, testing "2"; next }
  88. /uudecode creates setuid files!/ {print FILENAME, check, testing "2"; next }
  89. /ROOT owned SUID file/ {print FILENAME, check, testing "2"; next }
  90. /UserSUID file is type/ {print FILENAME, check, testing "2"; next }
  91. # ftp.chk's...
  92. /should be in/ {print FILENAME, check, testing "2"; next }
  93. /should exist/ {print FILENAME, check, testing "2"; next }
  94. /Need user.*for anonymous ftp to work/ {print FILENAME, check, testing "2"; next }
  95. /Home directory for ftp doesn't exist/ {print FILENAME, check, testing "2"; next }
  96. /and.*oup.*are the same/ {print FILENAME, check, testing "2"; next }
  97. /File.*is missing/ {print FILENAME, check, testing "2"; next }
  98. /should be owned by.*or/ {print FILENAME, check, testing "2"; next }
  99. /Incorrect permissions on "ls" in/ {print FILENAME, check, testing "2"; next }
  100. /Incorrect permissions on "passwd" in/ {print FILENAME, check, testing "2"; next }
  101. /Incorrect permissions on "group" in/ {print FILENAME, check, testing "2"; next }
  102. /Anon-ftp directory.*is World Writable/ {print FILENAME, check, testing "2"; next }
  103.  
  104. #
  105. #  PRINT *SOMETHING* if can't find anything... just for the result file...
  106. {if (check != "") print FILENAME, check, testing "3"; next }
  107.