![82e0a88ad3d54d1a74b8db6d0f7985c7.png](https://img-blog.csdnimg.cn/img_convert/82e0a88ad3d54d1a74b8db6d0f7985c7.png)
心有猛虎,今天大雨还是屁颠屁颠跑去加了一个下午的班。把专家系统的方案做了一下,下周一要评审,基本上稳了。在做项目的过程中,我发现了很多理论和实际相差很大,但恰恰是搞理论的博士,领导着做项目的我们。如果理论与实际情况对不上,我说的是如果,上对下的指导,听上去就像是在满嘴跑火车,不得底下的人心。所以,摆低态度,从实际出发。
一、手动收集信息
最最最基本的命令,了解一下就行了,实战都要靠储备的油猴子脚本。
1、查询网络配置信息(入门级)
ipconfig /all
![88948a73b04e00b84d329eff940801ec.png](https://img-blog.csdnimg.cn/img_convert/88948a73b04e00b84d329eff940801ec.png)
2、查询操作系统和软件信息(入门级)
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本"
![511ca9c62ca30629ed7c7dacfc61e841.png](https://img-blog.csdnimg.cn/img_convert/511ca9c62ca30629ed7c7dacfc61e841.png)
echo %PROCESSOR_ARCHITECTURE%
![84c9bfc31bce2a83e1df07877d0a9e99.png](https://img-blog.csdnimg.cn/img_convert/84c9bfc31bce2a83e1df07877d0a9e99.png)
wmic product get name,version
![ef755c663f7519fb35448cdb8237b553.png](https://img-blog.csdnimg.cn/img_convert/ef755c663f7519fb35448cdb8237b553.png)
powershell "Get-WmiObject -class Win32_Product | Select-Object -Property name,version"
![10015e104e6b058f5164c1feb10e9100.png](https://img-blog.csdnimg.cn/img_convert/10015e104e6b058f5164c1feb10e9100.png)
3、查询本机服务信息(入门级)
wmic service list brief
![619a5274295546d02b6864097ff36532.png](https://img-blog.csdnimg.cn/img_convert/619a5274295546d02b6864097ff36532.png)
4、查询进程列表(入门级)
wmic process list brief
![5fbb462bf19af0818083ec4101c7ad58.png](https://img-blog.csdnimg.cn/img_convert/5fbb462bf19af0818083ec4101c7ad58.png)
5、查看启动程序信息(入门级)
wmic startup get commond,caption
![3f3af19a611480ddfef11c7149e3cd7f.png](https://img-blog.csdnimg.cn/img_convert/3f3af19a611480ddfef11c7149e3cd7f.png)
6、查看计划任务(这个命令坏掉了)
SCHTASKS /QUERY /FO LIST
![54211a991c78618a554a1e4bf1c4b6c7.png](https://img-blog.csdnimg.cn/img_convert/54211a991c78618a554a1e4bf1c4b6c7.png)
7、查看主机开机时间(昨晚刚刚安装重启的)
net statistics workstation
![58921875e0ad70327573ad6c552f0f0f.png](https://img-blog.csdnimg.cn/img_convert/58921875e0ad70327573ad6c552f0f0f.png)
8、查询用户列表(入门级)
net user
![082e59cea81d1ccdbaf1a342c868d059.png](https://img-blog.csdnimg.cn/img_convert/082e59cea81d1ccdbaf1a342c868d059.png)
net localgroup Administrators
![71e48a56d25c4e8848cff6d9f104b250.png](https://img-blog.csdnimg.cn/img_convert/71e48a56d25c4e8848cff6d9f104b250.png)
query user || qwinsta
![c730b83cd96cab796425afb0fdda9e07.png](https://img-blog.csdnimg.cn/img_convert/c730b83cd96cab796425afb0fdda9e07.png)
9、列出或断开本地计算机与所连接的客户端的会话(需要管理员权限)
net session
![47668caebd47deb6a8892e65d2d30894.png](https://img-blog.csdnimg.cn/img_convert/47668caebd47deb6a8892e65d2d30894.png)
10、查询端口列表(熟记)
netstat -ano
![7c8bc2cb421bd95487e2225f4ad8899a.png](https://img-blog.csdnimg.cn/img_convert/7c8bc2cb421bd95487e2225f4ad8899a.png)
11、查看补丁列表(入门级)
systeminfo
![668df088fc2d96d86b1d020afa3dc9ef.png](https://img-blog.csdnimg.cn/img_convert/668df088fc2d96d86b1d020afa3dc9ef.png)
wmic qfe get Caption,Description,HotFixID,InstallOn
![701f894bba5a344686e957800d008b7e.png](https://img-blog.csdnimg.cn/img_convert/701f894bba5a344686e957800d008b7e.png)
12、查询本机共享列表(入门级)
net share
![b97bec9f613bdae86a17b555afbda7c8.png](https://img-blog.csdnimg.cn/img_convert/b97bec9f613bdae86a17b555afbda7c8.png)
wmic share get name,path,status
![1a56f08101e9e593e526a0e58f94311d.png](https://img-blog.csdnimg.cn/img_convert/1a56f08101e9e593e526a0e58f94311d.png)
13、查询路由表及所有可用接口的API缓存表(入门级)
route print
![b572f837fa92378f072415273a187c42.png](https://img-blog.csdnimg.cn/img_convert/b572f837fa92378f072415273a187c42.png)
arp -a
![41ec4ff1a773db1767bf00345440272c.png](https://img-blog.csdnimg.cn/img_convert/41ec4ff1a773db1767bf00345440272c.png)
14、查询防火墙相关配置(入门级)
netsh firewall show config
![5bad89eddd5f8c1e4df469fda357255c.png](https://img-blog.csdnimg.cn/img_convert/5bad89eddd5f8c1e4df469fda357255c.png)
15、查看代理配置情况(入门级)
reg query "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings"
![b0b8296a42473c012adc3c465194213b.png](https://img-blog.csdnimg.cn/img_convert/b0b8296a42473c012adc3c465194213b.png)
16、查询并开启远程连接服务(进阶级)
REG QUERY "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp" /V PortNumber
![579e33e015697f5249e085129ccbca97.png](https://img-blog.csdnimg.cn/img_convert/579e33e015697f5249e085129ccbca97.png)
wmic /namespace:rootCIMV2TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL SetAllowTSConnections 1
![9ebfe74bc2d17d9003c92e706dab3f27.png](https://img-blog.csdnimg.cn/img_convert/9ebfe74bc2d17d9003c92e706dab3f27.png)
二、油猴子脚本自动化收集
下载油猴子脚本 wmic_info.bat[1]
![ec7a3f8b5db0b307aa836e3f77b8d30c.png](https://img-blog.csdnimg.cn/img_convert/ec7a3f8b5db0b307aa836e3f77b8d30c.png)
得到输出结果是out.html,美观又大方
![5e4b6cd35385a1ad283d2021e1c24c7c.png](https://img-blog.csdnimg.cn/img_convert/5e4b6cd35385a1ad283d2021e1c24c7c.png)
三、查看当前权限
1、查看当前权限(我是谁)
whoami
![310bee7f6f5c8e76129988e832a4d762.png](https://img-blog.csdnimg.cn/img_convert/310bee7f6f5c8e76129988e832a4d762.png)
2、获取域SID
whoami /all
![89ef9afa196d9a20ca2d288c22fe07ad.png](https://img-blog.csdnimg.cn/img_convert/89ef9afa196d9a20ca2d288c22fe07ad.png)
3、查询指定用户的详细信息
net user ailx00 /domain
![caeacef5d38ad1712bf57de375f2e20b.png](https://img-blog.csdnimg.cn/img_convert/caeacef5d38ad1712bf57de375f2e20b.png)
四、判断是否存在域
1、使用ipconfig命令
ipconfig /all
![bc2819753a7386fe21b6efaee8404cea.png](https://img-blog.csdnimg.cn/img_convert/bc2819753a7386fe21b6efaee8404cea.png)
nslookup hackbiji.top
![2eb94a24e33e670d73ebacdd7aa26858.png](https://img-blog.csdnimg.cn/img_convert/2eb94a24e33e670d73ebacdd7aa26858.png)
2、查看系统详细信息
systeminfo
![44346fbe1060f7b07860535aa969d9f8.png](https://img-blog.csdnimg.cn/img_convert/44346fbe1060f7b07860535aa969d9f8.png)
3、查询当前登陆域及登陆用户信息
net config workstation
![4d4898fd747113dc70451bcf69e59317.png](https://img-blog.csdnimg.cn/img_convert/4d4898fd747113dc70451bcf69e59317.png)
4、判断主域
net time /domain
![4bc826a10198c39fc46b419ff5f2966b.png](https://img-blog.csdnimg.cn/img_convert/4bc826a10198c39fc46b419ff5f2966b.png)
五、探测域内存活主机
1、利用NetBIOS快速探测内网(软件需要下载)
nbtscan-1.0.35.exe 192.168.160.1/24
![f3004ce60c36cb97a9fa5591486abbf3.png](https://img-blog.csdnimg.cn/img_convert/f3004ce60c36cb97a9fa5591486abbf3.png)
2、利用ICMP协议快速探测内网(贼鸡儿慢)
for /L %I in (1,1,254) DO @ping -w 1 -n 1 192.168.160.%I | findstr "TTL"
![e9d9008e67b172d1f58c22d79a9e87ad.png](https://img-blog.csdnimg.cn/img_convert/e9d9008e67b172d1f58c22d79a9e87ad.png)
3、通过ARP扫描快速探测内网(需要自己下载)
![ef0026da07ccad482e6283e7e203e575.png](https://img-blog.csdnimg.cn/img_convert/ef0026da07ccad482e6283e7e203e575.png)
六、扫描域内端口
1、利用telnet命令快速扫描(难用的很)
需要先开启Telnet服务
![04449590434cc52effb675a38eb875be.png](https://img-blog.csdnimg.cn/img_convert/04449590434cc52effb675a38eb875be.png)
telnet 192.168.160.143 22
![0509ec33b0487d337dfb268035b42772.png](https://img-blog.csdnimg.cn/img_convert/0509ec33b0487d337dfb268035b42772.png)
2、S扫描(2007年古老的扫描器,略)
3、Metasploit端口扫描(重头戏)
![dd3c51599b9eee7493ce3bbb35d28091.png](https://img-blog.csdnimg.cn/img_convert/dd3c51599b9eee7493ce3bbb35d28091.png)
4、端口Banner信息(nc是个好东西)
获取服务端的Banner信息后,可以在漏洞库中查找对应CVE编号的POC、EXP,检测漏洞是否存在,从而有针对性的进行安全加固。
nc -nv 127.0.0.1 22
![0d3ccb4a6cacfd6274d277178212e24e.png](https://img-blog.csdnimg.cn/img_convert/0d3ccb4a6cacfd6274d277178212e24e.png)
- 文件共享服务端口(21、22、69、2049、139、389)
- 远程连接服务端口(22、23、3389、5900、5632)
- Web应用服务端口(80、443、8080、7001、7002、8089、9090、4848、1352)
- 数据库服务端口(3306、1433、1521、5432、6379、5000、9200)
- 邮件服务端口(25、110、143)
- 网络常见协议端口(53、67、68、161)
5、Nmap主机扫活(重头戏)
nmap -sP 192.168.160.1/24
![3da267c6e0ffda25d7355aa51f25e2eb.png](https://img-blog.csdnimg.cn/img_convert/3da267c6e0ffda25d7355aa51f25e2eb.png)
完~
参考
- ^wmic_info.bat 下载地址 http://www.fuzzysecurity.com/scripts/files/wmic_info.rar