大网数据广告活动
服务器运维问答

Does FIN-WAIT-1 mean I was hacked?

· 52CE 我爱测

I'm very new to server security and this is my first post here. Recently, my server has been experiencing many SSH login attempts from unknown sources. A couple of minutes ago I logged in to the server and decided to checkout tcp…

问题原文

原帖链接 · Eugene Epifanov · CC BY-SA 4.0

I'm very new to server security and this is my first post here. Recently, my server has been experiencing many SSH login attempts from unknown sources.

A couple of minutes ago I logged in to the server and decided to checkout tcp sockets by issuing ss -t command and discovered a socket in FIN-WAIT-1 state. I'm not sure what to think about it. Has someone successfully connected?

State                Recv-Q            Send-Q                        Local Address:Port                         Peer Address:Port            
FIN-WAIT-1           0                 69                            139.132.21.45:ssh                        123.156.225.58:36092

Also last command gives me these entries, but I did not login as root today.

root     ttyS0                         Tue Nov  2 17:10   still logged in
reboot   system boot  4.15.0-161-gener Tue Nov  2 17:10   still running

Should I be worried?

已采纳解答

原帖链接 · Massimo · CC BY-SA 4.0

Has someone successfully connected?

Yes, but this doesn't actually mean anything; it only says a TCP connection was established and then closed. There is no relationship with what the remote user was or was not able to do.

Case in point: you connect to a remote host using SSH, then you provide wrong credentials; the server will close the connection. A connection closed by the server will go (for a while) in a FIN-WAIT-1 state. But nobody actually logged it, it was simply a failed login attempt.

my server has been experiencing many SSH login attempts from unknown sources.

If you catch one of those attempts immediately after it failed, a socket in the FIN-WAIT-1 state is exactly what you would see at the network level.


Having said all of the above, you should put some kind of firewall in front of your server (or at the very least configure the system firewall to only allow logins from known, trusted sources); if you leave any computer exposed to the public Internet on common remote administration ports (SSH, RDP, etc.), you are just asking for troubles.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-11-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。