home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / computer-security / anonymous-ftp-faq next >
Text File  |  1997-02-03  |  28KB  |  795 lines

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!uhog.mit.edu!news.kei.com!news.texas.net!cdc2.cdc.net!news-out.internetmci.com!news.internetMCI.com!newsfeed.internetmci.com!uwm.edu!spool.mu.edu!howland.erols.net!news.mathworks.com!rill.news.pipex.net!pipex!uknet!usenet1.news.uk.psi.net!uknet!psinntp!psinntp!pubxfer.news.psi.net!iss.net!cklaus
  2. From: cklaus@iss.net (Christopher Klaus)
  3. Newsgroups: comp.security,alt.security,comp.security.misc,comp.security.unix,comp.unix.admin,comp.answers,alt.answers,news.answers,comp.sys.sun.admin,comp.sys.sgi.admin,comp.sys.next.admin
  4. Subject: computer-security/anonymous-ftp FAQ (HTML Version)
  5. Supersedes: <secfaq.p12_854689396@iss.net>
  6. Followup-To: poster
  7. Date: 31 Jan 1997 06:06:44 GMT
  8. Organization: ISS, Inc.
  9. Lines: 776
  10. Approved: news-answers-request@MIT.Edu
  11. Distribution: world
  12. Message-ID: <secfaq.p12_854690520@iss.net>
  13. Reply-To: cklaus@iss.net
  14. NNTP-Posting-Host: 204.241.60.147
  15. Keywords: security anonymous ftp
  16. Originator: cklaus@iss.net
  17. Xref: senator-bedfellow.mit.edu alt.security:42121 comp.security.misc:37824 comp.security.unix:35850 comp.unix.admin:60522 comp.answers:24082 alt.answers:23718 news.answers:93654 comp.sys.sun.admin:92673 comp.sys.sgi.admin:46526
  18.  
  19. Archive-name: computer-security/anonymous-ftp-faq
  20. Post-Frequency: monthly
  21. Last-modified: 1996/7/16
  22. Version: 3.0
  23.  
  24. <HEAD>
  25. <TITLE>Anonymous FTP FAQ</TITLE>
  26. </HEAD>
  27. <BODY>
  28. <H1>Anonymous FTP FAQ</h1>
  29. <i>Version: 3.00</i>
  30.  
  31. <hr>
  32. This Security FAQ is a resource provided by:
  33. <blockquote>
  34. <pre>
  35. Internet Security Systems, Inc.   
  36. Suite 660, 41 Perimeter Center East          Tel: (770) 395-0150
  37. Atlanta, Georgia 30346                       Fax: (770) 395-1972
  38. </pre>
  39. </blockquote>
  40. <hr>
  41. To get the newest updates of Security files check the following services:       
  42. <p>
  43. <blockquote>
  44. <a href = "http://www.iss.net/">
  45.         http://www.iss.net/</a>
  46. <br>    
  47. <a href = "ftp://ftp.iss.net/pub">
  48.         ftp ftp.iss.net /pub/ </a>
  49. <br>
  50. </blockquote>
  51. To subscibe to the update mailing list, Alert, send an e-mail to 
  52. <a href = mailto:request-alert@iss.net> request-alert@iss.net</a> and, in the text of your message
  53. (not the subject line), write:
  54. <blockquote>
  55.         subscribe alert
  56. </blockquote>
  57.  
  58. <hr>
  59.  
  60. <p>
  61. <h2>How to Set up a Secure Anonymous FTP Site
  62. </h2>
  63. <p>
  64.     The following is a FAQ on setting up a secure FTP Site.  FTP sites
  65. are known for much abuse by transferring illegal files.  They also open many
  66. oppurtunities for intruders to gain access via misconfigured setups.  And
  67. lastly many versions of ftp servers have had security holes.  This FAQ is
  68. intended to clean up this abuse by allowing administrators to go through this
  69. check list of steps to make sure their FTP is correctly configured and that
  70. they are running the most current ftp daemon.
  71. <p>
  72. This is organized in the following fashion, I am breaking into several parts
  73. as follows:
  74. <br>
  75. <ol>
  76. <li>
  77. <a href = "#general">
  78. General Description of Setting up an "Anonymous" FTP server.
  79. </a>
  80. <li>
  81. <a href = "#chroot">Setting up a chrooted Secure Anonymous FTP server.  
  82. </a>
  83. <li>
  84. <a href = "#os">
  85. OS Specific needed information and suggestions.
  86. <ul>
  87.  
  88. <li>
  89. <a href = "#att">
  90. Older SVR2 and SVR3 system,
  91. RTU 6.0 (Masscomp, now Concurrent Real Time UNIX),
  92. and AT&T 3B1 and 3B2 machines
  93. </a>
  94. <li> 
  95. <a href = "#hpux">
  96. HPUX
  97. </a>
  98. <li>
  99. <a href = "#sol">
  100. Solaris 2.x
  101. </a>
  102. <li>
  103. <a href = "#sun">
  104. SunOS 
  105. </a>
  106. </ul>
  107.  
  108.  
  109.  
  110. </a>
  111. <li>
  112. <a href = "#other">
  113. Where to get other FTP daemons
  114. </a>
  115. <li>
  116. <a href = "#secure">
  117. How to Know if your Anonymous FTP Server is Secure
  118. </a>
  119. <li>
  120. <a href = "#archie">
  121. Archie
  122. </a>
  123. </ol>
  124.  
  125. <hr size=5>
  126. <h3>
  127. <a name = "general">
  128. 1.  General Description of Setting up an "anonymous" ftp server.
  129. </a></h3>
  130.  
  131. <ol>
  132. <li> Create the user ftp in /etc/passwd.  Use a misc group.  The user's home
  133. directory will be ~ftp where ~ftp is the root you wish anonymous users to
  134. see.  Creating this user turns on anonymous ftp.
  135. <p>
  136. Use an invalid password and user shell for better security. The entry in the
  137. passwd file should look something like:
  138. <blockquote>
  139.     ftp:*:400:400:Anonymous FTP:/home/ftp:/bin/true
  140. </blockquote>
  141. <li> Create the home directory ~ftp.  Make the directory owned by root (NOT ftp)
  142. with the same group as ftp.  Thus, owner permissions are for root and group
  143. permissions are for the anonymous users.  Set the permissions for ~ftp to 555
  144. (read, nowrite, execute).
  145. <p>
  146.  
  147. <b>Warning:</b>
  148. Some MAN pages recommend making the ~ftp directory owned by ftp.
  149. This is a big NO-NO, if you want any type of security on your system.
  150. <p>
  151.  
  152. <li>Create the directory ~ftp/bin.  This directory is owned by root (group
  153. e.g. wheel) with permissions 111 (noread, nowrite, execute).
  154. <p>
  155. <li>Copy the program ls into ~ftp/bin.  ls is owned by root with permissions
  156. 111 (noread, nowrite, execute).  Any other commands you put in ~ftp/bin 
  157. should have the same permissions as well.
  158. <p>
  159. <li>  Make the directory ~ftp/etc.  This directory is owned by root with
  160. permissions 111.
  161. <p>
  162. <li>  Create from scratch the files /etc/passwd and /etc/group in ~ftp/etc.
  163. These files should be mode 444.  The passwd file should only contain root,
  164. daemon, uucp, and ftp.  The group file must contain ftp's group. Use your
  165. /etc/passwd and /etc/group files as a template for creating passwd and group
  166. files going to ~ftp/etc.  You may even change the user names in this file,
  167. they are used only for 'ls' command.  So for example if all files in your
  168. ~ftp/pub/linux hierarchy will be maintained by a real user 'balon' with
  169. uid=156 you may put 
  170. <blockquote>
  171. linux:*:156:120:Kazik Balon::
  172. </blockquote>
  173. in the ~ftp/etc/passwd file (regardless of his real username).  Leave only
  174. these users who will own files under ftp hierarchy (e.g. root, daemon,
  175. ftp...) and definitely remove *ALL* passwords by replacing them with '*' so
  176. the entry looks like:
  177. <blockquote>
  178. root:*:0:0:Ftp maintainer::
  179. <br>
  180. ftp:*:400:400: Anonymous ftp::
  181. </blockquote>
  182. For more security, you can just remove ~ftp/etc/passwd and
  183. ~ftp/etc/group (the effect is that ls -l will not show the directories' group
  184. names).  Wuarchive ftp daemon (and some others) have some extensions based on
  185. the contents of the group/passwd files, so read the appropriate documentation.
  186. <p>
  187. <li>  Make the directory ~ftp/pub.  This directory is owned by you and has the
  188. same group as ftp with permissions 555.  On most systems (like SunOS) you may
  189. want to make this directory 2555, ie. set-group-id, in order to create new
  190. files with the same group ownership.
  191. <p>
  192.  
  193. Files are left here for public distribution. All folders inside ~ftp/pub
  194. should have the same permissions as 555.
  195. <p>
  196. <b>Warning: </b>
  197. Neither the home directory (~ftp) nor any directory below it should be
  198. owned by ftp!  No files should be owned by ftp either.  Modern ftp daemons
  199. support all kinds of useful commands, such as chmod, that allow outsiders to
  200. undo your careful permission settings.  They also have configuration options
  201. like the following (WuFTP) to disable them:
  202. <pre>
  203. # all the following default to "yes" for everybody
  204. delete          no      guest,anonymous         # delete permission?
  205. overwrite       no      guest,anonymous         # overwrite permission?
  206. rename          no      guest,anonymous         # rename permission?
  207. chmod           no      anonymous               # chmod permission?
  208. umask           no      anonymous               # umask permission?
  209. </pre>
  210. <p>
  211. <li> If you wish to have a place for anonymous users to leave files, create
  212. the directory ~ftp/pub/incoming.  This directory is owned  by root with
  213. permissions 733.  Do a 'chmod +t ~ftp/pub/incoming'.  The ftp daemon will
  214. normally not allow an anonymous user to overwrite an existing file, but a
  215. normal user of the system would be able to delete anything.  By setting the
  216. mode to '1733' you prevent this from happening.  In wuftpd you may configure
  217. the daemon to create new files with permissions '600' owned by root or any
  218. other user.  Many  times, incoming directories are abused by exchanging pirated
  219. and pornographic material.  Abusers often create hidden directories there for
  220. this purpose.  Making the incoming directory unreadable by anonymous ftp helps
  221. to some extent.  With ordinary ftp severs there is no way to prevent
  222. directories being created in incoming. The WUarchive ftp server can limit
  223. uploads to certain directories and can restrict characters used in file names
  224. like this:
  225. <pre>
  226. # specify the upload directory information
  227. upload  /var/spool/ftp  *       no
  228. upload  /var/spool/ftp  /incoming       yes     ftp     staff   0600    nodirs
  229.  
  230. # path filters                                                                                  # path-filter...
  231. path-filter  anonymous  /etc/msgs/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-
  232. path-filter  guest      /etc/msgs/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-
  233. </pre>
  234. <p>
  235. Suggestion: Create an extra file-system for your ftp-area (or at least for
  236. your incoming-area) to prevent a denial-of-service attack by filling your
  237. disk with garbage (inside your incoming directory).
  238. <p>
  239. If you have wuftpd you may want to add some ftp extensions like
  240. compression/decompression 'on the fly' or creation of tar files for the
  241. directory hierarchies.  Get the appropriate sources (gzip, gnutar, compress),
  242. compile them and link statically, put in the ~ftp/bin directory and edit the
  243. appropriate file containing the definitions of the allowed conversions.
  244. /usr/bin/tar is already statically-linked.  You may wish to use gnu tar
  245. anyway.
  246. <p>
  247. Gary Mills wrote a small program to support the following:
  248. <p>
  249. To do tar and compress, he wrote a tiny program called `pipe', and
  250. statically-linked it. His /etc/ftpconversions file looks like this:
  251. <pre>
  252. #strip prefix:strip postfix:addon prefix:addon postfix:external command:
  253. #types:options:description
  254. :.Z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
  255. :-z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
  256. :  :  :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
  257. :  :  :.tar:/bin/tar cf - %s:T_REG|T_DIR:O_TAR:TAR
  258. :  :  :.tar.Z:/bin/pipe /bin/tar cf - %s | /bin/compress -c:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
  259. :  :  :.tar:/bin/gtar -c -f - %s:T_REG|T_DIR:O_TAR:TAR
  260. :  :  :.tar.Z:/bin/gtar -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
  261. :  :  :.tar.gz:/bin/gtar -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP
  262. </pre>
  263. Here it is: <p>
  264. -----------------8<-------------cut---------------
  265. <pre>
  266. /* pipe.c: exec two commands in a pipe */
  267.  
  268. #define NULL (char *)0
  269. #define MAXA 16
  270.  
  271. main(argc, argv) int argc; char *argv[]; {
  272. char *av1[MAXA], *av2[MAXA];
  273. int i, n, p[2], cpid;                                                       
  274.  
  275. i = 0; n = 0;
  276. while ( ++i < argc && n < MAXA ) {
  277. if ( *argv[i] == '|' && *(argv[i]+1) == '\0' ) break;
  278. av1[n++] = argv[i];
  279. }
  280. if ( n == 0 ) uexit();
  281. av1[n] = NULL;
  282. n = 0;
  283. while ( ++i < argc && n < MAXA )
  284. av2[n++] = argv[i];
  285. if ( n == 0 ) uexit();
  286. av2[n] = NULL;
  287. if ( pipe(p) != 0 ) exit(1);
  288. if ( ( cpid = fork() ) == (-1) ) exit(1);
  289. else if ( cpid == 0 ) {
  290. (void)close(p[0]);
  291. (void)close(1);
  292. (void)dup(p[1]);
  293. (void)close(p[1]);
  294. (void)execv(av1[0], av1);
  295. _exit(127);
  296. }
  297. else {
  298. (void)close(p[1]);
  299. (void)close(0);
  300. (void)dup(p[0]);
  301. (void)close(p[0]);
  302. (void)execv(av2[0], av2);
  303. _exit(127);                                                             
  304. }
  305. /*NOTREACHED*/
  306. }
  307. uexit() {
  308. (void)write(2, "Usage: pipe <command> | <command>\n", 34);
  309. exit(1);
  310. }
  311. </pre>
  312. -------- CUT HERE ------------
  313.  
  314. <p>
  315. <li> Other things to do:
  316. <p>
  317. as root:
  318.  
  319. <blockquote>
  320. touch ~ftp/.rhosts
  321. <br>
  322. touch ~ftp/.forward
  323. <br>
  324.      chmod 400 ~ftp/.rhosts
  325. <br>
  326. chmod 400 ~ftp/.forward
  327. </blockquote>
  328.  
  329. ie. make these files zero-length and owned by root.
  330. <p>
  331. Due to the last /bin/mail bugs in SunOS:
  332.  
  333. <blockquote>
  334. touch /usr/spool/mail/ftp; chmod 400 /usr/spool/mail/ftp
  335. </blockquote>
  336.  
  337. Consider an email-alias for the ftp-admin(s) to provide an email-address for
  338. problems-reports.
  339. <p>
  340. If you are mounting some disks from other machines (or even your own) to the
  341. ~ftp hierarchy, mount it read-only. The correct entry for the /etc/fstab (on
  342. the host with ftpd) is something like:
  343. <blockquote>
  344. other:/u1/linux /home/ftp/pub/linux nfs ro,noquota,nosuid,intr,bg 1 0
  345. </blockquote>
  346. This mounts under /home/ftp/pub/linux the disk from host 'other' with no     
  347. quota, no 'suid' programs (just in case), interruptible (in case 'other' 
  348. goes down) and 'bg' - so if 'other' is down when you reboot it will not stop
  349. you trying to mount /home/ftp/pub/linux all over again.                      
  350.  
  351.  
  352. </ol>
  353. <hr size=5>
  354. <h3>
  355. <a name = "chroot">
  356. 2. Setting up a chrooted Secure Anonymous ftp server.
  357. </a></h2>
  358. This part was contributed by Marcus J Ranum <mjr@tis.com>
  359.  
  360. <ol>
  361. <li>Build a statically linked version of ftpd and put it in ~ftp/bin.
  362. Make sure it's owned by root.
  363. <p><li>
  364.  
  365. Build a statically linked version of /bin/ls if you'll need one.
  366. Put it in ~ftp/bin. If you are on a Sun, and need to build
  367. one, there's a ported version of the BSD net2 ls command
  368. for SunOs on ftp.tis.com: pub/firewalls/toolkit/patches/ls.tar.Z
  369. Make sure it's owned by root.
  370. <p>
  371. <li> Chown ~ftp to root and make it mode 755     THIS IS VERY IMPORTANT
  372. <p>
  373. <li> Set up copies of ~ftp/etc/passwd and ~ftp/etc/group just as you would                  normally, EXCEPT make 'ftp's home directory '/'   -- make sure
  374. they are owned by root.
  375. <p>
  376. <li> Write a wrapper to kick ftpd off and install it in /etc/inetd.conf
  377. The wrapper should look something like: (assuming ~ftp = /var/ftp)
  378. <pre>
  379. main()
  380. {
  381. if(chdir("/var/ftp")) {
  382.     perror("chdir /var/ftp");
  383.     exit(1);
  384. }
  385. if(chroot("/var/ftp")) {
  386.     perror("chroot /var/ftp");
  387.     exit(1);
  388. }
  389. /* optional: seteuid(FTPUID); */
  390. execl("/bin/ftpd","ftpd","-l",(char *)0);
  391. perror("exec /bin/ftpd");
  392. exit(1);
  393. }
  394. </pre>
  395.  
  396. Options:
  397. <p>
  398. You can use 'netacl' from the toolkit or tcp_wrappers to achieve
  399. the same effect.
  400. <p>
  401.  
  402. We use 'netacl' to switch so that a few machines that connect to
  403. the FTP service *don't* get chrooted first. This makes transferring
  404. files a bit less painful.
  405. <p>
  406. You may also wish to take your ftpd sources and find all the places
  407. where it calls seteuid() and remove them, then have the wrapper do
  408. a setuid(ftp) right before the exec. This means that if someone
  409. knows a hole that makes them "root" they still won't be. Relax and
  410. imagine how frustrated they will be.
  411. <p>
  412. If you're hacking ftpd sources, I suggest you turn off a bunch of
  413. the options in ftpcmd.y by unsetting the "implemented" flag in
  414. ftpcmd.y. This is only practical if your FTP area is read-only.
  415. <p><li>
  416. As usual, make a pass through the FTP area and make sure that the files
  417. are in correct modes and that there's nothing else in there that
  418. can be executed.
  419. <p>
  420. <li>
  421. Note, now, that your FTP area's /etc/passwd is totally separated from
  422. your real /etc/passwd. This has advantages and disadvantages.
  423. <p>
  424. <li> Some stuff may break, like syslog, since there is no /dev/log. Either
  425. build a version of ftpd with a UDP-based syslog() routine or
  426. run a second syslogd based on the BSD Net2 code, that maintains
  427. a unix-domain socket named ~ftp/dev/log with the -p flag.
  428. <p>
  429. REMEMBER:
  430. <p>
  431. If there is a hole in your ftpd that lets someone get "root"
  432. access they can do you some damage even chrooted. It's just
  433. lots harder. If you're willing to hack some code, making the
  434. ftpd run without permissions is a really good thing. The
  435. correct operation of your hacked ftpd can be verified by
  436. connecting to it and (while it's still at the user prompt)
  437. do a ps-axu and verify that it's not running as root.                     
  438. </ol>
  439. <hr size=5>
  440. <h3>
  441. <a name = "os">
  442. 3. OS Specific needed information and suggestions.
  443. </a></h3>
  444. These machines may need dev/tcp:
  445. <ul>
  446. <a name = "att">
  447. <li>Older SVR2 and SVR3 system
  448. <li> RTU 6.0 (Masscomp, now Concurrent Real Time UNIX),
  449. <li>AT&T 3B1 and 3B2 machines
  450. <p>
  451. </ul>
  452. <h4>
  453. [dev/tcp]
  454. </h4>
  455. These ftpd implementations may require a ~ftp/dev/tcp in order for anonymous
  456. ftp to work.  
  457. <p>
  458. You have to create a character special device with the appropriate major and
  459. minor device numbers. The appropriate major and minor numbers of ~ftp/dev/tcp
  460. are what the major and minor numbers of /dev/tcp are.
  461. <p>
  462. The ~ftp/dev is a directory and ~ftp/dev/tcp is a character special device. 
  463. Make them owned and grouped by root. Permissions for ~ftp/dev is root
  464. read/write/exec and other & group read and exec. The permissions for
  465. ~ftp/dev/tcp is root read/write, other & group read.
  466. <p>
  467.  
  468. <h4>
  469. <a name = "hpux">
  470. HPUX
  471. </h4>
  472.  
  473. <i>[Logging]
  474. </i>
  475. If you're using HP's native ftpd, the line in /etc/inetd.conf
  476. should execute ftpd -l, which does extra logging.
  477.  
  478. <h4>
  479. <a name = "sol"> Solaris 2.x
  480. </h4>
  481. <i>[Script]
  482. </i> Solaris' man page contains a script for installing anonymous ftpd
  483. which saves time.  You may still want to check over your anonymous ftpd
  484. for vulnerabilities.
  485.  
  486. <p>
  487. Command for reading the man page is:
  488. <blockquote>
  489. $ man ftpd
  490. </blockquote>
  491.  
  492.  
  493. <h4>
  494. <a name = "sun">
  495. SunOS
  496. </h4>
  497.  
  498. <i>[Libraries]
  499. </i>
  500. To set up SunOS to use its shared dynamic libraries, follow these
  501. steps:
  502.  
  503. <ol>
  504. <li> Create the directory ~ftp/usr.  This directory is owned by root with
  505. permissions 555.
  506. <p>
  507. <li>
  508. Create the directory ~ftp/usr/lib.  This directory is owned by root with
  509. permissions 555. 
  510. <p>
  511. <li>
  512.  
  513.  Copy the runtime loader ld.so into ~ftp/usr/lib for use by ls.  ld.so is
  514. owned by root with permissions 555. 
  515. <p>
  516. <li>
  517.  
  518.  Copy the latest version of the shared C library, libc.so.* into
  519. ~ftp/usr/lib for use by ls.  
  520. <p>
  521. libc.so.* is owned by root with permissions 555.
  522. <p>
  523.  
  524. Note:
  525. 4.1.2(or above) users: you also need to copy  /usr/lib/libdl.so.* to
  526. ~ftp/lib.
  527. <p><li>
  528.  
  529.  Create the directory ~ftp/dev.  This directory is owned by root with
  530. permissions 111.
  531.  
  532. <p><li>
  533.  ~ftp/dev/zero is needed by the runtime loader.  Move into the directory
  534. ~ftp/dev and create it with the command: 
  535. <blockquote>
  536.     mknod zero c 3 12
  537. </blockquote>
  538. chown ~ftp/dev/zero to root.  Make sure it's readable.
  539. <p>
  540. Warning:
  541. For novices: Don't try to copy /dev/zero to ~ftp/dev/zero!
  542. This is an endless file of zeroes and it will completely fill your filesystem!
  543.  
  544. <p><li>
  545.  
  546.  If you want to have the local time showing when people connect, create the
  547. directory ~ftp/usr/share/lib/zoneinfo and copy
  548. /usr/share/lib/zoneinfo/localtime
  549.  
  550. <p><li>
  551.  If you are bothered by the need for copying your libraries so that you can
  552. use Sun's 'ls', which is dynamically linked, you can try to get a statically
  553. linked copy of 'ls' instead.  The CD-ROM that contains Sun's OS has a
  554. statically-linked version of ls.  In this case, you can dispense with steps
  555. #6-8.
  556. <p>
  557. Statically linked versions may be available from the following sources:
  558. <p>
  559.     If you want a statically linked "ls" get the GNU fileutils off a
  560. archive site near you and statically link it. 
  561. <p> <i>
  562. [Logging]</i> Sun's standard ftpd logs *all* password information.  To correct it,
  563. install patch:
  564. <pre>
  565. 101640-03       SunOS 4.1.3: in.ftpd logs password info when -d option is
  566. used.   
  567. </pre>
  568. In /etc/inetd.conf find the line that starts with "ftp".  At the
  569. end of that line, it should read "in.ftpd".  Change that to "in.ftpd -dl". 
  570. In /etc/syslog.conf, add a line that looks like:              
  571. <pre>                       
  572. daemon.*                               /var/adm/daemonlog
  573. </pre>
  574.  
  575. The information can be separated (or like SunOs4.1.1 does not recognize
  576. daemon.* so it requires the following form), such as:
  577. <pre>
  578. daemon.info                                    /var/adm/daemon.info
  579. daemon.debug                                   /var/adm/daemon.debug
  580. daemon.err                                     /var/adm/daemon.err
  581. </pre>
  582.  
  583. Note that the whitespace between the two columns must include at least one
  584. TAB character, not just spaces, or it won't work.  Of course your log file
  585. could be anything you want.  Then, create the logfile (touch
  586. /var/adm/daemonlog should do).  Finally, restart inetd and syslogd, either
  587. individually, or by rebooting the system.  You should be good to go.  If you
  588. do not install the patch, make sure the log file is owned by root and mode
  589. 600, as the ftp daemon will log *everything*, including users' passwords.
  590. <p>
  591. Warning:
  592.  
  593. You want to make all logs root only readable for security reasons
  594. If a user mistypes his password for his username, it could be compromised
  595. if anyone can read the log files.
  596.  
  597. </ol>
  598. <hr size=5>
  599. <h3>
  600. <a name = "other">
  601. 4. Where to get other FTP daemons
  602. </a></h3>
  603.  
  604. <ul>
  605. <li>
  606. Wuarchive FTP 2.4- A secure FTP daemon that allows improved access-control,
  607. logging, pre-login banners, and is very configurable: 
  608. <p>
  609.     Can be ftp'd from ftp.uu.net in "/networking/ftp/wuarchive-ftpd"
  610. directory.  Be certain to verify the checksum information to confirm that you
  611. have retrieved a valid copy. [Warning: Older versions of Wu-FTP are extremely
  612. insecure and in some cases have been trojaned.]
  613. <pre>
  614.                         BSD        SVR4         
  615.      File               Checksum   Checksum    MD5 Digital Signature
  616.      -----------------  --------   ---------   --------------------------------
  617.      wu-ftpd-2.4.tar.Z  38213  181  20337 362  cdcb237b71082fa23706429134d8c32e
  618.      patch_2.3-2.4.Z    09291    8  51092  16  5558a04d9da7cdb1113b158aff89be8f
  619. </pre>
  620. <li>
  621.      For DECWRL ftpd, sites can obtain version 5.93 via anonymous FTP
  622.      from gatekeeper.dec.com in the "/pub/misc/vixie" directory.
  623.  
  624. <pre>
  625.                         BSD        SVR4         
  626.      File               Checksum   Checksum    MD5 Digital Signature
  627.      -----------------  --------   --------- --------------------------------
  628.      ftpd.tar.gz        38443  60  1710 119  ae624eb607b4ee90e318b857e6573500
  629. </pre>
  630. <li>
  631.      For BSDI systems, patch 005 should be applied to version 1.1 of
  632.      the BSD/386 software.  You can obtain the patch file via
  633.      anonymous FTP from ftp.bsdi.com in the "/bsdi/patches-1.1"
  634.      directory.
  635.  
  636. <pre>
  637.                         BSD        SVR4         
  638.      File               Checksum   Checksum    MD5 Digital Signature
  639.      -----------------  --------   ---------   --------------------------------
  640.      BU110-005          35337 272  54935 543   1f454d4d9d3e1397d1eff0432bd383cf
  641.  
  642. </pre><li>
  643. Public Domain Sources:
  644. <p>
  645. <blockquote>
  646.    ftp.uu.net            ~ftp/systems/unix/bsd-sources/libexec/ftpd
  647. <br>
  648.    gatekeeper.dec.com    ~ftp/pub/DEC/gwtools/ftpd.tar.Z
  649. </blockquote>
  650. </ul>
  651. <hr size=5>
  652. <h3>
  653. <a name = "secure">
  654. 5. How to Know if your Anonymous FTP Server is Secure
  655. </a></h3>
  656.  
  657. This section is intended for the administrator to go down a small check 
  658. list of things to make sure his server is not easily compromised.
  659. <ol>
  660. <li>
  661.  Check to make sure your ftp server does not have SITE EXEC command by
  662. telneting to port 21 and typing SITE EXEC.  If your ftp daemon has SITE EXEC
  663. make sure it is the most current version (ie, Wu-FTP 2.4).  In older versions
  664. this allows anyone to gain shell via port 21.
  665. <p>
  666. <li>   Check to make sure no one can log in and make files or directories in the
  667. main directory.  If anyone can log in as anonymous FTP and make files such as
  668. .rhosts and .forward, instant access is granted to any intruder. 
  669. <p><li>
  670.  Check to make sure the main directory is NOT owned by ftp.  If it is
  671. owned by FTP, an intruder could SITE CHMOD 777 the main directory and then
  672. plant files to give him instant access.  SITE CHMOD command should be removed
  673. because anonymous users do not need any extra priviledges.
  674. <p><li>
  675.   Check to make sure NO files or directories are owned by ftp. If they are,
  676. it is possible an intruder could replace them with his own trojan versions. 
  677. <p><li>
  678.   There were several bugs in old daemons, so it is very important to make
  679. sure you are running the most current ftp daemons. 
  680.  
  681. </ul>
  682.  
  683. <hr size=5>
  684. <h3>
  685. <a name = "archie">
  686. 6. Archie
  687. </a></h3>
  688.  
  689. Searches FTP sites for programs.  Login into these sites as archie
  690. or use client software for faster access.  To get your own anonymous
  691. site added to Archie's search list, e-mail <a href=mailto:archie-updates@bunyip.com>archie-updates@bunyip.com.</a>
  692. <pre>
  693.     archie.ac.il               132.65.20.254    (Israel server)
  694.     archie.ans.net             147.225.1.10     (ANS server, NY (USA))
  695.     archie.au                  139.130.4.6      (Australian Server)
  696.     archie.doc.ic.ac.uk        146.169.11.3     (United Kingdom Server)
  697.     archie.edvz.uni-linz.ac.at 140.78.3.8       (Austrian Server)
  698.     archie.funet.fi            128.214.6.102    (Finnish Server)
  699.     archie.internic.net        198.49.45.10     (AT&T server, NY (USA))
  700.     archie.kr                  128.134.1.1      (Korean Server)
  701.     archie.kuis.kyoto-u.ac.jp  130.54.20.1      (Japanese Server)
  702.     archie.luth.se             130.240.18.4     (Swedish Server)
  703.     archie.ncu.edu.tw          140.115.19.24    (Taiwanese server)
  704.     archie.nz                  130.195.9.4      (New Zealand server)
  705.     archie.rediris.es          130.206.1.2      (Spanish Server)
  706.     archie.rutgers.edu         128.6.18.15      (Rutgers University (USA))
  707.     archie.sogang.ac.kr        163.239.1.11     (Korean Server)
  708.     archie.sura.net            128.167.254.195  (SURAnet server MD (USA))
  709.     archie.sura.net(1526)      128.167.254.195  (SURAnet alt. MD (USA))
  710.     archie.switch.ch           130.59.1.40      (Swiss Server)
  711.     archie.th-darmstadt.de     130.83.22.60     (German Server)
  712.     archie.unipi.it            131.114.21.10    (Italian Server)
  713.     archie.univie.ac.at        131.130.1.23     (Austrian Server)
  714.     archie.unl.edu             129.93.1.14      (U. of Nebraska, Lincoln (USA))
  715.     archie.univ-rennes1.fr                      (French Server)
  716.     archie.uqam.ca             132.208.250.10   (Canadian Server)
  717.     archie.wide.ad.jp          133.4.3.6        (Japanese Server)
  718. </pre>
  719.  
  720. <hr size=5>
  721. <h3>
  722. Acknowledgements
  723. </h3>
  724.  
  725. Thanks to the following people for suggestions that help shape this FAQ:
  726. <pre>
  727. Tomasz Surmacz (tsurmacz@asic.ict.pwr.wroc.pl)
  728. Russel Street (russells@ccu1.auckland.ac.nz) 
  729. Gary Mills (mills@CC.UManitoba.CA) 
  730. Mirsad Todorovac (mirsad.todorovac@etf.hr)
  731. Nicholas Ironmonger (ndi@sam.math.ethz.ch)
  732. Morten Welinder (terra@diku.dk) 
  733. Nick Christenson (npc@minotaur.jpl.nasa.gov) 
  734. Marcus J Ranum <mjr@tis.com>
  735. </pre>
  736.  
  737. <hr>
  738. <copyright>
  739. <h3>Copyright</h3>
  740.  
  741. <pre>
  742. This paper is Copyright (c) 1994, 1995, 1996
  743.    by Christopher Klaus of Internet Security Systems, Inc. 
  744. </pre>
  745. <p>
  746. Permission is hereby granted to give away free copies electronically.  You may
  747. distribute, transfer, or spread this paper electronically.  You may not 
  748. pretend that you wrote it.  This copyright notice must be maintained in any
  749. copy made.  If you wish to reprint the whole or any part of this paper in any
  750. other medium excluding electronic medium, please ask the author for permission.
  751. </copyright>
  752.  
  753. <h3>Disclaimer</h3>
  754. <p>
  755.     The information within this paper may change without notice. Use of
  756. this information constitutes acceptance for use in an AS IS condition.
  757. There are NO warranties with regard to this information. In no event shall
  758. the author be liable for any damages whatsoever arising out of or in
  759. connection with the use or spread of this information.  Any use of this
  760. information is at the user's own risk.
  761. </p>
  762.  
  763. <h3>Address of Author</h3>
  764.  
  765. <p>
  766. Please send suggestions, updates, and comments to:    
  767. <address>
  768. Christopher Klaus 
  769. <a href=mailto:cklaus@iss.net><cklaus@iss.net></a>
  770. of Internet Security Systems, Inc. 
  771. <a href=mailto:iss@iss.net><iss@iss.net></a>
  772. </address>
  773.  
  774. </PRE>
  775. </BODY>
  776. <p>
  777. <h3>Internet Security Systems, Inc. </h3>
  778. ISS is the leader in network security tools and technology through 
  779. innovative audit, correction, and monitoring software. The Atlanta-based 
  780. company's flagship product, Internet Scanner, is the leading commercial 
  781. attack simulation and security audit tool. The Internet Scanner 
  782. SAFEsuite is based upon ISS' award-winning Internet Scanner and was 
  783. specifically designed with expanded capabilities to assess a variety of 
  784. network security issues confronting web sites, firewalls, servers and 
  785. workstations. The Internet Scanner SAFEsuite is the most comprehensive 
  786. security assessment tool available.  For more information about ISS or 
  787. its products, contact the company at (770) 395-0150 or e-mail at 
  788. iss@iss.net. ISS maintains a Home Page on the World Wide Web at 
  789. http://www.iss.net
  790. -- 
  791. Christopher William Klaus            Voice: (770)395-0150. Fax: (770)395-1972
  792. Internet Security Systems, Inc.              "Internet Scanner SAFEsuite finds
  793. Ste. 660,41 Perimeter Center East,Atlanta,GA 30346 your network security holes
  794. Web: http://www.iss.net/  Email: cklaus@iss.net        before the hackers do."
  795.