内网安全之手动收集本机关键信息命令大全
内网本地信息收集
不管是在外网中还是在内网中,信息收集都是重要的第一步。对于内网中的一台机器,其所处内网的结构是什么样
的、其角色是什么、使用这台机器的人的角色是什么,以及这台机器上安装了什么杀毒软件、这台机器是通过什么方
式上网的、这台机器是笔记本电脑还是台式机等问题,都需要通过信息收集来解答。
网络配置信息
获取本机的网络配置信息
ipconfig
操作系统和软件信息
查询操作系统和版本信息
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
systeminfo| findstr /B /C:"OS 名称" /C:"OS 版本"
查看系统体系结构
echo %PROCESSOR_ARCHITECTURE%
查看安装的软件及版本
wmic product get name,version
powershell "Get‐WmiObject ‐class win32_product | Select‐Object ‐Property name,version"
本机服务信息
wmic service list brief
进程信息
tasklist
wmic process list brief
启动程序信息
wmic startup get command,caption计划任务信息
如果出现无法加载列资源 输入:chcp 437
schtasks /query /fo LIST /v
主机开机时间信息
net statistics workstation
用户列表信息
net user
wmic useraccount get name ,SID
列出会话
net session
查询端口列表
netstat ‐ano
查看补丁列表
systeminfo
wmic qfe get Caption,Description,HotFixID,InstalledOn
查询共享列表
net share
wmic share get name,path,status
路由信息
route print
防火墙相关操作
查看防火墙是否开启
netsh firewall show state
关闭防火墙强
Windows server 2003:netsh firewall set opmode disable
Windows server 2003之后:netsh firewall set opmode disable
或者netsh advfirewall set allprofiles state off
查看防火墙配置
netsh firewall show config
修改防火墙配置
2003及之前的版本,允许指定的程序进行全部的连接:
netsh firewall add allowedprogram c:\nc.exe "allownc" enable
2003之后的版本,允许指定的程序进行全部的连接
netsh advfirewall firewall add rule name="pass nc"dir=in action=allow program="C:\nc.exe"
允许指定程序退出,命令如下
netsh advfirewall firewall add rule name="Allownc" dir=out action=allow program="C: \nc.exe"
允许3389端口放行,命令如下
netsh advfirewall firewall add rule name="RemoteDesktop" protocol=TCP dir=in localport=3389
action=allownetsh advfirewall firewall add rule name=test dir=in action=allow protocol=tcp localport=4444#允
许4444端口进站
netsh advfirewall firewall add rule name=test dir=in action=allow program=c:\a.exe
允许a.exe进站
netsh advfirewall firewall add rule name=test dir=out action=allow protocol=tcp localport=4444#
允许4444端口出站
netsh advfirewall firewall add rule name=test dir=out action=allow
program=c:\a.exe#允许a.exe出站
开启远程服务
1、在2003机器上
wmic path win32_terminalservicesetting where (_CLASS !="") call setallowtsconnections 1
2、在server2008和server 2021
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
#关闭
WIFI密码收集
for /f
"skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles')
‐i ‐v echo |
netsh wlan show profiles %j key=clear
查询RDP端口
do
@echo %j | findstrreg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Winstations\RDP‐
Tcp" /V PortNumber
0xd3d即为3389端口
查看代理配置信息
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
查看当前保存的登陆凭证
cmdkey /l
Arp信息
arp ‐a
查看最近打开的文档
dir %APPDATA%\Microsoft\Windows\Recent
查询本机用户组
net localgroup
管理员组成员列表
net localgroup administrators
RDP凭证
dir /a %userprofile%\AppData\Local\Microsoft\Credentials*浏览器密码获取
杀毒软件查询
wmic /node:localhost /namespace:\root\securitycenter2 path antivirusproduct get displayname
/format:list
本文为 独立观点,未经允许不得转载,授权请联系FreeBuf客服小蜜蜂,微信:freebee2022
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
相关推荐
文章目录