ANTICHAT.XYZ    VIDEO.ANTICHAT.XYZ    НОВЫЕ СООБЩЕНИЯ    ФОРУМ  
Баннер 1   Баннер 2
Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей. Здесь обсуждаются безопасность, программирование, технологии и многое другое. Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
Вернуться   Форум АНТИЧАТ > Безопасность и Уязвимости > Безопасность > *nix
   
Ответ
 
Опции темы Поиск в этой теме Опции просмотра

разъясните аномалию pure-ftpd+mysql
  #1  
Старый 01.02.2010, 18:36
$n@ke
Постоянный
Регистрация: 18.09.2006
Сообщений: 867
Провел на форуме:
2805813

Репутация: 1396


По умолчанию разъясните аномалию pure-ftpd+mysql

1. Unix сервер, на нем pure-ftpd+mysql. Смотрим крон
crontab -l | grep -i ftp
#10 * * * * /root/ftp.sh

2. В Этом .sh файле
PHP код:
/usr/local/sbin/pure-ftpd -l mysql:/usr/local/pureftpd-mysql.conf  -----T 1000 -c 150 -C 5  yes -p 50000:50200 --tls=1   
3. в файле usr/local/pureftpd-mysql.conf

PHP код:
cat /usr/local/pureftpd-mysql.conf
##############################################
#                                            #
# Sample Pure-FTPd Mysql configuration file. #
# See README.MySQL for explanations.         #
#                                            #
##############################################


# Optional : MySQL server name or IP. Don't define this for unix sockets.

 
MYSQLServer     192.168.1.5


# Optional : MySQL port. Don't define this if a local unix socket is used.

 
MYSQLPort       3306


# Optional : define the location of mysql.sock if the server runs on this host.

#MYSQLSocket     /var/lib/mysql/mysql.sock


# Mandatory : user to bind the server as.

MYSQLUser      mysqlftp


# Mandatory : user password. You must have a password.

MYSQLPassword  ftp@mysql331


# Mandatory : database to open.

MYSQLDatabase   ftpbase


# Mandatory : how passwords are stored
# Valid values are : "cleartext", "crypt", "md5" and "password"
# ("password" = MySQL password() function)
# You can also use "any" to try "crypt", "md5" *and* "password"

MYSQLCrypt      cleartext


# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.


# Query to execute in order to fetch the password

MYSQLGetPW      SELECT Password FROM ftp_users WHERE User="\L" and status='live'


# Query to execute in order to fetch the system user name or uid

MYSQLGetUID     SELECT Uid FROM ftp_users WHERE User="\L"


# Query to execute in order to fetch the system user group or gid

MYSQLGetGID     SELECT Gid FROM ftp_users WHERE User="\L"


# Query to execute in order to fetch the home directory

MYSQLGetDir     SELECT Dir FROM ftp_users WHERE User="\L"


# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.

# MySQLGetQTAFS  SELECT Quota FROM ftp_users WHERE User="\L"


# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.

MySQLGetQTASZ  SELECT Quota FROM ftp_users WHERE User="\L"


# Optional : ratios. The server has to be compiled with ratio support.

# MySQLGetRatioUL SELECT ULRatio FROM ftp_users WHERE User="\L"
# MySQLGetRatioDL SELECT DLRatio FROM ftp_users WHERE User="\L"


# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in Kb/s .

# MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L"
# MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L"


# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.

# MySQLTransactions On 
4. Коннектимся к БД и видим что база изменялась сегодня, значит по идее - рабочая. Сливаем. размер 1мег. в ней вот такого подобия акки:

PHP код:
INSERT INTO `ftp_users`(`User`, `DomainName`, `Password`, `Quota`, `Uid`, `Gid`, `Dir`, `status`, `ptext`, `ExpDate`, `IP`) VALUES ('wrHpmScoRC''google.com''Q1aFb5t7pPv''100''15383''150''/webdir/hostdir/google.com/./''live''RFQ1aFb5t7pPv''''');

INSERT INTO `ftp_users`(`User`, `DomainName`, `Password`, `Quota`, `Uid`, `Gid`, `Dir`, `status`, `ptext`, `ExpDate`, `IP`) VALUES ('qndqndq6563QN6182''yahoo.com''deccyan01''100''14591''150''/webdir/hostdir/yahoo.com/./''live''pldeccyan01'''''); 
привел две записи, чтоб было понятно: Есть зависимость ptext от Password.

5. Получаем невалид фтп акки. Почему-то. Вопрос:
Почему???


Если рестартую руками фтпд через этот файл ftp.sh - то все акки подходят и все норм.
вывод - ничо не ясно.толи ханипот, то ли еще что-то. Но зачем тогда бд обновлять ??
pure-ftpwho показывает что есть юзеры на серваке, и логины совпадают с теми что в слитой БД.

Буду рад дельному совету.

Последний раз редактировалось $n@ke; 01.02.2010 в 18:48..
 
Ответить с цитированием
Ответ



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
20 хороших советов по MySQL. root_sashok Чужие Статьи 0 01.12.2009 16:37
Защита БД MySQL от SQL инъекций с помощью GreenSQL xcedz Администрирование 5 02.04.2009 21:46
SQL injection в MySql сервере версии 3,x bandera Чужие Статьи 3 04.06.2006 16:17
Общие Рекомендации Защиты (MySQL и SQL Web-интерфейс) k00p3r Чужие Статьи 0 13.06.2005 11:22
Защищаем MySql. Шаг за шагом k00p3r Чужие Статьи 0 13.06.2005 11:18



Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT.XYZ