内网信息收集

内网信息收集

  1.对当前机器角色判断。  --我是谁?

  2.对当前机器所处的网络环境拓扑结构进行分析和判断。  --这是哪里?

  3.对当前机器所处区域进行判断。  --我在哪里?

 1.收集

  1.1收集本机信息

    1.1.1手动

    本机信息包括操作系统,权限,内网ip地址段,下毒软件,端口,服务,补丁更新频率,网络连接,共享,会话等。

    域内主机,操作系统,应用软件,补丁,服务,杀毒软件(一般都是批量安装)

    通过对本机的相关信息,可以进一步了解整个域的操作系统版本,软件及补丁安装情况,用户命名方式等。

    

    A.查询网络配置信息

      ipconfig  /all

    B.查询操作系统及软件信息

      (1)查询操作系统和版本信息

      systeminfo

      systeminfo  |  findstr  /B  /C:"OS Name"  /C:"OS Version"      //查询操作系统和版本信息-英文操作系统

      systeminfo | findstr /B /C:"OS 名称"  /C:"OS 版本"     //查询操作系统和版本信息-中文操作系统

      (2)查看系统体系结构

      echo  %PROCESSOR_ARCHITECTURE%

      (3)查看安装的软件及版本,路径等

      wmic  product  get name,version

      (4)利用ProwShell命令,收集软件的版本信息

      powershell "Get-Wmiobject -class win32_product | select-object -property name,version"

    C.查询本机服务信息

      wmic service list brief     //查询本机服务信息

    D.查询进程列表

      查看进程分析软件,邮件客户端,vpn和杀毒软件等

      tasklist

      wmic process list brief

    E.查看启动程序信息

      wmic startup get command,caption

    F.查看计划任务

      schtasks /query /fo list /v

    G.查看主机开机时间

      net statistics workstation

    H.查询用户列表

      net localgroup  //查看本地用户组信息

      net user     //查询本机用户列表

      net localgroup administrators    //获取本地管理员

      query user || qwinsta        //查看当前在线用户

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

      net session

    J.查询端口列表

      netstat -ano

    K.查看补丁列表

      systeminfo

      wmic qfe get Caption,description,HotFixID,Installedon

    L.查询本机共享列表

      net share

      wmic share get name,path,status

    M.查询路由表及所有可用接口的ARP缓存表

      route print

      arp -a

    N.查询防火墙相关配置

      (1)关闭防火墙

      netsh firewall set opmode disable

      //windows server 2003之前的版本

      netsh advfirewall set allprofiles state off

      //windows server 2003之后的版本

      (2)查看防火墙配置

      netsh firewall show config

      (3)修改防火墙配置

      netsh firewall add allowedprogram c:\nc.exe "allow nc" enable      //windows server 2003之前的版本

      netsh advfirewall firewall add rule name="pass nc" dir=in action-allow program="c:\nc.exe"    //windows server 2003之后的版本

      netsh advfirewall firewall add rule name="Allow nc" dir=out action-allow program="c:\nc.exe"    //允许指定的程序退出

      netsh advfirewall firewall add rule name="c:\nc.exe"    //允许指定程序退出

      netsh advfirewall firewall add rule name="Remote Desktop" protocol-TCP dir-inlocalprot-3389 action-allow    //y允许3389端口放行

      (4)自定义防火墙日志的存储位置

      netsh adcfirewall set currentprofile logging filename "C:\windows\temp\hk.log"  

    O.查看代理配置情况

      reg query "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\internet settings"

    P.查询并开启远程连接服务

      (1)查看远程连接端口

      REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\TERMINAL SERVER\WINSTATIONS\rdp-TCP" /V PortNumber

      (2)在Windows server 2003中开启3389端口

      wmic path win32_terminalservicesetting where (_CLASS !="")call seetallowtsconnections 1

      (3)在比较高版本的系统中开启3389端口

      wmic /namespace:\\root\cimv2\terminalservices path win32_terminalservicesetting where (_CLASS !="") call setallowtsconnections 1

      wmic /namespace:\\root\cimv2\terminalservices path win32_terminalservicesetting where (temlnalname='RDP-TCP') call setuserauthenticationrequired 1

      reg add "HKLM\SYSTEM\CURRENT\CONTROLSET\CONTROL\TERMINAL SERVER" /v fsinglesessionperuser /t REG_DWORD /d 0 /f    //windows 7 可以使用的开启3389端口的方法

   1.1.2自动信息收集

    批处理文件wmic文件wmic_info.bat(可以直接复制粘贴,该文件主要是显示主机的信息,无害)

     for /f "delims=" %%A in ('dir /s /b %WINDIR%\system32\*htable.xsl') do set "var=%%A"

 

     wmic process get CSName,Description,ExecutablePath,Processld /format:"%var%" >> out.html
     wmic service get Caption,Name,PathName,ServiceType,Started,StartMode,StartName /format:"%var%" >> out.html
     wmic USERACCOUNT list full /format:"%var%" >> out.html
     wmic group list full /format:"%var%" >> out.html
     wmic nicconfig where IPEnabled='true' get Caption,DefaultIPGateway,Description,DHCPEnabled,DHCPServer,IPAddress,IPSubnet,MACAddress /format:"%var%" >> out.html
     wmic volume get Label,DeviceID,DriveLetter,FileSystem,Capacity,FreeSpace /format:"%var%" >> out.html
     wmic netuse list full /format:"%var%" >> out.html
     wmic qfe get Caption,Description,HotFixID,InstalledOn /format:"%var%" >> out.html
     wmic startup get Caption,Command,Location,User /fromat:"%var%" >> out.html
     wmic PRODUCT get Description,InstallDate,InstallLocation,PackageCache,Vendor,Version /fromat:"%var%" >> out.html
     wmic os get name,version,InstallDate,LastBootUpTime,LocalDateTime,Manufacturer,RegisteredUser,ServicePackMajorVersion,SystemDirectory /format:"%var%" >> out.html
     wmic Timezone get DaylightName,Description,StandardName /format:"%var%" >> out.html

    注:该批处理文件的格式必须严格按照上面的操作,否则会出现找不到的情况或者其他报错。

    将该批处理文件操作在目标主机执行,下载到自己的主机,然后删除wmic_info.bat文件。

    

    

 

 

    

    

    

      

      

      

posted @ 2021-08-25 15:42  Ayheng  阅读(83)  评论(0编辑  收藏  举报