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
ssh new rule to be added #864
Comments
|
I think, it is not really an attack... (can be just a closed connection); But, during I tried to reproduce this situation, I found another one, that will not be detected from f2b: And although without any known regexp of sshd-filter, such "authentication failed/error", "invalid user ...", "User ... not allowed" etc. Just this one line. |
|
On Mon, 24 Nov 2014, Serg G. Brester wrote:
both of those might be relevant for sshd-ddos where for now we have only Yaroslav O. Halchenko, Ph.D. |
|
I see this more than 8000 times. Furthermore,
On November 25, 2014 3:53:51 AM CET, Yaroslav Halchenko notifications@github.com wrote:
|
@yarikoptic both of those might be relevant for sshd-ddos where for now we have only... I think at least "No supported authentication methods available [preauth]" should be an expression in sshd-filter, because it occurred if I try to connect with invalid method (without key for user with key only or from host not allowed for this user etc.). |
|
An option would be to write a feature request to openssh so they print the host on the same line with the error. Does it make sense? On November 25, 2014 9:31:39 AM CET, "Serg G. Brester" notifications@github.com wrote: @yarikoptic both of those might be relevant for sshd-ddos where for now we have only... |
|
About sense of adding a host in error case: it would be always good, but I don't think you can get it quickly fixed with simple feature request :) Or if sshd gets a system callback (like About a subject self (as long as not fixed) - I believe, it can be an issue/bug by sshd, that can be easy avoided using simple config changes. |
|
@sebres re "unique" string, wouldn't daemon pid (logged as 32686 in the report) suffice? |
|
@yarikoptic nope, because sshd will write many success/info messages with the same pid as well. |
|
that pid is per connection... if there are success/info msgs we would better ignore that anyways as you have described it is merely up to an sshd config tune up but once again -- what should we do about it -- add to sshd-ddos? or not even bother at all since might be just a false positive at times |
|
created a feature request at openssh: |
My server only allows pubkey auth. This error happens when one knows a valid user name but does not have the key. I think it should be added. |
… that is hard-anchored at end or precise sub expression after <HOST>; new ssh rule(s) added: - Connection reset by peer (multi-line line during authorization process); - No supported authentication methods available; Single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions); closes fail2bangh-864
|
@octavsly, @marcosfrm tests of #1209 are welcome |
… that is hard-anchored at end or precise sub expression after <HOST>; new ssh rule(s) added: - Connection reset by peer (multi-line rule during authorization process); - No supported authentication methods available; Single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions); closes fail2bangh-864
… that is hard-anchored at end or precise sub expression after <HOST>; new ssh rule(s) added: - Connection reset by peer (multi-line rule during authorization process); - No supported authentication methods available; Single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions); closes fail2bangh-864
|
I have tested the patch with the code present at the beginning of the ticket, and it works. |
… that is hard-anchored at end or precise sub expression after <HOST>; new ssh rule(s) added: - Connection reset by peer (multi-line rule during authorization process); - No supported authentication methods available; Single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions); closes fail2bangh-864
… that is hard-anchored at end or precise sub expression after <HOST>; new ssh rule(s) added: - Connection reset by peer (multi-line rule during authorization process); - No supported authentication methods available; Single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions); closes fail2bangh-864
sshd-aggressive (new ssh rules added (gh-864) and code review...)
|
Hi there, using the current 0.10 build and running The (for testing-purposes) simplified version UPDATE: The problem is the part |
|
Fixed, Thx... |
ver. 0.9.7 (2017/05/11) - awaiting-victory ----------- 0.9.x line is no longer heavily developed. If you are interested in new features (e.g. IPv6 support), please consider 0.10 branch and its releases. * Fixed a systemd-journal handling in fail2ban-regex (fail2bangh-1657) * filter.d/sshd.conf - Fixed non-anchored part of failregex (misleading match of colon inside IPv6 address instead of `: ` in the reason-part by missing space, fail2bangh-1658) (0.10th resp. IPv6 relevant only, amend for fail2bangh-1479) * config/pathes-freebsd.conf - Fixed filenames for apache and nginx log files (fail2bangh-1667) * filter.d/exim.conf - optional part `(...)` after host-name before `[IP]` (fail2bangh-1751) - new reason "Unrouteable address" for "rejected RCPT" regex (fail2bangh-1762) - match of complex time like `D=2m42s` in regex "no MAIL in SMTP connection" (fail2bangh-1766) * filter.d/sshd.conf - new aggressive rules (fail2bangh-864): - Connection reset by peer (multi-line rule during authorization process) - No supported authentication methods available - single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions), according to fail2bangh-1206; - fixed expression received disconnect auth fail (optional space after port part, fail2bangh-1652) and suffix (logged from several ssh versions), according to fail2bangh-1206; * filter.d/suhosin.conf - greedy catch-all before `<HOST>` fixed (potential vulnerability) * filter.d/cyrus-imap.conf - accept entries without login-info resp. hostname before IP address (fail2bangh-1707) * Filter tests extended with check of all config-regexp, that contains greedy catch-all before `<HOST>`, that is hard-anchored at end or precise sub expression after `<HOST>` * New Actions: - action.d/netscaler: Block IPs on a Citrix Netscaler ADC (fail2bangh-1663) * New Filters: - filter.d/domino-smtp: IBM Domino SMTP task (fail2bangh-1603) * Introduced new log-level `MSG` (as INFO-2, equivalent to 18) * tag '0.9.7': (33 commits) Preparing for 0.9.7 release Added newly added files to MANIFEST update ChangeLog filter.d/exim.conf: added new reason for "rejected RCPT" regex: Unrouteable address try to fix travis integration of pypy3: setuptools recently dropped support for Python 3.0 - 3.2, but old pypy3 based on Python 3.2.5 filter.d/exim.conf: cherry-picked from 0.10, match complex time like `D=2m42s` (closes fail2bangh-1766) Update ChangeLog fail2ban#1757 filter.d/exim.conf: optional part `(...)` after host-name before `[IP]`, normalized over whole config file. BF: specify explicit time offset not a time zone name to avoid needing tzdata during testing Update ChangeLog amend resp. restore of change from 59c35bc (fail2bangh-129): - logging of "Log rotation detected" with new MSG level - introduces new log-level MSG (as INFO-2, 18) Update mysqld-auth.conf Update ChangeLog filter.d/cyrus-imap.conf: fixed `failregex` - accept entries without login-info resp. hostname before IP address evil symlink removed: does not supported by some file systems (e. g. development over net share) sshd-amend: optional space after port part suhosin.conf: removed greedy match sshd.conf: fixed expression "received disconnect ... auth fail" - optional space after port part (fail2bangh-1652) change log update after rebase sshd: additionally aggressive filter rules - no matching cipher resp. no matching key exchange method (fail2bangh-1545, fail2bangh-1117) ...
The following attack is not detected by fail2ban version 0.9.1 (gentoo)
Nov 24 23:46:39 weurope sshd[32686]: SSH: Server;Ltype: Version;Remote: 121.199.22.83-1780;Protocol: 2.0;Client: libssh2_1.4.3
Nov 24 23:46:40 weurope sshd[32686]: SSH: Server;Ltype: Kex;Remote: 121.199.22.83-1780;Enc: aes128-ctr;MAC: hmac-sha1;Comp: none [preauth]
Nov 24 23:46:41 weurope sshd[32686]: SSH: Server;Ltype: Authname;Remote: 121.199.22.83-1780;Name: root [preauth]
Nov 24 23:46:43 weurope sshd[32686]: fatal: Read from socket failed: Connection reset by peer [preauth]
To detect it I did add in sshd.conf the following:
^.Remote: -.\n.*fatal: Read from socket failed: Connection reset by peer [preauth]$
This needs to be changed to a proper/better regexp.
The text was updated successfully, but these errors were encountered: