windows 主机信息收集

windows 主机信息收集

1 查询操作系统版本、补丁等信息

systeminfo

1.1 查看安装在系统中的补丁

image-20210925121715858

2 查询系统体系结构

echo %PROCESSOR_ARCHITECTURE%
image-20210926224229255

3 查看安装的软件及版本、路径等

wmic product get name,version(,installlocation)

image-20210926224426072

3.1 powershell 中查看软件及版本

powershell "get-wmiobject -class win32_product | select-object -property name,version"

image-20210926224538488

4 查询本机服务信息

wmic service list brief

image-20210926224618195

5 查询进程列表

tasklist

image-20210926224656644

5.1 查看进程信息

wmic process list brief

image-20210926224753486

6 查看启动程序信息

wmic startup get command,caption

image-20210926224856226

7 查看计划任务

schtasks /query /fo list /v

8 查看主机开机时间

net statistics workstation

9 查看本地管理员信息(通常包含域用户信息)

net localgroup administrators

  • 默认Domain Admins 组中为域内机器的本地管理员用户。
  • image-20210925115011875

10 在域中查看当前在线用户

query user || qwinsta

image-20210925115723956

11 列出或断开本地计算机与所连接的客户端之间的会话

net session

image-20210925121240241

12 查询本机共享列表

net Share
wmic share get

image-20210925122146231

13 查询防火墙相关配置

13.1 关闭/开启防火墙:

  • Win2003 及之前的版本:

    netsh firewall set opmode disable
    netsh firewall set opmode enable
    

    image-20210925232947798

  • Win2003 之后的版本:

    netsh advfirewall set allprofiles state off
    netsh advfirewall set allprofiles state on
    

    image-20210925233204484

13.2 查看防火墙配置

  • Win2003 及之前的版本:

    netsh firewall show config

  • Win2003 之后的版本:

    netsh advfirewall show allprofiles

    image-20210925233539511

13.3 修改防火墙配置

  • Win2003及之前版本,放行指定程序

    netsh firewall add allowedprogram c:\nc.exe "allow nc” enable

  • Win2003 之后的版本,放行指定程序

    netsh advfirewall firewall add rule name="pass nc" dir=in action=allow program="C:\nc.exe"

    • 允许指定程序访问:netsh advfirewall firewall add rule name="pass nc" dir=in action=allow program="C:\nc.exe"

    • 允许指定程序出去:netsh advfirewall firewall add rule name="Allow nc" dir=out action=allow progrom="C:\nc.exe"

    • 放行 3389 端口:netsh advfirewall firewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow

      image-20210925234802023

13.4 自定义防火墙日志的储存位置

netsh advfirewall set currentprofile logging filename "C:\Windowws\temp\fw.log"

image-20210925235014250

14 查看代理配置情况

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

image-20210925235227001

15 查询并开启远程连接服务

  • 查看远程连接端口

    REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /V PortNumber

    image-20210926220725144

  • 在win2003 中开启 3389 端口

    wmic path win32_terminalservicesetting where (__CLASS != "") call setallowtsconnections 1

    image-20210926221758633

  • Win2008 与 Win2012 的版本

    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 fDenyTSConnections /t REG_DWORD /d 00000000 /f
    

    image-20210926222439080

posted @ 2023-05-27 10:07  f_carey  阅读(37)  评论(0编辑  收藏  举报