Bugtraq mailing list archives

Re: wuftp2.4.2academ beta 12-18 exploit


From: laq () SWIPNET SEX (laq () SWIPNET SEX)
Date: Fri, 7 May 1999 10:42:54 +0200


On Wed, 5 May 1999 laq () SWIPNET SE wrote:

Workaround:

wu-ftpd and variants that use files /etc/ftp* for configuration
can easily help protect you against the many recent variants that
exploit buffer overflows with MKDIR.  All the varieties I've
seen require creating a directory or file - that's where the
overflow happens.

In /etc/ftpaccess, you have the option to specify what commands
may and may not be run by particular users.  Just add lines to
specify that user anonymous (or whatever others you want) cannot
put, delete, mkdir, etc.

E.g., lines like these:

chmod           no              anonymous
delete          no              anonymous
overwrite       no              anonymous
rename          no              anonymous
mkdir           no              anonymous
upload          no              anonymous

if you still want to let anonymous users create directories,
take a look at path-filter option for that very same file.

# path-filter...
path-filter  anonymous  /etc/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-

when i tried the exploit on myself i got alot of "Permission denied (pathname)",
so at least it seems to work.


i got some questions about how to make this filter apply to ordinary users as
well, i might point this out at the list instead of answering each mail.

instead of anonymous, use "real" to make the filter apply to any other user.
just like:

path-filter  real  /etc/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-

but this would piss users of as they wouldnt be allowed to create .directory
which they actually might want to do, and have the right to do.

so here is a cut from my own ftpaccess file:

# path-filter...
path-filter  anonymous  /etc/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-
path-filter  guest      /etc/pathmsg  ^[-A-Za-z0-9_\.]*$  ^\.  ^-
path-filter  real      /etc/pathmsg  ^[-A-Za-z0-9_\.]*$

this lets your ordinary users use filenames starting with . and -
but still rejects the exploit, lookie here:



Iþè¬ÿÿÿ: Permission denied. (Filename (accept))
550 1A1U°Iþ1A°Iþ1A1U°.IþëO1A1É^°'þ^þűíIþ1Aþ^°=Iþ1A»OÑþÿ÷U1ɱVIþcd /; uname -a;
pwd; id;
þÆàù^°=þ^Iþ1AþFþþF
                  °
                   þóþþV
                        Iþè¬ÿÿÿ: No such file or directory.
257 "/tmp/bin" new directory created.
250 CWD command successful.
257 "/tmp/bin/sh" new directory created.
250 CWD command successful.
550-I don't like crappy filenames..
550-please choose another name for the
550-shit you're trying to send me.
550-
550-Rules:
550-1. only chars A-Z,a-z,0-9,.\- are allowed in filenames
550-2. NO initial . or - in filenames
550
"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿":
Permission denied. (Filename (accept))
550
"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿":
No such file or directory.
550-I don't like crappy filenames..
550-please choose another name for the
550-shit you're trying to send me.
550-
550-Rules:
550-1. only chars A-Z,a-z,0-9,.\- are allowed in filenames
550-2. NO initial . or - in filenames
550
ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿:
Permission denied. (Filename (accept))
550
ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿:
No such file or directory.
550-I don't like crappy filenames..
550-please choose another name for the
550-shit you're trying to send me.
550-
550-Rules:
550-1. only chars A-Z,a-z,0-9,.\- are allowed in filenames
550-2. NO initial . or - in filenames
550
"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿":
Permission denied. (Filename (accept))
550
"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿":
No such file or directory.
550-I don't like crappy filenames..
550-please choose another name for the
550-shit you're trying to send me.
550-
550-Rules:
550-1. only chars A-Z,a-z,0-9,.\- are allowed in filenames
550-2. NO initial . or - in filenames
550
ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿:
Permission denied. (Filename (accept))
550
ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿"ÿ¿:
No such file or directory.
500 'CD /; uname -a; pwd; id;': command not understood.




oh, btw, if you want to reply to me, remove the last x from my address, i put it
there to hopefully not have to get all those "out of office" messages.



-------------------------------------------
PGP: http://home.swipnet.se/laq/pgpkey.asc
HTTP: http://home.swipnet.se/laq
CELL: 070-7564423
-------------------------------------------



Current thread: