内网信息收集

162 阅读3分钟

携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第30天,点击查看活动详情

收集本机信息

本机信息收集包括操作系统、权限、内网IP地址段、杀毒软件、端口、服务、补丁更新频率、网络连接、共享、会话等。如果是域内主机,那么操作系统、应用软件、补丁、服务、杀毒软件一般都是批量安装的。

1.查询网络配置信息

ipconfig /all

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

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

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
//适用于英文的操作系统,中文的:
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"

1580197593318

2)查看系统体系结构

echo %PROCESSOR_ARCHITECTURE%

1580197987108

  1. 查看安装的软件及版本、路径等
wmic product get name,version

1580198244688

Powershell版本:

powershell.exe "Get-WmiObject -class Win32_Product | Select-Object -Property name,Version"

3.查询本机服务信息

wmic service list brief

1580198366897

4.查询进程列表

tasklist
//或者
wmic process list brief

1580198435617

常见杀毒软件进程

360sd.exe
360tray.exe
ZhuDongFangYu.exe
KSafeTray.exe
SafeDogUpdateCenter.exe
McAfee McShield.exe
egui.exe //NOD32
AVP.EXE  //卡巴斯基
avguard.exe     //小红伞
bdagent.exe     //BitDefender

5.查看启动程序信息

wmic startup get command,caption

1580198702860

6.查看计划任务

schtasks /query /fo LIST /v

7.查看主机开机时间

net statistics workstation

8.查询用户列表

//查看本机用户列表
net user
//获取本地管理员组成员:
net localgroup adinistrators
//查看当前再线用户
query user || qwinsta

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

net session

10.查询端口列表

netstat -ano

11.查询补丁列表

systeminfo

12.查询本机共享列表

查看本机共享列表和可访问的域共享列表 (445端口)

net share

image-20220823183029542

Net use k: \192.168.0.100\c$ 输入账户密码后会将该主机中的可共享资源c盘等资源映射到本机k盘使用

wmic命令也可

wmic share get name,path,status

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

route print
arp -a

14.查询防火墙相关配置

1)关闭防火墙

//windows server 2003之前
netsh firewall set opmode disable
//Windows server 2003之后
netsh advfirewall set allprofile state off

2)查看防火墙配置

netsh firewall show config

3) 修改防火墙配置

//windows server 2003之前允许指定程序全部连接
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"
//允许指定程序退出
netsh advfirewall firewall add rule name="Allow nc" dir=out action=allow program="C:\nc.exe"
//允许3389端口放行
netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow

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

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

15.查看代理配置情况

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

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

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 setallowtsconnections 1

3)在Windows server 2008和2012中

wmic /namespace:\root\cimv2\terminalservices path win32_terminalservicesetting where (__CLASS !="") call setallowtsconnections 1
//修改注册表方式
reg query "HKLM\System\CURRENT\CONTROLSET\CONTROL\TERMINAL SERVER" /v fSingleSessionPerUser /t REG_DWORD /d 0 /f

自动收集信息

为了简化手动信息收集的繁琐步骤,我们可用使用自动化脚本 —— WMIC(Windows Management InstrumentationCommand Line,Windows管理工具命令行)脚本,脚本下载地址,执行该脚本以后,会将信息收集的结果写入HTML文档。

www.fuzzysecurity.com/scripts/fil…

域环境信息收集

\