
29th August 2008, 17:40
|
|
Junior Member
|
|
Join Date: Aug 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Serious security issue in proftpd/mysql/Debian-Howto
Hi there,
apart from the fact that the proftpd/mysql/Debian-Howto
http://www.howtoforge.com/vsftpd_mysql_debian_etch
is simply brilliant, we figured out a pretty serious security hole:
This configuration enables system users to log in via FTP using an exclamation mark ("!") as password. On one of our Dev-Servers, I was able to log in as
ftp
proftpd
mysql
sshd
...with full access to the respective home dirs, which may be fatal if you've got your mysql on the same machine.
This can be solved by adding
AuthOrder mod_sql.c
to proftpd.conf.
greets,
marcus
|

30th August 2008, 18:38
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
Quote:
Originally Posted by marcusr
|
Proftpd or vsftpd?
|

30th August 2008, 18:48
|
|
HowtoForge Supporter
|
|
Join Date: May 2006
Posts: 238
Thanks: 0
Thanked 12 Times in 11 Posts
|
|
I'm unable to replicate this behaviour in my production environment.
|

30th August 2008, 21:38
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
Quote:
Originally Posted by Norman
I'm unable to replicate this behaviour in my production environment.
|
Same here.. I can not replicate this problem on my Debian Etch systems with ProFTPD
__________________
Never execute code written on a Friday or a Monday.
|

30th August 2008, 23:53
|
|
Junior Member
|
|
Join Date: Aug 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by falko
Proftpd or vsftpd?
|
whoops... pasted the wrong link there. that was supposed to link to the proftpd howto a few lines below...
I can replicate this behaviour on two machines now, both run on etch, I followed the howto nearly 1:1. I assume the plaintext login is the reason...
one of these machines is productive and someone already tried to run phpshell ok it - which didn't succeed because the FTP homedir is outside the webroot.
Google 'nyck.php' gives some interesting hits...
|

31st August 2008, 01:48
|
|
Member
|
|
Join Date: Oct 2007
Posts: 91
Thanks: 10
Thanked 2 Times in 2 Posts
|
|
I was not able to replicate this with my Centos 5.2 install either.
|

31st August 2008, 02:33
|
|
HowtoForge Supporter
|
|
Join Date: May 2006
Posts: 238
Thanks: 0
Thanked 12 Times in 11 Posts
|
|
Could you post your proftpd.conf ?
|

1st September 2008, 17:03
|
|
Junior Member
|
|
Join Date: Aug 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi,
here's my proftpd.conf (large comments left out)
Code:
------8<-------
Include /etc/proftpd/modules.conf
ServerName "Debian"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin welcome.msg
DisplayFirstChdir .message
ListOptions "-l"
UseIPv6 off
# (if i add this, everything's ok). without, the "!"-problem returns:
# AuthOrder mod_sql.c
DenyFilter \*.*/
Port 21
MaxInstances 30
# Set the user and group that the server normally runs at.
User ftpuser
Group ftpgroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
DefaultRoot ~
UseReverseDNS off
IdentLookups off
<Global>
RootLogin off
#RequireValidShell on
</Global>
# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users groups
# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo ftp@localhost proftpd xxxxxxx
# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo ftpuser userid passwd uid gid homedir shell
# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo ftpgroup groupname gid members
# set min UID and GID - otherwise these are 999 each
SQLMinID 500
# create a user's home directory on demand if it doesn't exist
SQLHomedirOnDemand on
# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_
avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ft
pquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2
}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type =
'%{7}'" ftpquotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
RootLogin off
RequireValidShell off
------>8-------
proftpd 1.3.0-19
proftpd-common 1.2.10-15sarge4
proftpd-mysql 1.3.0-19
bye,
marcus
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 19:03.
|
|
Recent comments
9 hours 52 min ago
19 hours 19 min ago
20 hours 9 min ago
23 hours 42 min ago
1 day 4 hours ago
1 day 4 hours ago
1 day 6 hours ago
1 day 16 hours ago
1 day 21 hours ago
1 day 23 hours ago