windows
系统相关
systeminfo /all
echo %PROCESSOR_ARCHITECTURE%
hostname
ver
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"
wmic qfe get Caption,Description,HotFixID,InstalledOn
net statistics workstation
schtasks /query /fo LIST /v
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 11111111 /f
用户相关
whoami /user && whoami /priv
whoami /all
quser
query user || qwinsta
net user
net user XXX
net user username password /add
net user username /delete
net localgroup
net localgroup administrators
net localgroup administrators /domain
net localgroup workgroup\user001 /add
程序相关
#查看杀毒软件
wmic /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntivirusProduct Get displayName /Format:List
#查看安装的程序和版本
wmic product get name,version
#查询运行的进程
tasklist
wmic process list brief
wmic process get processid,executablepath,name #显示进程的路径、名称、pid
wmic service list brief #查看本机服务
#远程桌面连接历史记录
cmdkey /l
#查看自启动程序列表
wmic startuo get command,caption
####防护墙相关操作
netsh firewall show state #防火墙状态
netsh firewall show config #查看防火墙配置
netsh firewall set opmode disable #关闭防火墙(windows server 2003及以前)
netsh advfirewall set allprofiles state off #关闭防火墙(windows server 2003以后)
####修改防火墙配置
netsh firewall add allowedprogram c:\\xxx\\xx.exe "allow xx" enable #允许指定程序的全部连接(windows server 2003及以前)
#windows server 2003之后:
netsh advfirewall firewall add rule name="pass xx" dir=in action=allow program="C:\xxx\xx.exe" #允许某个程序连入
netsh advfirewall firewall add rule name="pass xx" dir=out action=allow program="C:\xxx\xx.exe" #允许某个程序外连
netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow #开启3389端口,允许改端口放行
网络连接相关
netstat -ano
ipconfig /all
route print
arp -a
net view
net view \\ip
net view \\GHQ
net view /domain
net view /domin:XYZ
net accounts /domain
net share
wmic share get name,path,status
域相关
net config workstation
net view /domain
net time /domain
nltest /DCLIST:god
net user /domain
net user 域用户 /domain
net user /domain XXX 123456
net group /domain
net group "domain admins" /domain
net group "domain controllers" /domain
net group "domain computers" /domain
nltest /domain_trusts
wmic useraccount get /all
Linux
系统信息
cat /etc/issue
cat /etc/Lsb-release
cat /etc/*release
uname -an
cat /proc/version
cat /proc/cpuinfo
df -a
sudo cat /var/log/syslog
cat /root/.bash_history
cat ~/.bash_history
hostname
env
cat /etc/shells
用户相关
whoami
id
w
who
last
lastlog
cat /etc/sudoers
cat /etc/group
cat /etc/passwd
sudo -l
网络相关
ifconfig
ip a
netstat -anpt
cat /etc/network/interfaces
程序相关
ps -ef
ps aux
top -c
cat /etc/inetd.conf
cat /etc/xinetd.conf
rpm -qa --last
yum list | grep installed
ls -l /etc/yum.repos.d/
dpkg -l
cat /etc/apt/sources.list
pkg_info
pkginfo
pacman -Q
emerge
crontab -l
ls -al /etc/cron*
cat /etc/cron.allow
cat /etc/cron.deny
cat /etc/crontab
/etc/rc.d/init.d/
配置信息
iptables –L
cat /etc/resolv.conf
cat /etc/network/interfaces
cat /etc/apache2/apache2.conf
cat /etc/my.conf
find / -perm -u=s -type f 2>/dev/null
find / -ctime +1 -ctime -5
虚拟环境检测
lsmod | grep -i "vboxsf\|vboxguest"
lsmod | grep -i "vmw_baloon\|vmxnet"
lsmod | grep -i "xen-vbd\|xen-vnif"
lsmod | grep -i "virtio_pci\|virtio_net"
lsmod | grep -i "hv_vmbus\|hv_blkvsc\|hv_netvsc\|hv_utils\|hv_storvsc"