linux应急响应

UWI Lv4

常用日志以及配置项

1
2
3
4
5
6
7
/var/log/redis.log
/var/log/auth.log
/etc/sudoers
Windows: <Apache安装目录>\logs\access.log
Linux: /usr/local/apache/logs/access_log


linux排查

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
last 查看所有登录记录
top -c 查看cpu占用率
netstat -anpt 查看外连
cat /proc/$$/mountinfo 查看所有挂载目录
umount /proc/59919 解除挂载
crontab -l 查看定时任务
cat -A /var/spool/cron/crontabs/root 查看隐藏定时任务
history
alias
ps aux | grep pid 查看具体进程的执行命令
lastlog 查看上一次登录用户的时间
netstat -alnpt 查看tcp连接IP地址
cd /user/bi ls -al 更具日期查看是否有篡改命令
find / -perm -u=s -type f 2>/dev/null 查看是否有篡改的提权命令
ssh查看登录成功的日志 cat auth.log.1|grep -a "Accepted "
查找登录失败记录 cat auth.log.1|grep -a "Failed password for root"
查看进程证明lsof -p pid

# 为 file1.txt 增加不可变属性
sudo chattr +i file1.txt
sudo chattr -i file1.txt



# 查找在 3月18日 20:23 到 20:25 之间修改的文件
find / -newermt "2024-05-07 11:37:00" ! -newerat "2024-05-07 11:52:00"
find / -newerat "2024-03-18" ! -newerat "2024-03-18"

11:37 - 11:52

# 如果年份不是当前年,需要指定年份
find /path/to/search -type f -newermt "2024-03-18 20:23:00" ! -newermt "2024-03-18 20:25:00"

访问时间: -atime 或 -newerat
修改时间 -newermt
创建/改变时间: -ctime 或 -newerct
find / -newerct "2024-03-18 20:23:00" ! -newerct "2024-03-18 20:25:00"

redis

1
find / -name "redis.log"   #查找redis的日志 /var/log/redis.log
  • Title: linux应急响应
  • Author: UWI
  • Created at : 2025-09-20 11:33:17
  • Updated at : 2025-11-13 10:50:07
  • Link: https://nbwsws.github.io/2025/09/20/应急响应/linux篇/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
linux应急响应