Linux命令
2020-05-18 11:55:07 1 举报
AI智能生成
Linux安全类命令汇总
作者其他创作
大纲/内容
交互shell命令行
python -c 'import pty;pty.spawn("/bin/sh")'
内核版本
cat /proc/version
uname -a
uname -mrs
rpm -q kernel
dmesg | grep Linux
ls /boot | grep vmlinuz
查看正在运行的程序及对应的用户权限
ps aux
ps -ef
top
cat /etc/services
查看安装了的应用
ls -alh /user/bin/
ls -alh /sbin/
dpkg -l
rpm -qa
ls -alh /var/cache/apt/archives
ls -alh /var/cache/yum
计划任务
crontab -l
ls -alh /var/spool/cron
ls -al /etc/ | grep cron
ls -al /etc/cron*
cat /etc/cron*
cat /etc/at.allow
cat /etc/at.deny
cat /etc/cron.allow
cat /etc/cron.deny
cat /etc/crontab
cat /etc/anacrontab
cat /var/spool/cron/crontabs/root
查看当前网络地址
/sbin/ifconfig -a
cat /etc/network/interfaces
cat /etc/sysconfig/network
查看网络通信
lsof -i
lsof -i :80
grep 80 /etc/services
netstat -antup
netstat -antpx
netstat -tulpn
chkconfig --list
chkconfig --list | grep 3:on
last
w
查看用户信息
id
who
w
last
cat /etc/passwd
cat /etc/group
cat /etc/shadow
ls -alh /var/mail/
grep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}'
列出超级用户
awk -F: '($3 == "0") {print}' /etc/passwd
列出超级用户
cat /etc/sudoers
sudo -l
从配置文件里面寻找密码
cat /var/apache2/config.inc
cat /var/lib/mysql/mysql/user.MYD
cat /root/anaconda-ks.cfg
ssh 私钥
cat ~/.ssh/authorized_keys
cat ~/.ssh/identity.pub
cat ~/.ssh/identity
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa
cat ~/.ssh/id_dsa.pub
cat ~/.ssh/id_dsa
cat /etc/ssh/ssh_config
cat /etc/ssh/sshd_config
cat /etc/ssh/ssh_host_dsa_key.pub
cat /etc/ssh/ssh_host_dsa_key
cat /etc/ssh/ssh_host_rsa_key.pub
cat /etc/ssh/ssh_host_rsa_key
cat /etc/ssh/ssh_host_key.pub
cat /etc/ssh/ssh_host_key
cat ~/.ssh/identity.pub
cat ~/.ssh/identity
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa
cat ~/.ssh/id_dsa.pub
cat ~/.ssh/id_dsa
cat /etc/ssh/ssh_config
cat /etc/ssh/sshd_config
cat /etc/ssh/ssh_host_dsa_key.pub
cat /etc/ssh/ssh_host_dsa_key
cat /etc/ssh/ssh_host_rsa_key.pub
cat /etc/ssh/ssh_host_rsa_key
cat /etc/ssh/ssh_host_key.pub
cat /etc/ssh/ssh_host_key
~ 代表当前用户的家目录下
useradd -p 添加账户方法
useradd -p `openssl passwd 123456` guest
useradd newuwer;echo -e "123456\n123456\n" |passwd newuser
查看发行版本
cat /etc/issue
cat /etc/*release
操作系统类型版本
cat /etc/issue
cat /etc/*-release
cat /etc/lsb-release
#debain
cat /etc/redhat-release
#Redhat
环境变量
cat /etc/profile
cat /etc/bashrc
cat ~/.bash_profile
cat ~/.bashrc
cat ~/.bash_logout
env
set
以root权限运行的进程
ps aux | grep root
ps -ef | grep root
一些服务的配置文件
cat /etc/syslog.conf
cat /etc/chttp.conf
cat /etc/lighttpd.conf
cat /etc/cups/cupsd.conf
cat /etc/inetd.conf
cat /etc/apache2/apache2.conf
cat /etc/my.conf
cat /etc/httpd/conf/httpd.conf
cat /opt/lampp/etc/httpd.conf
ls -aRl /etc/ | awk '$1 ~ /^.*r.*/'
找存储的明文用户名,密码
grep -i user [filename]
grep -i pass [filename]
grep -C 5 "password" [filename]
find . -name "*.php" -print0 | xargs -0 grep -i -n "var $password" # Joomla
查看网络配置,DNS,DHCP,网关
cat /etc/resolv.conf
cat /etc/sysconfig/network
cat /etc/networks
iptables -L
hostname
dnsdomainname
查看缓存
arp -e
route
/sbin/route -nee
列家目录
ls -ahlR /root/
ls -ahlR /home/
看其他用户的操作记录
cat ~/.bash_history
cat ~/.nano_history
cat ~/.atftp_history
cat ~/.mysql_history
cat ~/.php_history
chpasswd 添加账户方法
useradd newuser;echo "newuser:password"|chpasswd
0 条评论
下一页