0x00 前言
上次总结了windows系统在内网渗透和提权中的常用命令,这篇总结下linux在内网渗透中常用的命令。
0x01 查看操作系统信息
操作系统版本
1 | cat /etc/issue |
内核版本
1 | cat /proc/version |
环境变量
1 | cat /etc/profile |
0x02 应用和服务
正在运行的程序和权限
1 | ps aux |
如果要查询root权限运行的进程,可以补充为1
2ps aux | grep root
ps -ef | grep root
应用
1 | ls -alh /usr/bin/ |
服务的配置文件
1 | cat /etc/syslog.conf |
计划任务
1 | crontab -l |
存储的明文用户名,密码
1 | grep -i user [filename] |
0x03 网络相关
网络地址
1 | ifconfig -a |
网络配置,DNS,DHCP,网关
1 | cat /etc/resolv.conf |
网络通信
1 | lsof -i |
路由缓存
1 | arp -e |
0x04 用户相关
用户信息
1 | id |
列主目录
1 | ls -ahlR /root/ |
其他用户的操作记录
1 | cat ~/.bash_history |
ssh私钥
1 | cat ~/.ssh/authorized_keys |
0x05 文件系统相关
日志文件
1 | ls -alh /var/log |
网站文件
1 | ls -alhR /var/www/ |
文件挂载
1 | mount |
可写目录
1 | find / -writable -type d 2>/dev/null # 可写目录 |
0x06 准备与攻击
语言支持
1 | find / -name perl* |
上传方式
1 | find / -name wget |
寻找exp
- http://www.exploit-db.com
- http://1337day.com
- http://www.securiteam.com
- http://www.securityfocus.com
- http://www.exploitsearch.net
- http://metasploit.com/modules/
- http://securityreason.com
- http://seclists.org/fulldisclosure/
- http://www.google.com
编译exp
1 | which gcc |
运行exp
1 | chmod +x exp |