Operating System - HP-UX
1847827 Members
3963 Online
104021 Solutions
New Discussion

wu-ftpd problems on hp-ux 11.00

 
Rick Copley
Advisor

wu-ftpd problems on hp-ux 11.00

Hello everybody,

I have recently been tasked with creating a secure ftp server. This server will exist in our DMZ and will service only "real" users. My manager would also like these real users to have access only to the /home/ftp directories. Anonymous ftp is out of the question due to security concerns.

To achieve this I have implemented wu-ftpd version 2.6.1(2) I have changed inetd.conf to point to point ftp services at /opt/wu-ftp/bin/ftpd. I have created and /etc/shells file adding the /usr/bin/ftponly entry (to minimize chances of a user telneting to thier account and starting a shell. I have created a group called ftpusers in /etc/group (77). The test id looks like this:

x999:[password]:300:77::/home/./ftp:/usr/bin/ftponly

I have also created a class and guestgroup in my /opt/wu-ftp/etc/ftpaccess file (see attached). In the /home/ftp directory I have created 3 directories called usr, etc, and bin.
In the ~ftp/etc directory I have a copy of my passwd and group file. In ~ftp/usr/bin i have a copied version of ls. I also have a copied version of ls in ~ftp/bin directory.

At this point I initiate an ftp session using the x999 test user. So far so good. I can successfully log into the server and cannot traverse the filesystem above /home/ftp. However...I can't list the contents of the /home/ftp directory. No matter what I do the x999 user can't see files or directories in the filesystem. I have tried everything, even allowing SAM to create an anonymous account and creating the etc and usr directories on it's own, then deactivating anonymous services while still retaining the directories it created. I even got the gnu-fileutils and compiled them in the ~ftp directory to make sure that I wasn't having problems with dynamicly linked libraries. Still no joy!

I have no idea what I am doing wrong here, my manager is unfamiliar with wu-ftp so he can't help me and I have a deadline fast approaching. Any help would be greatly appreciated.
19 REPLIES 19
Christopher Caldwell
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

You're chroot'd, so I'd bet that either the perms on the chroot directory don't permit viewing, or
you put a copy of /usr/bin/ls in your chroot bin directory instead a copy of /usr/sbin/ls.

/usr/bin/ls is dynamically linked, so it can't find the link library in a chroot'd environment.
/usr/sbin/ls is (statically)bin linked
Christopher Caldwell
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Ooops, sorry. Substitute /sbin/ls everywhere you see /usr/sbin/ls in my previous post.

Doh!
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Chris,
Thanks for the reply. Your initial guess was right, I did use the the wrong ls. However after a cp of /sbin/ls to the appropriate directories I am still unable to get a listing. Any other suggestions?

Thanks,
Pat
Jim Hendrick
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Are you committed to wu-ftpd? That server has been the source of *many* security holes over the years.

You might look at NcFTP

Later,
Jim
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Jim,

At this point I am kind of committed to wu-ftp. One, because wu-ftp is a supported service under hp-ux 11.00 and two because I don't have the time to learn the intracacies of a new ftp daemon. I understand that there have been issues in the past concerning wu-ftp on hp-ux platforms, but I have "patched up" the application with all relevant fixes to date. I also understand that wu-ftp is pretty much an industry standard at this point.
Christopher Caldwell
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Add
-l -v to the start line of ftpd in inetd.conf (don't forget to inetd -c to get inetd to re-read the configuration file).
Make sure you have the -a option to read the ftpaccess file, and make sure ftpd is reading the correct ftpaccess file.

Are you using stock HP wu-ftpd, or did you get wu-ftpd from the porting archive (or from wu-ftpd.org)?

After you do the earlier stuff, you'll need two telnet windows.

In the first one, let's see the output of
tail -f /var/adm/syslog/syslog.log

In the second one, ftp yourhost.com, user
youruser, pass yourpass, ls

post the results of both diagnostics
Christopher Caldwell
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

let's also see
ll -d /home

ll -d /home/ftp

ll /home/ftp

what /sbin/ls

what /home/ftp/usr/bin/ls
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Chris,

I am working on your suggestions as I write this. In answer to one of your questions I am using a wu-ftp implementation from the Software Porting and Archive Centre for HP-UX.

In answer to one of your other questions, in reading the install notes for this service I noticed that the -a option is automatically assumed by this build of the wuftpd daemon.

I will advise as soon as I've implemented your other sugggestions.
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Chris,

As requested, the output of all your suggestions are included in my attachment. In addition the ftpaccess file that wuftpd is referencing is in /opt/wuftpd/etc/ftpaccess. Please advise...
Shannon Petry
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

I have a pretty descent doc on my web server...go to "http://www.invenioeng.com/systems/ftpd_faq.html". It covers alot of stuff especially regarding wu-ftpd.

Some things to note are that you need to make sure your permissions on ~ftpd/bin are 555, and ~ftpd/bin/ls are 555. Also make sure that they are owned by root, and group of sys....

Next you should NOT copy /etc/passwd to ~ftpd/passwd! This is a suplement file, to show ownership and groups in a chrooted environment. Authentication still occurs by the systems PAM, and may be causing your problems.

Make sure that if you are using ftpaccess, that is does not restrict the use of ls to guestgroup users!

Look through my docs, as I think I did a pretty good job of describing each file, functionality, and configuration..

Regards,
Shannon
Microsoft. When do you want a virus today?
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Hi Shannon,

I emailed you earlier but wasn't sure if you'd get the message or not. I did change the permission on the both ~ftp/bin, ~ftp/usr/bin directories from 777 to 555. The permissions on the ls executables were already set to 555. I also deleted the copies of passwd and groupin the ~ftp/etc directory. I then logged in but still no listing.

To make certain that I was actually in the ~/ftp dir I then uploaded a file to the server. While the file did not show up the client window. I could definitely see the file sitting there in the proper directory. I think I am reaching the end of my rope ;)
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Eureka everyone,

I can't explain why this is happening but it is. I was just messing around trying different list commands in the ftp session. ls, list failed to show anything. However when I did an NLIST I got a listing of the two files I put into /home/ftp as a test!!!! I wonder what the heck is going on here?
Rick Copley
Advisor

Re: wu-ftpd problems on hp-ux 11.00

Last post from me on this topic I promise!!! I found the solution to this problem and it was in the freakin manpage for ftpaccess the entire fscking time!!!!

Here is the lowdown on my problem. As you can see from my previous posts my usr and etc files have been located under /home/ftp. This is completely wrong. When you use the /./ hack the directory to the left of the first foward slash is the root dir...the directory on the right side of the / is the home dir. It says explicitly in the man page that the executables have to be located in the root directory!!! Once I moved the usr and etc directories up to /home everything worked just fine!!! It's a strong case for rtfm!!!!

Chris and Shannon thank you so much for your help. You guys really helped me eliminate problems and cleanup my configuration! Points will be awarded!

Pat Smith
Berlene Herren
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Hi Rick,
While reading this over, I see that you have the wu-ftpd from the Porting Archive. I recommend you apply PHNE_23949 to put you totally on HP's wu-ftpd.
This version of FTP has some new configuration files that can be used to take advantage of new functionality. Sample of the new configuration files are provided in
/usr/newconfig/etc/ftpd. You can edit these files as per your need and copy them to the location /etc/ftpd.
You can get information on the new features introduced by this new version of ftpd from the file:
/usr/share/doc/RelNotes_newftp.txt

Regards,
Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Christopher Caldwell
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Berlene

What's the version of ftpd supplied by that patch? A while back, the CERT or CIAC had some issues with the initial wu-ftpd based version you guys released; I know you addressed some of the issues, but I think there are some outstanding one's:
http://archives.neohapsis.com/archives/vuln-dev/2001-q2/0311.html
Which is one reason I might think about compiling my own (based on wu-ftpd).

I'm also likely to be a little more strict about what features I enable (or disallow); it's not clear to me which compile directives/options HP uses.

Finally (plea for community help), the developers that author open software (bind, sendmail, wu-ftpd, insert service here) tend to get security patches out about the time I hear of a vulnerability. HP tends to get patches out about a month (or two) later. That's not soon enough.

After security vulnerabilities are announced, HP should make supported patches available just after the patches are made available by the Internet developer community. Release them in "buyer beware" form if you want, but release them. Go through extensive release testing (or whatever takes the extra time) later, then release the official patch.

If you don't keep up with the features or the security (HP often lags in both), the community of HP users will seek (and should seek) alternatives (downloading from the porting center or compiling their own).

My .02.
Berlene Herren
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Rick, I believe it is 2.4 now, with 2.6.1 being released soon from http://www.software.hp.com. But if your ftpd isn't listed as /usr/lbin/ftpd in /etc/inetd.conf, I'm not sure if you will be able to get support for wu-ftpd from the response center. As anything you can download from the web is able to be compiled any way you want it, it is not supported by HP.

I understand your frustration about security patches. Do you subscribe to the HP Security Bulletins?

I will also forward your comments to the patch team.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Christopher Caldwell
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Unfortunately, 2.4 is known to have security problems (perhaps the folks at HP have addressed the issues in 2.4):

This text is from one of the wu-ftpd developers:
---------------------------------------------
Initial disclosure from NAI made reference to specific program functions
not present in WU-FTPD (the features are present, but we use different
program code). The problem, whether simply due to timing or otherwide,
appeared to be related to the recent issues with ProFTPD.

CERT was advised these issues appear to duplicate those raised in CA-99-13.
It was CERT's opinion that, while similar, these were different issues.

Furthermore, CERT tells me that NAI does not believe WU-FTPD is vulnerable
to these problems.

CERT did offer to add the statement that WU-FTPD is not believed to be
vulnerable to the problem, but that offer was made at 10PM Monday; only two
hours before the advisory was published. They obviously couldn't expect
that I'd see it (much less respond to it), before publication.

The best statement which can be made at this time is:

WU-FTPD version 2.6.1 is not believed to be vulnerable to the
issues raised in CA-2001-07. To the best of our knowledge, these
issues duplicate some of those in CA-99-13 and CA-2000-13 and users
are *STRONGLY* advised to upgrade to version 2.6.1 if they have not
already done so.

Without knowing what behavior the DoS made use of, I can only assume it is
the "wildcard globbing" issue which recently effected ProFTPD, and was the
cause of one of the issues raised in CA-99-13.

WU-FTPD 2.6.1 is NOT vulnerable to this type of DoS.

That's not to say you can not legitimately cause the server to DoS the host
.. create a directory with a few million files in it and you should be able
to stop things .. but that's not a WU-FTPD problem and there's probably
nothing we can do to fix or prevent it. It's the risk you take if you
allow write access (via any process or protocol).

The buffer overruns appear to be caused by old code based on BSD and/or
c-shell implementations of the glob function.

WU-FTPD 2.6.1 does NOT contain the vulnerable functions.

While, at one time, our function was based upon the glob functions from
BSD's ftpd, there have been so many changes over the years that our
function now bears little resemblance to anyone else's.

In addition, the published advisories disclose that the overrun is related
to expansion of tilde-user home directories.

WU-FTPD 2.6.1 is NOT vulnerable to a buffer overrun while
expanding tilde-user home directories.

Furthermore,

WU-FTPD 2.6.1 does not appear to be capable of any form of overrun
resulting from glob expansion.

I say this with less conviction simply because the code is complex, was
code-read for CA-2000-13, and I've only just taken a quick look at it to
assure myself that we do check bounds before copying and am not inclined to
pull another full audit without evidence there's something to be found.
----------------------------------------------

Unfortunately, 2.6.1 was release 7/2/00:
From http://www.wu-ftpd.org/
July 2, 2000 WU-FTPD 2.6.1 has been released

Unfortunately, I'm much more concerned with security than support; after all, if the box compromised and trashed, what good is the support?

The decisions on supported/non-supported issue have to do more with someone's comfort level, than fear that HP won't talk about a certain issue because the issues are "not supported". That's a trade-off we each have to reckon on our own.

Thanks for passing the message up the ladder. (P.S. I'm Christopher not Rick ;-) )
Berlene Herren
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

My apologies Christopher! Not enough coffee yet, I suppose :-) There are vulnerabilities in every OS, and sometimes I suppose the code takes some time to be rewritten, some longer than others. But your comments have been forwarded and hopefully, there will be an answer. I will keep you informed.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Shannon Petry
Honored Contributor

Re: wu-ftpd problems on hp-ux 11.00

Here's my 2 cents on the security issues with wu_ftpd...

It is pretty easy to compile your own version of wu, and REMOVE the "site_exec" feature....I dont know if HP has done this or not, but this one function is where more than 99% of the security bugs have been reported for wu.

What does the site_exec do? well, this allows the users to do this...

ftp> mget *.txt ascii.tar
wu will see this as a tar command first, then issue the transfer of the tar file... or
ftp> get bigfile bigfile.Z
wu will compress the file before transfer.

While it is a nice feature, it is pretty simple to produce code working against this!

Even the site_exec feature on HP though, is not as vulnerable as Linux, SCO or SunOS....This is usually exploited by a buffer overflow, which I have NOT seen for HP-UX, at least not yet....

As for HP not supporting....if you got it from the HP supplied sw_depot, then it is supported...if you got it from source or anything else, then it is not....

Regards,
Shannon
Microsoft. When do you want a virus today?