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

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT(sm) Advisory CA-95:14
  6. Original issue date: November 1, 1995
  7. Last revised: August 30, 1996
  8.               Information previously in the README was inserted
  9.               into the advisory.
  10.  
  11.               A complete revision history is at the end of this file.
  12.                     
  13. Topic: Telnetd Environment Vulnerability
  14. - -----------------------------------------------------------------------------
  15.  
  16. The CERT Coordination Center has been made aware of a vulnerability with
  17. some telnet daemons. The daemons affected are those that support RFC 1408
  18. or RFC 1572, both titled "Telnet Environment Option," running on systems
  19. that also support shared object libraries.
  20.  
  21. To determine if your system is potentially vulnerable, refer to the
  22. information we have received from vendors which is summarized in Section III
  23. below; details are in Appendix A. Note that if you installed a version of
  24. David Borman's telnet package that is older than October 23, 1995, your system
  25. may be vulnerable even though it was not vulnerable as distributed by the
  26. vendor.
  27.  
  28. If your vendor is not listed, you will need to determine if your system
  29. may be vulnerable. First, determine if your telnet daemon is RFC 1408/1572
  30. compliant. One indication that it is compliant is if your telnet(1)
  31. program supports the "environ" command or your telnetd(8) program supports
  32. the ENVIRON or NEW-ENVIRON options. Unless you are certain that your
  33. telnet daemon is not RFC 1408/1572 compliant, you may wish to assume it is
  34. to be safe. Second, determine if your system supports shared libraries. To
  35. do this, consult the ld(1) manual page. If it describes dynamic or shared
  36. objects, your system probably supports shared object libraries. A system
  37. is potentially vulnerable if the telnet daemon supports RFC 1408/RFC 1572
  38. and the system supports shared object libraries.
  39.  
  40. We recommend that you follow your vendor's directions for addressing this
  41. vulnerability. Until you can install a patch, we recommend using the
  42. workaround in Appendix B below. If you have previously installed David
  43. Borman's telnet package on your system, we recommend that you obtain the
  44. current version of telnet (see Section III.C).
  45.  
  46. We will update this advisory as we receive additional information.
  47. Please check advisory files regularly for updates that relate to your site.
  48.  
  49. - -----------------------------------------------------------------------------
  50.  
  51. I.   Description
  52.  
  53.      Some telnet daemons support RFC 1408 or RFC 1572, both titled "Telnet
  54.      Environment Option." This extension to telnet provides the ability
  55.      to transfer environment variables from one system to another. If
  56.      the remote or targeted system, the one to which the telnet is
  57.      connecting, is running an RFC 1408/RFC 1572-compliant telnet daemon
  58.      *and* the targeted system also supports shared object libraries, then
  59.      it may be possible to transfer environment variables that influence
  60.      the login program called by the telnet daemon. By influencing that
  61.      targeted system, a user may be able to bypass the normal login and
  62.      authentication scheme and may become root on that system.
  63.  
  64.      Users with accounts on the targeted system can exploit this
  65.      vulnerability. Users without accounts on that system can also
  66.      exploit this vulnerability if they are first able to deposit an
  67.      altered shared object library onto the targeted system. Therefore, a
  68.      system may be vulnerable to users with and without local accounts.
  69.  
  70.      Not all systems that run an RFC 1408/RFC 1572-compliant telnet daemon
  71.      and support shared object libraries are vulnerable. Some vendors have
  72.      changed the trust model such that environment variables provided by
  73.      the telnet daemon are not trusted and therefore are not used by the
  74.      login program. Section III contains a summary of information vendors
  75.      have reported as of the date of this advisory.
  76.  
  77. II.  Impact
  78.  
  79.      Local and remote users can become root on the targeted system.
  80.  
  81. III. Solution
  82.  
  83.      The general solution to this problem is to replace the telnet daemon 
  84.      with one that changes the environment given to the login program. We
  85.      recommend that you install a patch from your vendor if possible. If this
  86.      is not possible, we recommend using the workaround in Appendix B until 
  87.      you can install a patch. Finally, if you have previously installed Mr.
  88.      Borman's telnet package, see Section C for how to get a new version that
  89.      fixes the vulnerability. 
  90.  
  91.      A. Vendor Patches
  92.  
  93.         Below is a summary of the vendors listed in Appendix A of this
  94.         advisory. More complete information, including how to obtain patches,
  95.         is provided in the appendix. We will update the appendix as we receive
  96.         more information from vendors.
  97.  
  98.         If your vendor's name is not on this list, please contact the
  99.         vendor directly.
  100.  
  101.         REMINDER: If you installed a version of David Borman's telnet package
  102.                   that is older than October 23, 1995, your system may be
  103.                   vulnerable even though it was not vulnerable as distributed 
  104.                   by the vendor.
  105.  
  106.         Vendor or Source               
  107.         ----------------               
  108.         Apple Computer                 
  109.         Berkeley Software Design       
  110.         Cray Research                  
  111.         CYGNUS                         
  112.         Data General                   
  113.         Digital Equipment              
  114.         FreeBSD                        
  115.         Harris                         
  116.         Hewlett-Packard
  117.         IBM Corp.                
  118.         Linux                          
  119.         MIT-distributed for Athena     
  120.         NEC                            
  121.         NetBSD                         
  122.         Open Software Foundation       
  123.         OpenVision                     
  124.         SCO                            
  125.         SGI                            
  126.         Sony Corp.                     
  127.  
  128.      B. Workaround
  129.  
  130.         Until you can install a patch from your vendor, you can use
  131.         the workaround provided in Appendix B.
  132.  
  133.      C. If you have installed a previous version of Mr. Borman's
  134.         telnet package, note that he has fixed this problem in
  135.         the version available at the following location:
  136.  
  137.                 ftp://ftp.cray.com/src/telnet/telnet.95.10.23.NE.tar.Z
  138.  
  139.                 MD5 checksum 2e14879a5b0aa6dd855a17fa8a3086cf
  140.         
  141.  
  142. ..............................................................................
  143.  
  144. Appendix A: Vendor Information
  145.  
  146. Below is information we have received from vendors. If you do not see your
  147. vendor's name below, contact the vendor directly for information.
  148.  
  149. Apple Computer, Inc.
  150. - --------------------
  151. Apple's A/UX is not vulnerable.
  152.  
  153.  
  154. Berkeley Software Design, Inc.
  155. - -----------------------------
  156. BSDI's BSD/OS is not vulnerable.
  157.  
  158.  
  159. Cray Research, Inc.
  160. - -------------------
  161. Cray's UNICOS is not vulnerable.
  162.  
  163.  
  164. CYGNUS Network Security V4 Free Network Release
  165. - ----------------------------------------------------
  166. cns-95q1 is vulnerable.   cns-95q4 is not vulnerable.
  167.  
  168. Customers can use the following URL to obtain the patch:
  169.  
  170.         http://www.cygnus.com/data/cns/telnetdpatch.html 
  171.  
  172. If customers are unable to obtain the patch in this manner
  173. or have any questions, send e-mail to kerbask@cygnus.com/
  174.  
  175. Note that while the URL and patch are already available, there
  176. is no link to the page yet.  We will add a link once the
  177. announcement has been made.
  178.  
  179.  
  180. Data General Corporation
  181. - ------------------------
  182. Data General believes the DG/UX operating system to be
  183. NOT vulnerable to this problem.  This includes all supported
  184. releases, DG/UX 5.4 Release 3.00, DG/UX 5.4 Release 3.10,
  185. DG/UX Release 4.10 and all related Trusted DG/UX releases. 
  186.  
  187. Specifically, telnetd shipped in DG/UX does not support
  188. environment options and does not support RFC 1572.
  189.  
  190.  
  191. Digital Equipment Corporation
  192. - -----------------------------
  193. Digital's OSF/1: vulnerable
  194. Digital's ULTRIX: not vulnerable
  195.  
  196. Digital has corrected this potential vulnerability. Patches containing
  197. new images for Digital's OSF/1 platforms are being provided to your 
  198. normal Digital Support channels beginning October 31 (U.S. time). The
  199. kits may be identified as ECO SSRT0367 (telnetd) for DEC OSF/1  V2.0
  200. thru V3.2c
  201.  
  202. This potential vulnerability is not present on Digital's ULTRIX systems. 
  203.  
  204. Digital distribution of this announcement will be via AES services  (DIA,
  205. DSNlink FLASH etc.). Digital Equipment Corporation strongly urges Customers
  206. to upgrade to a minimum of DEC OSF/1 V3.0, then apply this patch.
  207.  
  208.  
  209. FreeBSD
  210. - -------
  211. Vulnerable.  A patch has been applied to the current development FreeBSD
  212. source tree which is not yet released.  This patch is slightly modified
  213. compared to posted one, i.e. only variables which affects FreeBSD are
  214. disabled. It is telnetd patch, not a login wrapper.
  215.  
  216. For the official patch, location please contact: 
  217.  
  218. Jordan Hubbard <jkh@FreeBSD.org>
  219.  
  220.  
  221. Harris
  222. - ------
  223. Harris Computer Systems Corporation's Night Hawk is not vulnerable.
  224.  
  225.  
  226. Hewlett-Packard Company
  227. - -----------------------
  228. HP/UX is not vulnerable.
  229.  
  230.  
  231. IBM Corporation
  232. - ---------------
  233. AIX is not vulnerable to this attack.
  234.  
  235.  
  236. Linux (freely available software; not a vendor)
  237. - -----
  238. Debian GNU/Linux (From "Peter Tobias" <tobias@et-inf.fho-emden.de>):
  239. The current version of the Debian GNU/Linux distribution (released 10/27/95)
  240. is not vulnerable anymore. All Debian Installations that use a netstd
  241. package version prior to v1.21-1 are vulnerable (telnetd is part of
  242. the netstd package). netstd-1.21-1 and above are ok.
  243.  
  244. Patches are available. Peter fixed the bug last week and uploaded the
  245. fixed version to our ftp site (ftp.debian.org). Binaries, sources and
  246. the diffs against the bsd telnetd can be found there.  The URL for the
  247. new binary package is:
  248.  
  249. ftp://ftp.debian.org/debian/debian-0.93/binary/net/netstd-1.21-1.deb
  250.  
  251. and the sources and the diff against the bsd telnetd can be found at:
  252.  
  253. ftp://ftp.debian.org/debian/debian-0.93/source/net/netstd-1.21-1/telnetd.tar.gz
  254. ftp://ftp.debian.org/debian/debian-0.93/source/net/netstd-1.21-1/telnetd.diff.gz
  255.  
  256. Red Hat Linux (From Erik Troan <ewt@redhat.com>):
  257. Vulnerable.  A fix is now available at:
  258.  
  259. ftp://ftp.redhat.com/pub/redhat-2.0/updates/NetKit-B-0.06-4.i386.rpm 
  260. ftp://ftp.pht.com/pub/linux/redhat/redhat-2.0/updates/NetKit-B-0.06-4.i386.rpm 
  261.  
  262. It will also be fixed in the upcoming Red Hat 2.1 release.
  263.  
  264. Slackware Linux is vulnerable.  The fixes are available from:
  265.  
  266.         ftp://ftp.cymru.net/pub/linux/security/in.telnetd.bin.gz
  267.         MD5 (in.telnetd.bin.gz) = 300fc2b022f338e32db411d0e14f0bed
  268.  
  269.         ftp://ftp.cymru.net/pub/linux/security/in.telnetd.bin.elf.gz
  270.         MD5 (in.telnetd.bin.elf.gz) = a9ed9a0b90b7a62c98c185e9c7970c5e
  271.  
  272. The CERT Coordination Center has received information that Paul Leyland
  273. <plc@sable.ox.ac.uk> has placed patches for Linux on ftp.ox.ac.uk.
  274.  
  275. Non-US sites may want to obtain the patches from this archive for convenience.
  276. However, please note that these patches will only be available for the next
  277. few months; at some point they will be removed from this location.
  278.  
  279. Linux: This consists of a README, a patch for the telnetd source and a
  280. compiled telnetd which should be ok for most Slackware distributions
  281. and is available from
  282.  
  283.         ftp://ftp.ox.ac.uk/pub/comp/security/software/patches/telnetd/linux
  284.  
  285.           MD5 (envpatch) = 3dff044bae0ee7076b8dce735e174962
  286.           MD5 (telnetd) = ee2146342059ab00b94fae19f9b1ea63
  287.           MD5 (README) = 83f8d07a9b9e8f307346d2ac4b8b3f39
  288.  
  289.  
  290. MIT-distributed Athena telnet/telnet95
  291. - --------------------------------------
  292. Vulnerable. Patches available in:
  293.         ftp://aeneas.mit.edu/pub/kerberos/telnet-patch/
  294.  
  295. beta4-3.patch is the patch versus the Beta 4 patch level 3 distribution
  296. of Kerberos v5.
  297.  
  298. beta5.patch is the patch versus the Beta 5 distribution of Kerberos V5.
  299.  
  300. Both patches have been PGP signed by Ted Ts'o <tytso@MIT.EDU> using
  301. detached signatures (beta4-3.patch.sig and beta5.patch.sig).
  302.  
  303.  
  304. NEC Corporation
  305. - ---------------
  306. Some NEC systems are vulnerable.  Here is their vulnerability matrix:
  307.  
  308.        OS               Version        Status
  309. - ------------------   ------------   -------------------------------------
  310. EWS-UX/V(Rel4.0)     R1.x - R6.x    not vulnerable
  311.  
  312. EWS-UX/V(Rel4.2)     R7.x - R10.x   not vulnerable
  313.  
  314. EWS-UX/V(Rel4.2MP)   R10.x          vulnerable
  315.                                     patch available
  316.  
  317. UP-UX/V              R2.x - R4.x    not vulnerable
  318.  
  319. UP-UX/V(Rel4.2MP)    R5.x - R7.x    vulnerable
  320.                                     patch available
  321.  
  322. UX/4800              R11.x          vulnerable
  323.                                     patch available
  324. - --------------------------------------------------------------------------
  325.  
  326.            The patches are available through anonymous FTP from
  327.            ftp://ftp.meshnet.or.jp in the /pub/48pub/security
  328.            directory. Please refer to the README file in the directory
  329.            concerning the appropriate patches that should be
  330.            retrieved.
  331.  
  332.           OS          Version                Patch-ID and Checksums
  333.   ------------------ ------- -------------------------------------------------
  334.    EWS-UX/V(Rel4.2MP)  R10.x  NECmas001
  335.                               Results of sum = 760 295
  336.                   MD5 (NECmas001.COM.pkg)   = 588ED562BBDA6AFF45F1910A75C19B30
  337.  
  338.    UP-UX/V(Rel4.2MP)   R5.x   NECu5s001
  339.                               Results of sum = 22675 293
  340.                   MD5 (NECu5s001.COM.pkg)   = CBBA695079570BE994EDE8D5AD296B38
  341.  
  342.                        R6.x   NECu6s001
  343.                               Results of sum = 40159 293
  344.                   MD5 (NECu6s001.COM.pkg)   = C891AF03402CFD092B930253DC3CD607
  345.  
  346.                        R7.x   NECu7s001
  347.                               Results of sum = 65094 295
  348.                   MD5 (NECu7s001.COM.pkg)   = 00BAFAFF4A8FCFFB58FB6F8F94039D14
  349.  
  350.    UX/4800             R11.x  NECmbs002
  351.                               Results of sum = 34536 295
  352.                   MD5 (NECmbs002.COM.pkg)   = E6ADAAC22C1B32C4180B855C19B49205
  353.  
  354. Contacts for further information:
  355. E-mail:UX48-security-support@nec.co.jp
  356.  
  357.  
  358. NetBSD
  359. - ------
  360. NetBSD 1.0 (the last official release) is vulnerable; NetBSD 1.1 (due
  361. out in mid-November) will not be.  NetBSD-current is not vulnerable,
  362. as of a week or so ago.
  363.  
  364. Patches: A source form patch has been developed.  A core team member will
  365. have to make source and binary patches available and provide a location for
  366. it.
  367.  
  368. The login-wrapper given in the advisory can be compiled with NetBSD with:
  369.         cc -static -o login-wrapper login-wrapper.c
  370.  
  371.  
  372. Open Software Foundation
  373. - ------------------------
  374. OSF/1 version 1.3 is not vulnerable.
  375.  
  376.  
  377. OpenVision
  378. - ----------
  379. This is from: Barry Jaspan <bjaspan@cam.ov.com>:
  380. OpenVision has a patch for the telnetd in OpenV*Secure 1.2 and will
  381. contact its customers directly.
  382.  
  383.  
  384. The Santa Cruz Operation Inc.
  385. - -----------------------------
  386. SCO is NOT vulnerable.
  387.  
  388.  
  389. Silicon Graphics
  390. - ----------------
  391.  
  392. On November 16, 1995, Silicon Graphics updated their advisory,
  393. 19951101-02-P1010o1020, concerning the Telnetd vulnerability.
  394.  
  395. In the original advisory, 19951101-01-P1010o1020, the patches 1010 and
  396. 1020 were indicated for the wrong versions of IRIX.  Patch 1010 is for
  397. IRIX 6.1 and patch 1020 is for IRIX 5.2, 5.3, 6.0, 6.0.1.   The
  398. corrections have been made below.
  399.  
  400. The solution for this issue is a replacement of the telnetd program
  401. for those versions that are vulnerable.  The following patches have
  402. been generated for those versions vulnerable and freely provides them
  403. for the community.
  404.  
  405. **** IRIX 3.x ****
  406.  
  407. This version of IRIX is not vulnerable.  No action is required.
  408.  
  409. **** IRIX 4.x ****
  410.  
  411. This version of IRIX is not vulnerable.  No action is required.
  412.  
  413. **** IRIX 5.0.x, 5.1.x ****
  414.  
  415. For the IRIX operating systems versions 5.0.x, 5.1.x, an upgrade
  416. to 5.2 or better is required first.  When the upgrade is completed,
  417. then the patches described in the next sections "**** IRIX 5.2, 5.3, 6.0,
  418. 6.0.1, 6.1 ***"  or "**** IRIX 6.1 ****" can be applied.
  419.  
  420. **** IRIX 5.2, 5.3, 6.0, 6.0.1 ****
  421.  
  422. For the IRIX operating system versions 5.2, 5.3, 6.0, and 6.0.1,
  423. an inst-able patch has been generated and made available via anonymous
  424. ftp and/or your service/support provider.  The patch is number 1020
  425. and will install on IRIX 5.2, 5.3, 6.0 and 6.0.1 .
  426.  
  427. The SGI anonymous ftp site is sgigate.sgi.com (204.94.209.1).   Patch
  428. 1020 can be found in the following directories on the ftp server:
  429.  
  430.         ~ftp/Security
  431.  
  432.                 or
  433.  
  434.         ~ftp/Patches/5.2
  435.         ~ftp/Patches/5.3
  436.         ~ftp/Patches/6.0
  437.         ~ftp/Patches/6.0.1
  438.  
  439. The actual patch will be a tar file containing the following files:
  440.  
  441. Filename:                 README.patch.1020
  442. Algorithm #1 (sum -r):    31057 8 README.patch.1020
  443. Algorithm #2 (sum):       40592 8 README.patch.1020
  444. MD5 checksum:             02F06ECD6240015F8DF82A99EC01E911
  445.  
  446. Filename:                 patchSG0001020
  447. Algorithm #1 (sum -r):    07232 2 patchSG0001020
  448. Algorithm #2 (sum):       47310 2 patchSG0001020
  449. MD5 checksum:             DA2341626FAEB9D67BA85FA3465BA9D9
  450.  
  451. Filename:                 patchSG0001020.eoe1_sw
  452. Algorithm #1 (sum -r):    22449 62 patchSG0001020.eoe1_sw
  453. Algorithm #2 (sum):       36518 62 patchSG0001020.eoe1_sw
  454. MD5 checksum:             936019F2CC9AB6CAE0D2DF611D461475
  455.  
  456. Filename:                 patchSG0001020.eoe2_sw
  457. Algorithm #1 (sum -r):    29899 43 patchSG0001020.eoe2_sw
  458. Algorithm #2 (sum):       12088 43 patchSG0001020.eoe2_sw
  459. MD5 checksum:             19A9C0BCB6F178E7EDF86850A1CF81D1
  460.  
  461. Filename:                 patchSG0001020.idb
  462. Algorithm #1 (sum -r):    64615 2 patchSG0001020.idb
  463. Algorithm #2 (sum):       46761 2 patchSG0001020.idb
  464. MD5 checksum:             487831A62C61FEAF5797859CBC1F018C
  465.  
  466.  
  467. **** IRIX 6.1 ****
  468.  
  469. For the IRIX operating system version 6.1, an inst-able patch has
  470. been generated and made available via anonymous ftp and/or your
  471. service/support provider.  The patch is number 1010 and will
  472. install on IRIX 6.1 .
  473.  
  474. The SGI anonymous ftp site is sgigate.sgi.com (204.94.209.1).   Patch
  475. 1010 can be found in the following directories on the ftp server:
  476.  
  477.         ~ftp/Security
  478.  
  479.                 or
  480.  
  481.         ~ftp/Patches/6.1
  482.  
  483. The actual patch will be a tar file containing the following files:
  484.  
  485. Filename:                 README.patch.1010
  486. Algorithm #1 (sum -r):    43949 8 README.patch.1010
  487. Algorithm #2 (sum):       38201 8 README.patch.1010
  488. MD5 checksum:             A8781E18A1F79716FBFE0B6E083DAB31
  489.  
  490. Filename:                 patchSG0001010
  491. Algorithm #1 (sum -r):    08656 2 patchSG0001010
  492. Algorithm #2 (sum):       45506 2 patchSG0001010
  493. MD5 checksum:             34CF7F63073C225AD76150A4088E76AB
  494.  
  495. Filename:                 patchSG0001010.eoe1_sw
  496. Algorithm #1 (sum -r):    12843 65 patchSG0001010.eoe1_sw
  497. Algorithm #2 (sum):       42034 65 patchSG0001010.eoe1_sw
  498. MD5 checksum:             82B8D375ECBF58A08286D393CE3980E7
  499.  
  500. Filename:                 patchSG0001010.eoe2_sw
  501. Algorithm #1 (sum -r):    01655 47 patchSG0001010.eoe2_sw
  502. Algorithm #2 (sum):       19507 47 patchSG0001010.eoe2_sw
  503. MD5 checksum:             1A5C5B5B84E0188A923C48419F716492
  504.  
  505. Filename:                 patchSG0001010.idb
  506. Algorithm #1 (sum -r):    31514 2 patchSG0001010.idb
  507. Algorithm #2 (sum):       46531 2 patchSG0001010.idb
  508. MD5 checksum:             9540492FEB00D41281AAF90AC3F67FA9
  509.  
  510.  
  511. SGI Security Information/Contacts:
  512.  
  513. For obtaining security information, patches or assistance, please
  514. contact your SGI support provider.
  515.  
  516. If there are questions about this document, email can be sent to
  517. cse-security-alert@csd.sgi.com .
  518.  
  519. For reporting *NEW* SGI security issues, email can be sent to
  520. security-alert@sgi.com.
  521.  
  522.  
  523. Sony Corporation
  524. - ----------------
  525. Sony's NEWS-OS 6.x is not vulnerable.
  526.  
  527.  
  528. Sun Microsystems, Inc.
  529. - ---------------------
  530.  
  531. The CERT Coordination Center has not received a report from Sun Microsystems
  532. regarding this vulnerability. However, we believe that SunOS 4.x and Solaris
  533. 2.X are not vulnerable. Please contact Sun directly for more accurate
  534. information. Sun Microsystems OS platforms can be made to be vulnerable if a
  535. Borman telnet version prior to that dated October 23, 1995, is installed on
  536. these systems.
  537.  
  538.  
  539. ..............................................................................
  540.  
  541. Appendix B: login-wrapper Workaround
  542.  
  543. The login-wrapper program shown below is meant to be executed just before
  544. the distributed login program. The wrapper cleans specific variables from
  545. the environment before invoking the distributed login program.
  546.  
  547. - ------------------------cut here--8<------------------------
  548. /*
  549.  * This is a login wrapper that removes all instances of
  550.  * various variables from the environment.
  551.  *
  552.  * Note: this program must be compiled statically to be
  553.  * effective against exploitation.
  554.  *
  555.  * Author:      Lawrence R. Rogers
  556.  *
  557.  * 10/25/95     version 1.1     Original version
  558.  * 10/26/95     version 1.2     ELF_ variables removed (Linux)
  559.  * 10/27/95     version 1.3     ELF_ changed to ELF_LD_
  560.  *                              Added AOUT_LD_ (Linux)
  561.  *
  562.  */
  563.  
  564. #include        <stdio.h>
  565.  
  566. #if !defined(_PATH_LOGIN)
  567. # define                _PATH_LOGIN     "/bin/login.real"
  568. #endif
  569.  
  570. main (argc, argv, envp)
  571. int argc;
  572. char **argv, **envp;
  573. {
  574.         register char **p1, **p2;
  575.  
  576.         for (p1 = p2 = envp; *p1; p1++) {
  577.                 if (strncmp(*p1, "LD_", 3) != 0 &&
  578.                     strncmp(*p1, "_RLD", 4) != 0 &&
  579.                     strncmp(*p1, "LIBPATH=", 8) != 0 &&
  580.                     strncmp(*p1, "ELF_LD_", 7) != 0 &&
  581.                     strncmp(*p1, "AOUT_LD_", 8) != 0 &&
  582.                     strncmp(*p1, "IFS=", 4) != 0 ) {
  583.                             *p2++ = *p1;
  584.                 }
  585.         }
  586.         *p2 = 0;
  587.         execve(_PATH_LOGIN, argv, envp);
  588.         perror(_PATH_LOGIN);
  589.         exit(1);
  590. }
  591. - ------------------------cut here--8<------------------------
  592.  
  593. The following two examples show how to compile the login-wrapper for SGI's
  594. IRIX 5.3 and FreeBSD 2.x systems. The examples move the distributed login
  595. program to a new location and install the wrapper in the standard location.
  596. When executed, the wrapper first cleanses the environment and then calls
  597. the relocated, distributed login program.
  598.  
  599. Note 1: The wrapper must be compiled statically. On SGI's IRIX system,
  600. compiling statically requires that the non-shared versions of libraries
  601. be installed. Consult your system documentation to determine how to do
  602. this.
  603.  
  604. Note 2: You may need to change the _PATH_LOGIN variable to define where
  605. the real login program resides on your system. On some systems, login
  606. resides in /usr/bin/login.
  607.  
  608. Compiling for IRIX 5.3
  609. - ----------------------
  610. # uname -a
  611. IRIX test 5.3 11091812 IP22 mips
  612. # /bin/ls -l /usr/lib/iaf/scheme
  613. - -rwsr-xr-x    1 root     sys        65832 Sep  9 14:24 /usr/lib/iaf/scheme
  614. # /bin/cc -non_shared -O -D_PATH_LOGIN=\"/usr/lib/iaf/scheme.real\" \
  615.         login-wrapper.c -o login-wrapper
  616. # /bin/mv /usr/lib/iaf/scheme /usr/lib/iaf/scheme.real
  617. # /bin/chmod 755 /usr/lib/iaf/scheme.real
  618. # /bin/mv login-wrapper /usr/lib/iaf/scheme
  619. # /bin/chmod 4755 /usr/lib/iaf/scheme
  620. # /bin/chown root /usr/lib/iaf/scheme
  621. # /bin/chgrp  sys /usr/lib/iaf/scheme
  622. # /bin/ls -lL /usr/lib/iaf/scheme /usr/lib/iaf/scheme.real
  623. - -rwxr-xr-x    1 root     sys        65832 Sep  9 14:24
  624. /usr/lib/iaf/scheme.real
  625. - -rwsr-xr-x    1 root     sys       213568 Oct 30 08:42 /usr/lib/iaf/scheme
  626.  
  627. Compiling for FreeBSD 2.x
  628. - -------------------------
  629. # /bin/ls -lg /usr/bin/login
  630. - -r-sr-xr-x  1 root  bin  20480 Jun 10 20:00 /usr/bin/login
  631. # /usr/bin/cc -D_PATH_LOGIN=\"/usr/bin/login.real\" -static \
  632.         -O login-wrapper.c -o login-wrapper
  633. # /bin/mv /usr/bin/login /usr/bin/login.real
  634. # /bin/chmod 555 /usr/bin/login.real
  635. # /bin/mv login-wrapper /usr/bin/login
  636. # /bin/chmod 4555 /usr/bin/login
  637. # /usr/sbin/chown root.bin /usr/bin/login
  638. # /bin/ls -lg /usr/bin/login /usr/bin/login.real
  639. - -r-sr-xr-x  1 root  bin  24885 Oct 25 22:14 /usr/bin/login
  640. - -r-xr-xr-x  1 root  bin  20480 Jun 10 20:00 /usr/bin/login.real
  641.  
  642.  
  643. - ---------------------------------------------------------------------------
  644. The CERT Coordination Center staff thanks Eric Halil of AUSCERT, Wolfgang
  645. Ley of DFNCERT, and Sam Hartman of the MIT Kerberos Development team for
  646. their support in responding to this problem.
  647. - ---------------------------------------------------------------------------
  648.  
  649. If you believe that your system has been compromised, contact the CERT
  650. Coordination Center or your representative in the Forum of Incident
  651. Response and Security Teams (FIRST).
  652.  
  653. If you wish to send sensitive incident or vulnerability information to
  654. CERT staff by electronic mail, we strongly advise that the email be
  655. encrypted.  The CERT Coordination Center can support a shared DES key, PGP
  656. (public key available via anonymous FTP on info.cert.org), or PEM (contact
  657. CERT staff for details).
  658.  
  659. Internet email: cert@cert.org
  660. Telephone: +1 412-268-7090 (24-hour hotline)
  661.            CERT personnel answer 8:30 a.m.-5:00 p.m. EST(GMT-5)/EDT(GMT-4),
  662.            and are on call for emergencies during other hours.
  663. Fax: +1 412-268-6989
  664.  
  665. Postal address:  CERT Coordination Center
  666.                  Software Engineering Institute
  667.                  Carnegie Mellon University
  668.                  Pittsburgh, PA 15213-3890
  669.                  USA
  670.  
  671. CERT advisories and bulletins are posted on the USENET newsgroup
  672. comp.security.announce. If you would like to have future advisories and
  673. bulletins mailed to you or to a mail exploder at your site, please send mail
  674. to cert-advisory-request@cert.org.
  675.  
  676. Past CERT publications, information about FIRST representatives, and
  677. other information related to computer security are available for anonymous 
  678. FTP from info.cert.org. 
  679.  
  680.  
  681. Copyright 1995, 1996 Carnegie Mellon University
  682. This material may be reproduced and distributed without permission provided it
  683. is used for non-commercial purposes and the copyright statement is included.
  684.  
  685. CERT is a service mark of Carnegie Mellon University.
  686.  
  687. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  688. Revision history
  689.  
  690. Aug. 30, 1996  Information previously in the README was inserted
  691.                into the advisory.
  692. Mar. 22, 1996  Appendix A, SGI -  Modified information for Silicon Graphics.
  693. Feb. 08, 1996  Appendix A, NEC -  Added patch information.
  694. Nov. 08, 1995  Appendix A, IBM - Added an entry for IBM.
  695.                           Linux - Added information about Slackware Linux.
  696.                           NetBSD - Corrected compilation instructions.
  697.                           SCO - Noted SCO is not vulnerable.
  698.                           SGI - Updated information.
  699.                           Sun - Added an entry.
  700. Nov. 08, 1995  Appendix B - Replaced IRIX 5.3 section with new material.
  701.  
  702.  
  703.  
  704. -----BEGIN PGP SIGNATURE-----
  705. Version: 2.6.2
  706.  
  707. iQCVAwUBMiS63XVP+x0t4w7BAQECPgP+Pq98bUO6PMmHI/PZqZC7e4+A0EzXV3Xi
  708. Qw+B4Pei+k2+2oEVuhl46QxnL1jNuYcRcjErqJeeZopxMIggKGprwZWgfW3zPjrq
  709. lXBnrO98DmUUMzCccPLDtA3QYctiad6I/ZnInj/kI3nESnfl+QnXrMeekwndXLZV
  710. rJM9+YnrJx0=
  711. =oQOU
  712. -----END PGP SIGNATURE-----
  713.  
  714.