ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

windows漏洞扫描工具-windowsvulnscan和wesng,本质是比较windows系统版本、systeminfo补丁信息来查看漏洞利用情况

2022-02-04 18:33:19  阅读:349  来源: 互联网

标签:wesng windows systeminfo py 漏洞 Windows EXP -- CVE


https://github.com/chroblert/WindowsVulnScan

0x00 说明:

这是一款基于主机的漏洞扫描工具,采用多线程确保可以快速的请求数据,采用线程锁可以在向sqlite数据库中写入数据避免database is locked的错误,采用md5哈希算法确保数据不重复插入。

本工具查找是否有公开exp的网站为shodan,该网站限制网络发包的速度,因而采用了单线程的方式,且耗时较长。

功能:

  • 查找主机上具有的CVE
  • 查找具有公开EXP的CVE

1583672504536

0x01 起因:

因为需要做一些主机漏洞扫描方面的工作,因而编写了这个简单的工具。之前也查找了几款类似的工具,如下:

vulmap:

vulmon开发的一款开源工具,原理是根据软件的名称和版本号来确定,是否有CVE及公开的EXP。这款Linux的工具挺好用,但是对于Windows系统层面不太适用。

windows-exp-suggester:

这款和本工具的原理一样,尝试使用了之后,发现它的CVEKB数据库只更新到2017年的,并且没有给出CVE是否有公开的EXP信息。https://github.com/secwiki/windows-kernel-exploits/tree/master/win-exp-suggester

基于以上所以写了这个简单的工具,该项目在https://github.com/chroblert/WindowsVulnScan

0x02 原理:

1. 搜集CVE与KB的对应关系。首先在微软官网上收集CVE与KB对应的关系,然后存储进数据库中

2. 查找特定CVE网上是否有公开的EXP

3. 利用powershell脚本收集主机的一些系统版本与KB信息

4. 利用系统版本与KB信息搜寻主机上具有存在公开EXP的CVE

0x03 参数:

# author: JC0o0l
# GitHub: https://github.com/chroblert/
可选参数:
  -h, --help            show this help message and exit
  -u, --update-cve      更新CVEKB数据
  -U, --update-exp      更新CVEEXP数据
  -m MODE, --mode MODE  搭配-U使用。更新模式 All:更新所有;Empty:只更新空白的;Error:只更新之前未成功更新的
  -C, --check-EXP       检索具有EXP的CVE
  -n PRODUCTNAME, --productName PRODUCTNAME
                        搭配-C使用。自定义产品名称,如Windows 10
  -N PRODUCTVERSION, --productVersion PRODUCTVERSION
                        搭配-C使用。自定义产品版本,如20H2
  -f FILE, --file FILE  ps1脚本运行后产生的.json文件

0x04 示例:

1. 首先运行powershell脚本KBCollect.ps收集一些信息

.\KBCollect.ps1

2. 将运行后产生的KB.json文件移动到cve-check.py所在的目录

3. 安装一些python3模块

python3 -m pip install requirements.txt

4. 运行cve-check.py -u创建CVEKB数据库

5. 运行cve-check.py -U更新CVEKB数据库中的hasPOC字段

  此处可以使用-m选择更新模式。
  -m All:更新所有
  -m Empty:只更新hasPOC字段为空的
  -m Error:只更新hasPOC字段为Error的

6. 运行cve-check.py -C -f KB.json查看具有公开EXP的CVE,如下:

1619484955553.png

 

 

https://github.com/bitsadmin/wesng

Windows Exploit Suggester - Next Generation (WES-NG)

WES-NG is a tool based on the output of Windows' systeminfo utility which provides the list of vulnerabilities the OS is vulnerable to, including any exploits for these vulnerabilities. Every Windows OS between Windows XP and Windows 11, including their Windows Server counterparts, is supported.

On the bitsadm.in website an in-depth blog on WES-NG is available on this tool: Windows Security Updates for Hackers.

Usage

  1. Download WES-NG using pip install wesng or using the following commandline: git clone https://github.com/bitsadmin/wesng --depth 1
  2. Obtain the latest database of vulnerabilities by executing the command wes.py --update
  3. There are two options to check for missing patches: a. Launch missingkbs.vbs on the host to have Windows determine which patches are missing b. Use Windows' built-in systeminfo.exe tool to obtain the system information of the local system, or from a remote system using systeminfo /S MyRemoteHost, and redirect this to a file: systeminfo > systeminfo.txt
  4. Depending on the method chosen in step 3 execute WES-NG: a. With the missing.txt file as input: wes.py --missing missing.txt (or wes.py -m missing.txt) b. With the systeminfo.txt file as the parameter: wes.py systeminfo.txt WES-NG then uses the database to determine which patches are applicable to the system and to which vulnerabilities are currently exposed, including exploits if available.
  5. As the data provided by Microsoft's MSRC feed is frequently incomplete and false positives are reported by wes.py, @DominicBreuker contributed the --muc-lookup parameter to validate identified missing patches from the systeminfo.txt file against Microsoft's Update Catalog. Additionally, make sure to check the Eliminating false positives page at the Wiki on how to interpret the results. For an overview of all available parameters for both missingpatches.vbs and wes.py, check CMDLINE.md.

Demo

Gif animation showing usage of Windows Exploit Suggester - Next Generation

标签:wesng,windows,systeminfo,py,漏洞,Windows,EXP,--,CVE
来源: https://www.cnblogs.com/bonelee/p/15863223.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有