======Flowerfire SawMill 5.0.21 file access & weak hash bug======

**Vendor:** Notified.
**Link:** http://www.flowerfire.com/sawmill **Bugtraq ID:** 1402

SawMill is a site log statistics package for UNIX, Windows and MacOS. I have been evaluating it under Linux.

In my test configuration I have sawmill listening on port 8987 of my webserver. I noticed two things.

//**Dangerous**//

You can get sawmill to read you the first line of any (if run as nobody) world readable files without needing to authenticate first.

The following will print the first line of /etc/passwd:

http://target-domain:8987/sawmill?rfcf+%22/etc/passwd%22+spbn+1,1,21,1,1,1,1,1,1,1,1,1+3

Sawmill can also be run as a cgi script. This method is vulnerable as well.

The following will print the first line of the password file:

http://target-domain/cgi-bin/sawmill5?rfcf+%22/etc/passwd%22+spbn+1,1,21,1,1,1,1

The following will print the password hash for the sawmill administrator account.

http://target-domain:8987/sawmill?rfcf+"SawmillInfo/SawmillPassword"

You can imagine how much more fun this would be if it was launched as root. Which it should not and does not need to be.

//**More Danger**//
**Bugtraq ID:**1403

2) The password is stored with a weak substitution cypher and can be de-crypted using the attached C program. This is dangerous because the previous security hole will allow you to read the first line of the sawmill/SawmillInfo/SawmillPassword decrypt the password and access the site statistics, reconfigure sawmill. Along with the ability to browse the remote machines drive contents. If this is being run as root then the attacker can specify root readonly files as log files and read most if not all of their contents.

file info: sawmill5.0.21trial_x86_linux.tar.gz

I have notified the vendor and they were very responsive and are providing a fixed version for free.

This is a PocketC program that will de-hash the sawmill admin password on your PDA, I developed and tested it on my Palm IIIxe during a flight to boston.

I broke the encryption scheme using an "Adaptive-chosen-plain text attack". See Applied Cryptography, by Bruce Schneier.