home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / trsxenix.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  14.6 KB  |  324 lines

  1.  
  2. (c) April 15, 1987
  3.  
  4. Security Issues Involving Tandy Xenix Systems
  5.  
  6. Ward D. Griffiths III
  7.  
  8. Competitive Concepts, Inc.
  9. 1100 South Euclid Street
  10. La Habra, CA  90631
  11. (714) 680-8686
  12.  
  13. This paper provides advice and warnings
  14. concerning security on Tandy Xenix systems
  15. for system operators in the small business environment.
  16. Specific attention is given to situations
  17. unique to Tandy Xenix and applications
  18. and to information not explicitly provided
  19. in the Tandy manuals.
  20.  
  21. Introduction
  22.  
  23. In a data processing environment,
  24. security is an important factor to reckon with.
  25. When most timesharing systems were supervised
  26. by folks with extensive training in data processing,
  27. those systems could be monitored by people knowledgeable in security issues,
  28. and could be kept safe.
  29. When microcomputers first appeared,
  30. security was generally a matter of locking up a box of diskettes.
  31. With the power that once required expensive minicomputers now sitting on
  32. desktops, being run by managers with little or no formal training,
  33. simply desiring to run their businesses effectively,
  34. any security loopholes can be critical.
  35. A small business whose database or bookkeeping files
  36. are destroyed or compromised by a stranger or disgruntled employee
  37. may not be able to survive.
  38. As the most common small multi-user system in the hands of such users
  39. is the Tandy/Radio Shack Model 16 or Tandy 6000 running Xenix System III,
  40. this article discusses that system specifically,
  41. although most of the factors should apply to Xenix V/286
  42. and to many other small Unix systems.
  43.  
  44. While the 'core' or 'runtime' version of Xenix
  45. provided by Tandy with the Tandy 6000 contains everything required
  46. to use their 'off-the-shelf' application software,
  47. I strongly recommend acquiring the Development System.
  48. Though the bulk of its material is not immediately useful to a business user,
  49. it provides a number of utility programs
  50. helpful in securing and monitoring the system,
  51. such as process and login accounting, password administration,
  52. and electronic mail, which will be mentioned later in this article.
  53. The $750 list is a small price to pay for the security that it can provide,
  54. and the five volumes of reference manuals,
  55. while intimidating at first, will be invaluable later on.
  56. Possesion of a 'Development System' does not mean that you have to develop
  57. your own programs.
  58.  
  59. Account Maintenance
  60.  
  61. Before doing anything else, make sure that only those users who really
  62. need access to your system have login accounts.
  63. If anyone with an account has quit or been terminated,
  64. get that user out of the system! or little other advice will do any good.
  65. If you have set up accounts for people who may need them later,
  66. but are not yet using the system, remove those as well,
  67. especially if you use any predictable way of assigning initial passwords,
  68. such as the same for everyone or each person's last name.
  69. A user whose password can be guessed is always a security risk.
  70. The ability to sign on to the system or not
  71. is your first and most important line of defense,
  72. and if you have compromised or unpassworded accounts,
  73. they are a detour through Belgium around any Maginot line you can build.
  74.  
  75. Profile-16 & filePro
  76.  
  77. Probably the single largest security weakness
  78. in stock Tandy 6000 Xenix systems
  79. is the result of installing the Profile-16 database system (or filePro-16),
  80. produced by the Small Computer Company and sold by Tandy as well as Small.
  81. The installation process creates an entry in the password file
  82. for a user named \fBprofile\fR,
  83. who owns and operates the program and database files.
  84. Most of the executable files in the database use the setuid mode
  85. (fooling the system into thinking that one user is another)
  86. to grant regular users access to the databases.
  87. When the user \fBprofile\fR is created,
  88. the account has no password, and many managers are unaware that the entry
  89. is made, allowing any casual passer-by with a little bit of savvy
  90. to gain easy access to their systems. In fact, one of the database creation
  91. programs performs a \fBsetuid\fR to \fBroot\fR,
  92. and if invoked with the "right" options can allow any person on the
  93. unrestricted Bourne or C shell to gain superuser privilege
  94. without any need to use the root password.
  95. While I do not feel free to give exact instructions here,
  96. the method is common knowledge in Tandy's Training and Support network.
  97. Protection from it, however, is easy:
  98. (assuming the programs are installed on the primary drive), a simple
  99.  
  100. chmod go-rwx /appl/pf/lib
  101.  
  102. will leave the programs usable from within the database system,
  103. but inaccessible from the shell. Meanwhile, \fBpasswd\fR or cripple the
  104. user named \fBprofile\fR. While the entry is required by the program,
  105. it does not need and should not have actual \fBlogin\fR privilege.
  106.  
  107. Other Ghost Accounts
  108.  
  109. Another mystery user common to most systems is \fBuucpmgr\fR.
  110. If \fBuucp\fR is not being used,
  111. as it is not used on at least 90% of the Tandy Xenix systems in the field,
  112. cripple that account as well.
  113. Even if \fBuucp\fR is on-line,
  114. its manager rarely needs to sign on,
  115. since \fBroot\fR can do anything needed.
  116. Some of the files and programs require the user and group numbers
  117. assigned to \fBuucpmgr\fR,
  118. but access to the shell is an unnecessary risk.
  119.  
  120. If you have any doubts about the security of your system, the first thing to
  121. do is \fBcat /etc/passwd\fR and look for empty password fields.
  122. Any user entry with a pair of colons (\fB::\fR) after the name
  123. should be removed or passworded. The only exception I allow
  124. is the user \fBwho\fR.
  125.  
  126. The Restricted Shell
  127.  
  128. When the \fBmkuser\fR program is executed,
  129. you are given three choices as to which shell (command interpreter)
  130. each user is going to run at \fBlogin\fR: \fBsh\fR, the standard Bourne shell,
  131. \fBcsh\fR, the Berkley C shell, or \fBvsh\fR, the Microsoft Visual shell
  132. with a user interface similar to Multiplan or Microsoft Word.
  133. All three of these shells, as well as Tandy's \fBtsh\fR TRSDOS-style shell,
  134. grant users abilities that you may not want them to have.
  135. If you know how to use an editor, you can manually edit the
  136. \fB/etc/passwd\fR file to give you a fourth and much safer choice.
  137. There is a version of the standard (Bourne) shell, \fBrsh\fR,
  138. with abilities greatly reduced from the its usual form.
  139. Among other restrictions, the \fBcd\fR command is prohibited,
  140. and the user is not allowed to set his own command search path
  141. (or start a command with a slash to specify the full pathname).
  142. Keep those users who are only running applications on that restricted shell,
  143. or set them up on front-end menus that don't encourage system access.
  144. A simple \fB'exec menu'\fR at the tail end of \fB.profile\fR can work wonders.
  145. Profile and filePro provide a convenient menu generator
  146. which is nicely documented, and is a lot easier for a part-time root
  147. to use than writing shell scripts, although the menus when running do eat
  148. a fair chunk of RAM and swap space. I do not recommend nesting them
  149. (calling one menu from another).
  150.  
  151. User Command Paths
  152.  
  153. Leave \fB/bin/sh\fR, \fB/usr/bin/vsh\fR, \fB/bin/csh\fR and \fB/bin/tsh\fR
  154. out of the search path given to your restricted users,
  155. as all four shells immediately unrestrict at execution.
  156. The method that I use is to create separate directories for those users
  157. (\fB/rbin\fR, \fB/usr/rbin\fR), and link into those directories those files
  158. I feel safe for them to use
  159. (\fBlc\fR, \fBcat\fR, \fBmore\fR, \fBcp\fR, and various application startups),
  160. leaving \fB/bin\fR and \fB/usr/bin\fR completely out of their view.
  161. As a side affect, users should not own their \fB.profile\fR scripts:
  162. otherwise, they can edit them back to whichever search path they desire.
  163. I have set up a master \fB.profile\fR in \fB/usr/lib/mkuser/mkuser.prof\fR,
  164. and each time a user is created,
  165. it is linked instead of copied into the new home directory.
  166. This allows me to make global changes affecting all regular users,
  167. instead of editing them one at a time.
  168.  
  169. Password Administration
  170.  
  171. If it is available,
  172. don't hesitate to inflict password administration on your people.
  173. If people are forced to change their passwords periodically,
  174. it not only enforces a bit of added security,
  175. it keeps their memories sharp.
  176. The \fBpwadmin\fR command is part of the Development System,
  177. and lets you specify how often a user is required to change his password,
  178. as well as how long before he can change it again, keeping him from going
  179. right back to his previous and probably compromised password.
  180.  
  181. Login & Process Accounting
  182.  
  183. Again if available,
  184. use login and process accounting,
  185. and scan the files periodically.
  186. My preferred way to do that is to use a \fBcrontab\fR
  187. entry to \fBmail\fR the results to \fBroot\fR
  188. or his designated representative every night.
  189. My designated representative is named monitor,
  190. and the only thing he is allowed to do is to read his mail.
  191. He should read his mail fairly often,
  192. as the files can take up a considerable amount of room on the disk(s).
  193.  
  194. Access Permission Settings
  195.  
  196. Speaking of mail, change the mode on user mailboxes to read/write for the
  197. owner only. The default allows any user to read any other user's mail,
  198. not usually a serious security problem for the system,
  199. but it limits how much the users will use electronic instead of paper messages
  200. to communicate with each other.
  201. Any computer installation is a paper factory,
  202. but why make it any worse than it already is?
  203.  
  204. While you are changing permissions,
  205. another good place to allow privacy
  206. is the home directories of individual users.
  207. Except in rare cases,
  208. no user generally needs direct access
  209. to another user's directory or the contents thereof.
  210. Those occasional documents and spreadsheets needing to be shared
  211. can be linked to each directory,
  212. or placed in a directory common to a group,
  213. though the second choice doesn't work for users on the restricted shell.
  214.  
  215. There are a number of files in the directories \fB/etc\fR and \fB/usr/adm\fR
  216. which should be protected from casual reading or execution,
  217. especially if process accounting is in effect.
  218. These include \fB/etc/logbook\fR,
  219. \fB/etc/rc\fR and any supplemental \fBrc.*\fR files, and
  220.  any
  221. files in \fB/usr/adm\fR involving accounting or user monitoring
  222. (\fBpacct\fR, \fBwtmp\fR, etc.).
  223.  
  224. Modem Lines
  225.  
  226. Keep an eye on any dial-in modem lines.
  227. At the same time process information is sent to "monitor",
  228. I have a duplicate set of those processes performed on my single modem
  229. appended to a file all its own.
  230. As yet, I haven't seen anything odd,
  231. as the telephone number is known only to those people who need to use it,
  232. but a little healthy paranoia in advance of need
  233. is better than ugly recriminations afterward.
  234. Besides telling you who logged in and when,
  235. lines without user names will tell you
  236. when the modem answered the phone without a successful \fBlogin\fR.
  237. When in doubt,there are modems on the market which keep a list of authorized
  238. users and call each user back at a number programmed into the modem itself
  239. along with a name and password independent of the name or password
  240. on the actual system. These modems are getting less expensive all the time,
  241. and at this writing have just dropped below $500 retail at 1200 baud.
  242.  
  243. Physical Security
  244.  
  245. Contrary to the information given in the Tandy user's guide, it is not
  246. necessary to reinstall Xenix simply because you forget the root password.
  247. It is possible to reset the console, boot from a floppy,
  248. then clean and mount the primary hard disk as a subordinate file system.
  249. This completely goes around the password file on the hard disk,
  250. and it is possible for anyone with physical access to the console to do it.
  251. Once into the file system in single-user mode,
  252. the root password can be removed, or a backdoor can be installed.
  253. When the console is unattended, lock the door.
  254. Pretend that it is the box of money which it effectively is.
  255. The same applies to backup media, whether diskettes, tapes or Bernoulli
  256. cartridges.
  257. If someone with access to a similar system has access to your backups,
  258. that person can restore your data to the other system and read your secrets
  259. at his leisure.
  260. While the \bcrypt\r command in the development system will let you encode
  261. personal files so that they can only be read by someone with the correct key,
  262. most (all Tandy) application programs choke on encrypted files. Keep your
  263. backups under lock and key, preferably at another location, any time you're
  264. not actually backing up or restoring your data.
  265.  
  266. Tracking System Changes
  267.  
  268. The Tandy user's guide recommends
  269. that you do not modify the file \fB/etc/logbook\fR,
  270. so that their customer support folks
  271. can determine software versions and installation dates.
  272. I suggest adding to that file a mention of any changes made
  273. to system or application programs,
  274. files or directories,
  275. including permission changes such
  276. as that mentioned above to \fB/appl/pf/lib\fR.
  277. As long as you don't change the lines provided
  278. by the various software installation scripts,
  279. the folks at Tandy aren't likely to mind.
  280. It can actually help with troubleshooting on some occasions,
  281. as in the case where that \fBchmod\fR is done incorrectly,
  282. and Profile-16 refuses to operate properly as is likely to happen.
  283.  
  284. Before making any real changes to your system,
  285. make a hard copy of its condition before the operation,
  286. so that if necessary,
  287. it can at least be returned to stock condition.
  288.  
  289. For example:
  290.  
  291. .ft B
  292. .br
  293. # l /appl/pf | pr | lpr
  294. .br
  295. # chmod go-rwx /appl/pf/lib
  296. .br
  297. # l /appl/pf | pr | lpr
  298. .br
  299. .ft R
  300.  
  301. If afterward any function of Profile-16 doesn't work, the first printout can
  302. be used to change it back for another attempt.
  303.  
  304. Conclusion
  305.  
  306. No single article can cover all aspects of security on any one system, let
  307. alone an entire series of systems with each machine configured differently.
  308. Each application program installed can cause potential problems, Microsoft
  309. may have left back doors created by its own people (or not found and removed
  310. some created previously during the evolution of Unix), and I suspect that
  311. I might have missed a few on my system, though I keep experimenting from
  312. the point of view of someone wanting to lay waste to my data.
  313. I have plugged all of the gaps that I have found so far, but locks keep out
  314. honest people, and there may be an 11-year-old out there who has already
  315. found a way around everything I've done. I just keep a sharp eye out for
  316. anything suspicious. The power of the Xenix operating system is too valuable
  317. to abandon just because the very nature of its multi-user abilities implies
  318. a small factor of risk. The risks can be minimized. In terms of protecting
  319. data and files from prying eyes, administrators of MS-DOS networks using
  320. networks of IBM PC's and clones are the ones who really have their work cut
  321. out for them.
  322. ==============================================================================
  323.  
  324.