windows信息收集
查询操作系统和版本信息
英文版操作系统: systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
中文版操作系统: systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"
查看安装的软件及版本、路径等
利用wmic命令,将结果输出到文本文件中: wmic product get name,version
查询本机服务信息
wmic service list brief
查询进程列表
tasklist
常见杀毒软件的进程:
查看本机杀软
wmic /namespace:\\root\securitycenter2 path antivirusproduct GET displayName,productState,pathToSignedProductExe
查看启动程序信息
wmic startup get command,caption
查看计划任务
schtasks /query /fo LIST /V
查看主机开机时间
net statistics workstation
执行如下命令,获取本地管理员(通常包含域用户)信息 net localgroup administrators
执行如下命令,查看当前在线用户 query user || qwinsta
执行如下命令,查看系统的详细信息
systeminfo
使用wmic命令查看安装在系统中的补丁 wmic qfe get Caption,Description,HotFixID,InstalledOn
执行如下命令,查看本机共享列表和可访问的域共享列表(域共享在很多时候是相同的)
net share
利用wmic命令查找共享列表
wmic share get name,path,status
查询路由表及所有可用接口的ARP缓存表
route print
arp -a
关闭防火墙
Windows server 2003及之前的版本,命令如下
netsh firewall set opmode disable windows server
2003之后的版本,命令如下
netsh advfirewall set allprofiles state off
查看防火墙配置
netsh firewall show config
修改防火墙配置
1、允许指定程序进入,命令如下
netsh advfirewall firewall add rule name="pass nc" dir=in action=allow program="C:\nc.exe"
2、允许指定程序退出,命令如下
netsh advfirewall firewall add rule name="Allow nc" dir=out action=allow program="C:\nc.exe"
3、允许3389端口放行,命令如下
netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow
自定义防火墙日志的储存位置
netsh advfirewall set currentprofile logging filename "C:\windows\temp\fw.log"
查看代理配置情况
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
查看远程连接端口
REG QUERY"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /V PortNumber
在Windows server 2008 和Windows server 2012中开启3389端口
wmic /namespace:\\root\cimv2\terminalservices path win32_terminalservicesetting where (__CLASS != "") call setallowtsconnections 1
wmic /namespace:\\root\cimv2\terminalservices path win32_tsgeneralsetting where (TerminalName ='RDP-Tcp') call setuserauthenticationrequired 1
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fSingleSessionPerUser /t REG_DWORD /d 0 / f