Linux信息收集常用命令17认证网

正规官方授权
更专业・更权威

Linux信息收集常用命令

1. 操作系统版本识别

检查发行版信息:

cat /etc/issuecat /etc/*-releasecat /etc/lsb-release      # Debian系cat /etc/redhat-release   # Redhat系

2. 系统内核与架构

查看内核版本和系统位数:

cat /proc/versionuname -auname -mrsrpm -qa kernel            # Redhat系dmesg | grep Linuxls /boot | grep vmlinuz-

3. 环境信息收集

环境变量与历史记录:

# 系统配置文件cat /etc/profilecat /etc/bashrc
# 用户配置文件cat ~/.bash_profilecat ~/.bashrccat ~/.bash_logout
# 实时环境envset

4. 服务与进程分析

查看运行状态:

ps auxps -eftopcat /etc/services

5. 已安装程序检查

软件包管理:

# 程序目录ls -alh /usr/bin/ls -alh /sbin/
# 包管理器dpkg -l                    # Debian/Ubunturpm -qa                    # Redhat/CentOS
# 安装缓存ls -alh /var/cache/apt/archives   # Debian系ls -alh /var/cache/yum/           # Redhat系

6. 特权进程监控

root权限进程检查:

ps aux | grep rootps -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] # 使用正则表达式

特定应用配置文件检查

# Joomlafind . -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"

想了解更多干货,可通过下方扫码关注

可扫码添加上智启元官方客服微信👇

未经允许不得转载:17认证网 » Linux信息收集常用命令
分享到:0

评论已关闭。

400-663-6632
咨询老师
咨询老师
咨询老师