What attack

What attack

Post by Nir Ore » Thu, 03 Apr 1997 04:00:00



G'day...

Our site has just been attacked, and I'm trying to gather some information
as to exactly what happened. The details are as follows:
We are running wu-ftp version 2.4, and someone managed to cause a core
dump which contained part of our shadow file.
I have done a quick search of the CERT archives, and have found no details
of this sort of exploit.
Does anyone know any more details about wu-ftp vulnerabilities???
Thanks
Nir Oren

 
 
 

What attack

Post by Chad Wolfsheim » Thu, 03 Apr 1997 04:00:00


: We are running wu-ftp version 2.4, and someone managed to cause a core
: dump which contained part of our shadow file.
What operating system are you running? Check the BUGTRAQ archives from
February, I think, for information about fixing this.

--
  //===============Chad Wolfsheimer=======Brown University===============\\
 //===================UNIX System/Network Administration==================\\

  \\==============http://bootp-244.diman.brown.edu/~cwolfshe=============//

 
 
 

What attack

Post by Vadim Kolonts » Fri, 04 Apr 1997 04:00:00


: G'day...

: Our site has just been attacked, and I'm trying to gather some information
: as to exactly what happened. The details are as follows:
: We are running wu-ftp version 2.4, and someone managed to cause a core
: dump which contained part of our shadow file.
: I have done a quick search of the CERT archives, and have found no details
: of this sort of exploit.
: Does anyone know any more details about wu-ftp vulnerabilities???
: Thanks
: Nir Oren

  Here is copy of my old letter

P.S. wu-ftpd's BETA13 still can be killed by ">100 args bug"

Best regards, Vadim.

---------- Forwarded message ----------
Date: Wed, 30 Oct 1996 09:21:31 +0300 (MSK)



Subject: Re: AUSCERT 9610181435 -- vuls in ftpd

Hello,


> We are preparing an advisory to issue concerning the recent vulnerabilities
> in ftpd which allow users to cause it to core dump.  We noticed your
> posting to bugtraq concerning the wu-ftpd and two vulnerabilities
> it has.

> >  wuftpd can create core dump in two following situation too (yes, dump
> >will contain some subset of shadowed passwords):>

> >1) "pasv" given when user not logged in
> >   (caused by error in passive())>

> >2) more than 100 arguments to any executable command (for example, "list")
> >   (caused by error in ftpd_popen())>

> >  First error presents in almost all version of bsd's ftpd, wu-ftpd and
> >derived. Second error presents in all versions of bsd's ftpd, wu-ftpd and
> >derived (as far as I know).

> We have been able to verify the first on the standard wu-ftpd 2.4.  We
> haven't been able to verify the second.

---------------------------------------------------------------
Script started on Wed Oct 30 09:02:34 1996

/home/vadim> telnet ftp.somewhere.in.the.world.com 21
Trying a.b.c.d...
Connected to FTP.SOMEWHERE.IN.THE.WORLD.COM.
Escape character is '^]'.
220 FTP server (Version wu-2.4.2-academ[BETA-11](1) Fri Jul 26 19:43:17 CDT 1996) ready.
user ftp
331 Guest login ok, send your complete e-mail address as password.

230 Guest login ok, access restrictions apply.
list x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
Connection closed by foreign host.
/home/vadim>

Script done on Wed Oct 30 09:03:36 1996
-------------------------------------------------------------------------

Why it works? Here is the fragment of ftpd (file popen.c):

FILE * ftpd_popen(char *program, char *type, int closestderr)
{
    .  .  .

    char *argv[100],

    /* break up string into pieces */
    for (argc = 0, cp = program;; cp = NULL)
        if (!(argv[argc++] = strtok(cp, " \t\n")))
            break;

  As you can see, there is no checking if argument count is greater than
100. So, if I'll give any command (such as "LIST"), which executes
some binary ("ls" in this case) with more than 100 arguments, ftpd
dies and generates core dump.
  Patch is simple, of course -- add checking for "argc < 100" in cycle
header.

  Now about second error, with "pasv" command...

File ftpd.c:

void passive()
{
        int len;
        u_short port;
        char *p, *a;

        pdata = socket(AF_INET, SOCK_STREAM, 0);
        if (pdata < 0) {
                perror_reply(425, "Can't open passive connection");
                return;
        }

        if (restricted_data_ports) {
                for (port = FTP_DATA_BOTTOM; port <= FTP_DATA_TOP; port++) {
                        pasv_addr = ctrl_addr;
                        pasv_addr.sin_port = htons(port);
                        (void) seteuid((uid_t)0);
                        if (bind(pdata, (struct sockaddr *)&pasv_addr,
                                 sizeof(pasv_addr)) < 0) {
                                (void) seteuid((uid_t)pw->pw_uid);

  When no one logged in, pw == NULL, and seteuid((uid_t)pw->pw_uid) causes
core dump. Patch is very simple too -- add the following lines in start of
function (before "pdata = socket(AF_INET..."):

        if (!pw) {
                reply(530, "Please login with USER and PASS");
                return;
        }

  Third error in ftpd... kill -11
  Because ftpd runs with user's privilegies (after user logged in), user
can generate core dump by killing ftp-daemon with signal 11. If you need
more information (including example and patch), ask.

  Of course, if I want to read core dump, I have to login first to change
current dir (using "CWD") to directory like /incoming or my homedir
(if I have account on victim machine) and only then kill ftp-daemon by
'pasv', kill or 'list'...

> We'd be very interested in hearing your feedback about whether the problems
> exist under beta-11 or not.

  Those error (1, 2 and 3) presents almost in *ALL* versions of ftpd
(FreeBSD's ftpd, Solaris' ftpd and so on), because it presents in original
berkeley ftpd, which others derived from.

With best regards, Vadim.
--------------------------------------------------------------------------
Vadim Kolontsov                                          SysAdm/Programmer
Tver Regional Center of New Information Technologies          Networks Lab

 
 
 

What attack

Post by Andrew Cardwe » Fri, 04 Apr 1997 04:00:00


: G'day...

: Our site has just been attacked, and I'm trying to gather some information
: as to exactly what happened. The details are as follows:
: We are running wu-ftp version 2.4, and someone managed to cause a core
: dump which contained part of our shadow file.
: I have done a quick search of the CERT archives, and have found no details
: of this sort of exploit.
: Does anyone know any more details about wu-ftp vulnerabilities???
: Thanks
: Nir Oren

There was a recent wu-ftp bug going around .... try
www.cert.org/pub/cert_advisories then do a search on wu-ftpd - but thats
a fairly old one...
A newer one came out on the 'bugtraq' mailing list do a www search for
'bugtraq' should throw up their archive... if no luck drop me a mail

--
Andrew Cardwell, Security Master         http://www.pipex.net/~andrewc/
UUNET, Internet House,                   http://www.uunet.pipex.com/    

CAMBS, CB4 4BZ, England.                 Tel: +44 (0)1223 250 100

 
 
 

What attack

Post by Len Jacobs » Fri, 04 Apr 1997 04:00:00


: G'day...

: Our site has just been attacked, and I'm trying to gather some information
: as to exactly what happened. The details are as follows:
: We are running wu-ftp version 2.4, and someone managed to cause a core
: dump which contained part of our shadow file.

well, on a freebsd machine i used to run, i was able to do exactly what
you described here, ftp to the machine, suspend the process, kill -11 the
process, and then when i tried to bring it to the foreground, it would
core dump on me and would drop parts of the shadowed password file out
with it.  this might be what happened, if you were running freebsd that
is.  i've heard they've fixed this problem tho with the new releases.  if
i remember right, i also saw something about this problem in bugtraq in
like mid february, not sure tho.

just an idea ....

peace ... laterz ...

len.


Len Jacobsen    I want peace on earth and good will towards men.
Hardware Tech.          - Whistler
Sys. Admin.     We're the U.S. Governement, we don't do that sort of thing.
Beer Consumer.          - N.S.A. Agent

 
 
 

1. Help, I need a list of Denial of Service attack by symptom to track an attack

If anyone knows of a site where they have a list of the currently
occuring denial of service attacks with the symptoms of each?  My
network went down for an hour earlier today, and was brought back up
by closing any incoming traffic from the gateway for about 10 minutes.

Sounds like an obvious flood of some sort, but rather than play around
with what was going on, I brought everything up asap, and can find
nothing in logs, all I know is that there was a BUNCH of network
traffic going on and I couldn't reach a one of my half dozen servers,
ranging from NT and SGI to Linux and even win95.

anyway, anyone know of a list or resource to track down WHAT was going
on by symptom, and give me a list of things to check when this happens
next?

Thanks for your help!!!!

-- alex

2. Patch/resubmit(2.5.49): Use struct io_restrictions in blkdev.h

3. Tried attack or succesfull attack on mountd?

4. Basic Printing is kickin my but

5. Samba Strikes Back at th Evil Empire Attacks by FUD Attacks against this article By Erik Expected

6. newbie firewall questions

7. Hack Attacks to my Servers!

8. SUN file and directory attributes

9. Help with DoS attack, PLEASE

10. Fave Unix Hacker Attacks

11. Where I can get SYNC attack fix for BSD4.4?

12. Attacks, Hardware or what?

13. Inetd and "root attacks"