1. 操作系统版本识别
检查发行版信息:
cat /etc/issue
cat /etc/*-release
cat /etc/lsb-release # Debian系
cat /etc/redhat-release # Redhat系
2. 系统内核与架构
查看内核版本和系统位数:
cat /proc/version
uname -a
uname -mrs
rpm -qa kernel # Redhat系
dmesg | grep Linux
ls /boot | grep vmlinuz-
3. 环境信息收集
环境变量与历史记录:
# 系统配置文件
cat /etc/profile
cat /etc/bashrc
# 用户配置文件
cat ~/.bash_profile
cat ~/.bashrc
cat ~/.bash_logout
# 实时环境
env
set
4. 服务与进程分析
查看运行状态:
ps aux
ps -ef
top
cat /etc/services
5. 已安装程序检查
软件包管理:
# 程序目录
ls -alh /usr/bin/
ls -alh /sbin/
# 包管理器
dpkg -l # Debian/Ubuntu
rpm -qa # Redhat/CentOS
# 安装缓存
ls -alh /var/cache/apt/archives # Debian系
ls -alh /var/cache/yum/ # Redhat系
6. 特权进程监控
root权限进程检查:
ps aux | grep root
ps -ef | grep root
7. 计划任务分析
查看用户计划任务
crontab -l # 查看当前用户的计划任务
crontab -l -u root # 查看指定用户(root)的计划任务
检查系统计划任务目录
# 系统cron目录
ls -al /etc/cron*
cat /etc/crontab # 系统主crontab文件
cat /etc/anacrontab # anacron配置
# cron配置权限文件
cat /etc/cron.allow # 允许使用cron的用户
cat /etc/cron.deny # 禁止使用cron的用户
cat /etc/at.allow # 允许使用at的用户
cat /etc/at.deny # 禁止使用at的用户
深入检查cron相关文件
# cron文件存储位置
ls -alh /var/spool/cron # 用户cron任务存储目录
ls -al /etc/ | grep cron # 查找cron相关配置
cat /var/spool/cron/crontabs/root # 查看root的cron任务
8. 敏感信息搜集
在文件中搜索凭据信息
# 基础搜索
grep -i user [filename] # 搜索用户名相关配置
grep -i pass [filename] # 搜索密码相关配置
grep -C 5 'password' [filename] # 显示密码前后5行内容
# 高级搜索技巧
grep -r -i "password" /path/to/dir/ # 递归搜索目录
grep -E "(pwd|pass|password)" [filename] # 使用正则表达式
特定应用配置文件检查
# Joomla
find . -name "*.php" -print0 | xargs -0 grep -i -n "var $password"
# 通用Web应用
find /var/www -name "*.php" -o -name "*.config" | xargs grep -l -i "password"
find /home -name "*.sql" -o -name "*.txt" | xargs grep -l -i "credential"
想了解更多干货,可通过下方扫码关注
可扫码添加上智启元官方客服微信👇