Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetRocks не подключается к старым серверам esxi без специфичных настроек. #2524

Closed
cmdorexe opened this issue Nov 22, 2024 · 10 comments

Comments

@cmdorexe
Copy link
Contributor

Соединение из NetRocks с старыми серверами
на некоторые старые сервера вход получается только при выставленном в [ Protocol options ] ⇒ Authentication: ⇒ Interactive login / [ Настр. протокола ] ⇒ Авторизация: ⇒ Интерактивный логин

shell на него не работает, scp из NetRocks удалось подружить, но фар ничего не выводит. Посмотрел логи:
Пришла команда:
'LC_TIME=C LS_COLORS= ls -f -l -A -H . '
И сразу ошибка на флаг -f с выводом справки на busybox.

Но при Interactive login все работает нормально.

@elfmz
Copy link
Owner

elfmz commented Dec 4, 2024

а можно увидеть что на той системе печатает последовательность команд:

ls -f -l -A -H .
echo $?

@elfmz
Copy link
Owner

elfmz commented Dec 4, 2024

а так же:
readlink /bin/sh
и

busybox
echo $?

@cmdorexe
Copy link
Contributor Author

cmdorexe commented Dec 4, 2024

ls -f -l -A -H .
ls: invalid option -- 'f'
BusyBox v1.20.2 (2012-12-11 11:54:28 PST) multi-call binary.

Usage: ls [-1AaCxdLHRFplinsehrSXvctu] [-w WIDTH] [FILE]...

List directory contents

        -1      One column output
        -a      Include entries which start with .
        -A      Like -a, but exclude . and ..
        -C      List by columns
        -x      List by lines
        -d      List directory entries instead of contents
        -L      Follow symlinks
        -H      Follow symlinks on command line
        -R      Recurse
        -p      Append / to dir entries
        -F      Append indicator (one of */=@|) to entries
        -l      Long listing format
        -i      List inode numbers
        -n      List numeric UIDs and GIDs instead of names
        -s      List allocated blocks
        -e      List full date and time
        -h      List sizes in human readable format (1K 243M 2G)
        -r      Sort in reverse order
        -S      Sort by size
        -X      Sort by extension
        -v      Sort by version
        -c      With -l: sort by ctime
        -t      With -l: sort by mtime
        -u      With -l: sort by atime
        -w N    Assume the terminal is N columns wide
        --color[={always,never,auto}]   Control coloring
echo $?
1
readlink /bin/sh
/usr/lib/vmware/busybox/bin/busybox
busybox
-sh: busybox: not found
echo $?
127

@elfmz
Copy link
Owner

elfmz commented Dec 4, 2024

а можете собрать тестовый far2l из ветки busybox-dbg-2524 и попробовать с ним?

@cmdorexe
Copy link
Contributor Author

cmdorexe commented Dec 4, 2024

попробовал: приходит Authentication - retry

на стороне esxi:

2024-12-04T21:29:03Z sshd[173848750]: /etc/ssh/sshd_config line 7: Deprecated option UsePrivilegeSeparation
2024-12-04T21:29:03Z sshd[173848750]: /etc/ssh/sshd_config line 15: Unsupported option PrintLastLog
2024-12-04T21:29:03Z sshd[173848750]: Connection from 192.168.0.1 port 60798
2024-12-04T21:29:04Z sshd[173848750]: Received disconnect from 192.168.0.1 port 60798:11: Bye Bye [preauth]
2024-12-04T21:29:04Z sshd[173848750]: Disconnected from authenticating user user 192.168.0.1 port 60798 [preauth]
2024-12-04T21:29:05Z sshd[173848754]: /etc/ssh/sshd_config line 7: Deprecated option UsePrivilegeSeparation
2024-12-04T21:29:05Z sshd[173848754]: /etc/ssh/sshd_config line 15: Unsupported option PrintLastLog
2024-12-04T21:29:05Z sshd[173848754]: Connection from 192.168.0.1 port 33692
2024-12-04T21:29:05Z sshd[173848754]: Received disconnect from 192.168.0.1 port 33692:11: Bye Bye [preauth]
2024-12-04T21:29:05Z sshd[173848754]: Disconnected from authenticating user user 192.168.0.1 port 33692 [preauth]
2024-12-04T21:29:06Z sshd[173848761]: /etc/ssh/sshd_config line 7: Deprecated option UsePrivilegeSeparation
2024-12-04T21:29:06Z sshd[173848761]: /etc/ssh/sshd_config line 15: Unsupported option PrintLastLog
2024-12-04T21:29:06Z sshd[173848761]: Connection from 192.168.0.1 port 33696
2024-12-04T21:29:06Z sshd[173848761]: Received disconnect from 192.168.0.1 port 33696:11: Bye Bye [preauth]
2024-12-04T21:29:06Z sshd[173848761]: Disconnected from authenticating user user 192.168.0.1 port 33696 [preauth]

@cmdorexe
Copy link
Contributor Author

cmdorexe commented Dec 4, 2024

При interactive logon:

2024-12-04T21:42:20Z sshd[173850969]: Connection from 192.168.0.1 port 58916
2024-12-04T21:42:20Z sshd[173850971]: pam_per_user: create_subrequest_handle(): doing map lookup for user "user"
2024-12-04T21:42:20Z sshd[173850971]: pam_per_user: create_subrequest_handle(): creating new subrequest (user="user", service="system-auth-generic")
2024-12-04T21:42:20Z sshd[173850969]: Accepted keyboard-interactive/pam for user from 192.168.0.1 port 58916 ssh2
2024-12-04T21:42:20Z sshd[173850969]: pam_per_user: create_subrequest_handle(): doing map lookup for user "user"
2024-12-04T21:42:20Z sshd[173850969]: pam_per_user: create_subrequest_handle(): creating new subrequest (user="user", service="system-auth-generic")
2024-12-04T21:42:20Z sshd[173850969]: pam_unix(system-auth-generic:session): session opened for user user by (uid=0)
2024-12-04T21:42:20Z sshd[173850969]: User 'user' running command 'stat --format="%n %f %s %X %Y %Z %U %G" -L .'
2024-12-04T21:42:20Z sshd[173850969]: User 'user' running command 'readlink /bin/sh'
2024-12-04T21:42:20Z sshd[173850969]: User 'user' running command '/usr/lib/vmware/busybox/bin/busybox 2>&1'
2024-12-04T21:42:20Z sshd[173850969]: User 'user' running command 'LC_TIME=C LS_COLORS= ls -l -A -H . '
2024-12-04T21:42:20Z sshd[173850969]: User 'user' running command 'LC_TIME=C LS_COLORS= ls -l -A -d -H ./altbootbank ./bootbank ./locker ./productLocker ./sbin ./scratch ./store ./vmupgrade '

@elfmz
Copy link
Owner

elfmz commented Dec 5, 2024

..ии что в результате в NetRocks происходит при interactive logon?
И что печатает команда ls -l -A -d -H ./altbootbank ./bootbank ./locker ./productLocker ./sbin ./scratch ./store ./vmupgrade если ее самому написать в том шелле ?

@cmdorexe
Copy link
Contributor Author

cmdorexe commented Dec 5, 2024

При interactive все хорошо.

Вывод команды:

s -l -A -d -H ./altbootbank ./bootbank ./locker ./productLocker ./sbin ./scratch ./store ./vmupgrade
ls: ./vmupgrade: No such file or directory
drwxr-xr-x    1 root     root             8 Jan  1  1970 ./altbootbank
drwxr-xr-x    1 root     root             8 Jan  1  1970 ./bootbank
drwxr-xr-x    1 root     root             8 Jan  1  1970 ./locker
drwxr-xr-x    1 root     root             8 Sep 16  2020 ./productLocker
drwxr-xr-x    1 root     root           512 Dec 12  2022 ./sbin
drwxr-xr-x    1 root     root           980 Dec 12  2022 ./scratch
drwxr-xr-x    1 root     root             8 Jan  1  1970 ./store

@elfmz
Copy link
Owner

elfmz commented Dec 5, 2024

А то есть пофиксилось? ну ок, а вот что касается поддержки не интерактивного входа - то тут ничего не починить, раз сервер в него не умеет. Можно разве что сделать автодетект - типа пробовать вначале неинтерактивный, а потом интерактивный вход, но тогда возникают некоторые ньюансы:

  • не откроет ли это какой либо способ MiM атакующему стырить ваш пароль
  • не станет ли это у когонить причиной account lockout-а, так как в такой реализации любой неправильный ввод пароля будет удваивать количество неудачных попыток логина под акаунтом

@cmdorexe
Copy link
Contributor Author

cmdorexe commented Dec 5, 2024

Да пофиксилось, теперь все работает как и было задуманно.
Спасибо.

@elfmz elfmz closed this as completed Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants