惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

Deed's博客

解决群晖百度套件提示name "baiduapp" dupliacted - Deed's博客 2023年3月16日 Maven项目引入第三方本地jar包 - Deed's博客 2022年8月23日nginx反向代理配置去除前缀 - Deed's博客 2022年8月1日 ts-node 运行报错`Cannot find name 'console'.` 2022年7月13日 Gradle项目打包相关配置 - Deed's博客 2022年6月23日 Windows 杀死进程 - Deed's博客 2022年6月15日 Linux删除用户 - Deed's博客 2022年6月8日 AntDesignPro文档Demo示例[后置拦截器]报错 - Deed's博客 2022年6月8日 React使用umi.js报错Invalid hook call - Deed's博客
2022年6月16日 查看服务器异常IP访问以及处理 - Deed's博客
Mahalalel · 2022-06-16 · via Deed's博客
«

Mahalalel 发布于 阅读:5308 Linux


背景

小编在登录云服务器时,登录信息显示了如下的一段文字。
There were 8000 failed login attempts since the last successful login.
然后意识到了,这是有人试图攻击我的服务器,进而想进行挖矿或者其他非法行为。

查看

既然有那么多的异常访问,那么肯定是有IP访问记录的。这些都在登录日志里面。
如果想查看的话,日志文件的完整路径是/var/log/secure
可以使用以下命令来查看

tail /var/log/secure

但是文件打开之后,一些关键的信息我们很难筛选出来,那么我们可以使用以下命令来筛选我们需要的信息异常的IP访问

grep筛选

grep "Failed password for root" /var/log/secure | awk '{print $11}' | sort | uniq -c | sort -nr | more

执行命令后,就会显示异常ip以及试图登录次数

参考链接:查看异常ip访问

查看登录失败的用户信息

lastb

此命令可以显示所有的登录信息
登录失败用户信息

禁止IP访问

使用iptables禁止

iptables -I INPUT -s {source_ip} -j DROP

注:{source_ip} 这里要填写上异常ip

Linux 异常IP