Автор Тема: не пойму кто отбивает сетевое соединение  (Прочитано 1096 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн v4567

  • Постоялец
  • ***
  • Сообщений: 121
  • Рейтинг: 0
  • Пол: Мужской
    • Просмотр профиля
  • Откуда: Харьков
Есть Gentoo Base System release 1.12.9 на ней установлен pure-ftpd, вот его конфиг:
# Config file for /etc/init.d/pure-ftpd
##Comment variables out to disable its features, or change the values in it... ##

## This variable must be uncommented in order for the server to start ##
IS_CONFIGURED="yes"

## FTP Server,Port (separated by comma) ##
## If you prefer host names over IP addresses, it's your choice:
## SERVER="-S ftp.rtchat.com,21"
## IPv6 addresses are supported.
## !!! WARNING !!!
## Using an invalid IP will result in the server not starting,
## but reporting a correct start!
## SERVER="-S 192.168.0.1,21"
## By default binds to all available IPs.
SERVER="-S 21"

## Number of simultaneous connections in total, and per IP ##
MAX_CONN="-c 50"
MAX_CONN_IP="-C 15"

## Start daemonized in background ##
DAEMON="-B"

## Don't allow uploads if the partition is more full then this var ##
DISK_FULL="-k 95%"

## If your FTP server is behind a NAT box, uncomment this ##
#USE_NAT="-N"

## Authentication mechanisms (others are 'pam', ...) ##
## Further infos can be found in the README file.
AUTH="-l mysql:/etc/pureftpd/mysql.conf"
## Change the maximum idle time (in minutes) ##
## If this variable is not defined, it will default to 15 minutes.
TIMEOUT="-I 2"

## Facility used for syslog logging ##
## If this variable is not defined, it will default to the 'ftp' facility.
## Logging can be disabled with '-f none'.
#LOG="-f <facility>"

## Charset conversion support *experimental* ##
## Only works if USE "charconv" is enabled (only Pure-FTPd >=1.0.21).
## Set the charset of the filesystem.
CHARCONV="--fscharset utf-8 --clientcharset cp1251"

## If you want to process each file uploaded through Pure-FTPd, enter the name
## of the script that should process the files below.
## man pure-uploadscript to learn more about how to write this script.
# UPLOADSCRIPT="/path/to/uploadscript"

## Misc. Others ##
MISC_OTHER="-A -j -Z -M -s -u 20 -b -U 113:002"
# Temporary settings while system under hackers attack
#MISC_OTHER="-A -j -Z -e -M -s -u 20 -b -U 113:002"
#
# Use these inside $MISC_OTHER
# More can be found on "http://download.pureftpd.org/pub/pure-ftpd/doc/README"
#
# -A [ chroot() everyone, but root ]
# -e [ Only allow anonymous users ]
# -E [ Only allow authenticated users. Anonymous logins are prohibited. ]
# -i [ Disallow upload for anonymous users, whatever directory perms are ]
# -j [ If the home directory of a user doesn't exist, auto-create it ]
# -M [ Allow anonymous users to create directories. ]
# -R [ Disallow users (even non-anonymous ones) usage of the CHMOD command ]
# -x [ In  normal  operation mode, authenticated users can read/write
#       files beginning with a dot ('.'). Anonymous users can't, for security reasons
#       (like changing banners or a forgotten .rhosts). When '-x' is used, authenticated
#       users can download dot-files, but not overwrite/create  them,  even  if they own
#       them. ]
# -X [ This  flag  is  identical  to  the  previous one (writing
#       dot-files is prohibited), but in addition, users can't even *read* files and
#       directories beginning with a dot (like "cd .ssh"). ]
# -D [ List files beginning with a dot ('.') even when the client doesn't
#      append the '-a' option to the list command. A workaround for badly
#      configured FTP clients. ]
# -G [ Disallow renaming. ]
# -d [ Send various debugging messages to the syslog. ONLY for DEBUG ]
# -F <fortune file> [ Display a fortune cookie on login. Check the README file ]
# -H [ By default, fully-qualified host names are logged. The '-H' flag avoids host names resolution. ]



На этом pure-ftpd заведены пользователи, так вот под одним пользователем со своего компьютера я прекрасно захожу в папку pure-ftpd принадлежащую этому пользователю, а с другого компьютера этим же пользователем (у этого компьютера другой внешний ip, не тот который на компьютере с которого я прекрасно захожу) зайти не могу, причём сервер третьим пакетом начинает закрывать соединение. Дело не доходит даже до проверки логина и пароля. На iptables доступ для этого компьютера открыт!

сейчас приведу вывод команды tcpdump - это для компьютера с которого нормально захожу:

сервер пусть будет 11.11.11.11 клиент 22.22.22.22
15:52:39.397767 IP 22.22.22.22.1234 > 11.11.11.11.21: S 474479167:474479167(0) win 29200 <mss 1460,sackOK,timestamp 6628672 0,nop,wscale 7>
        0x0000:  4590 003c df7f 4000 3406 bcbc 5f45 a534  E..<..@.4..._E.4
        0x0010:  c113 e462 2533 0015 1c47 fa3f 0000 0000  ...b%3...G.?....
        0x0020:  a002 7210 ca8b 0000 0204 05b4 0402 080a  ..r.............
        0x0030:  0065 2540 0000 0000 0103 0307            .e%@........
15:52:39.397790 IP 11.11.11.11.21 > 22.22.22.22.1234: S 3398055926:3398055926(0) ack 474479168 win 5792 <mss 1460,sackOK,timestamp 453334982 6628672,nop,wscale 6>
        0x0000:  4500 003c 0000 4000 4006 90cc c113 e462  E..<..@.@......b
        0x0010:  5f45 a534 0015 2533 ca8a 37f6 1c47 fa40  _E.4..%3..7..G.@
        0x0020:  a012 16a0 b09f 0000 0204 05b4 0402 080a  ................
        0x0030:  1b05 57c6 0065 2540 0103 0306            ..W..e%@....
15:52:39.412750 IP 22.22.22.22.1234 > 11.11.11.11.21: . ack 1 win 229 <nop,nop,timestamp 6628688 453334982>
        0x0000:  4590 0034 df80 4000 3406 bcc3 5f45 a534  E..4..@.4..._E.4
        0x0010:  c113 e462 2533 0015 1c47 fa40 ca8a 37f7  ...b%3...G.@..7.
        0x0020:  8010 00e5 f515 0000 0101 080a 0065 2550  .............e%P
        0x0030:  1b05 57c6                                ..W.
15:52:39.414146 IP 11.11.11.11.21 > 22.22.22.22.1234: P 1:214(213) ack 1 win 91 <nop,nop,timestamp 453334986 6628688>
        0x0000:  4510 0109 603d 4000 4006 2fb2 c113 e462  E...`=@.@./....b
        0x0010:  5f45 a534 0015 2533 ca8a 37f7 1c47 fa40  _E.4..%3..7..G.@
        0x0020:  8018 005b 6f24 0000 0101 080a 1b05 57ca  ...[o$........W.
        0x0030:  0065 2550 3232 302d 2d2d 2d2d 2d2d 2d2d  .e%P220---------
        0x0040:  2d20 5765 6c63 6f6d 6520 746f 2050 7572  -.Welcome.to.Pur
        0x0050:  652d 4654 5064 205b 7072 6976 7365 705d  e-FTPd.[privsep]
        0x0060:  205b 544c 535d 202d 2d2d 2d2d 2d2d 2d2d  .[TLS].---------
        0x0070:  2d0d 0a32 3230 2d59 6f75 2061 7265 2075  -..220-You.are.u
        0x0080:  7365 7220 6e75 6d62 6572 2031 206f 6620  ser.number.1.of.
        0x0090:  3530 2061 6c6c 6f77 6564 2e0d 0a32 3230  50.allowed...220
        0x00a0:  2d4c 6f63 616c 2074 696d 6520 6973 206e  -Local.time.is.n
        0x00b0:  6f77 2031 353a 3532 2e20 5365 7276 6572  ow.15:52..Server
        0x00c0:  2070 6f72 743a 2032 312e 0d0a 3232 3020  .port:.21...220.
        0x00d0:  596f 7520 7769 6c6c 2062 6520 6469 7363  You.will.be.disc
        0x00e0:  6f6e 6e65 6374 6564 2061 6674 6572 2032  onnected.after.2
        0x00f0:  206d 696e 7574 6573 206f 6620 696e 6163  .minutes.of.inac
        0x0100:  7469 7669 7479 2e0d 0a                   tivity...
15:52:39.429294 IP 22.22.22.22.1234 > 11.11.11.11.21: . ack 214 win 237 <nop,nop,timestamp 6628704 453334986>
        0x0000:  4590 0034 df81 4000 3406 bcc2 5f45 a534  E..4..@.4..._E.4
        0x0010:  c113 e462 2533 0015 1c47 fa40 ca8a 38cc  ...b%3...G.@..8.
и т.д.

и вот для компьютера с которого не могу зайти:

сервер 11.11.11.11    клиент 33.33.33.33

17:18:30.931779 IP 33.33.33.33.1234 > 11.11.11.11.21: S 1003791188:1003791188(0) win 8192 <mss 1460,nop,wscale 8,nop,nop,sackOK>
        0x0000:  4500 0034 05df 4000 7b06 d297 2eac 532b  E..4..@.{.....S+
        0x0010:  c113 e462 fadd 0015 3bd4 a354 0000 0000  ...b....;..T....
        0x0020:  8002 2000 4da7 0000 0204 05b4 0103 0308  ....M...........
        0x0030:  0101 0402                                ....
17:18:30.931799 IP 11.11.11.11.21 > 33.33.33.33.1234: S 236703472:236703472(0) ack 1003791189 win 5840 <mss 1460,nop,nop,sackOK,nop,wscale 6>
        0x0000:  4500 0034 0000 4000 4006 1377 c113 e462  E..4..@.@..w...b
        0x0010:  2eac 532b 0015 fadd 0e1b cef0 3bd4 a355  ..S+........;..U
        0x0020:  8012 16d0 79bc 0000 0204 05b4 0101 0402  ....y...........
        0x0030:  0103 0306                                ....
17:18:30.934982 IP 33.33.33.33.1234 > 11.11.11.11.21: . ack 1 win 256
        0x0000:  4500 0028 05e0 4000 7b06 d2a2 2eac 532b  E..(..@.{.....S+
        0x0010:  c113 e462 fadd 0015 3bd4 a355 0e1b cef1  ...b....;..U....
        0x0020:  5010 0100 d05d 0000 0000 0000 0000       P....]........
17:18:30.952367 IP 11.11.11.11.21 > 33.33.33.33.1234: F 1:1(0) ack 1 win 92
        0x0000:  4500 0028 3019 4000 4006 e369 c113 e462  E..(0.@.@..i...b
        0x0010:  2eac 532b 0015 fadd 0e1b cef1 3bd4 a355  ..S+........;..U
        0x0020:  5011 005c d100 0000                      P..\....
17:18:30.958407 IP 33.33.33.33.1234 > 11.11.11.11.21: . ack 2 win 256
        0x0000:  4500 0028 05e1 4000 7b06 d2a1 2eac 532b  E..(..@.{.....S+
        0x0010:  c113 e462 fadd 0015 3bd4 a355 0e1b cef2  ...b....;..U....
        0x0020:  5010 0100 d05c 0000 0000 0000 0000       P....\........
17:18:30.958824 IP 11.11.11.11.21 > 33.33.33.33.1234: R 1:1(0) ack 2 win 0
        0x0000:  4500 0028 05e2 4000 7b06 d2a0 2eac 532b  E..(..@.{.....S+
        0x0010:  c113 e462 fadd 0015 3bd4 a355 0e1b cef2  ...b....;..U....
        0x0020:  5014 0000 d158 0000 0000 0000 0000       P....X........
и всё!


как видно сервер вот в этой строке:
17:18:30.952367 IP 11.11.11.11.21 > 33.33.33.33.1234: F 1:1(0) ack 1 win 92


Сервер начинает закрывать сетевое соединение. В логаг pure-ftpd ТИШИНА!
Вопрос номер один, как в pure-ftpd включить подробнейшее логирование?

И вопрос номер два, я не пойму кто начинает закрывать сетевое соединение pure-ftpd или ядро, на iptables ТОЧНО ОТКРЫТО!

Во всех запрещающих списках на сервере просмотрел, нигде запретов для этого клиента нет.
Клиент пробовал из разных программ - тотал, клиенты ftp разные, far и т.д.

За любую помощь буду благодарен!