Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scanner/windows): support installationType Domain Controller #1627

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Mar 28, 2023

What did you implement:

support installationType Domain Controller

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • systeminfo.txt
Host Name:                 vuls
OS Name:                   Microsoft Windows Server 2019 Datacenter
OS Version:                10.0.17763 N/A Build 17763
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Primary Domain Controller
OS Build Type:             Multiprocessor Free
Registered Owner:          N/A
Registered Organization:   N/A
Product ID:                00430-00000-00000-AA602
Original Install Date:     1/16/2023, 10:04:07 AM
System Boot Time:          3/28/2023, 8:37:14 AM
System Manufacturer:       Microsoft Corporation
System Model:              Virtual Machine
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
						   [01]: Intel64 Family 6 Model 85 Stepping 4 GenuineIntel ~2095 Mhz
BIOS Version:              Microsoft Corporation Hyper-V UEFI Release v4.1, 5/9/2022
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume3
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC) Coordinated Universal Time
Total Physical Memory:     16,383 MB
Available Physical Memory: 13,170 MB
Virtual Memory: Max Size:  18,431 MB
Virtual Memory: Available: 15,208 MB
Virtual Memory: In Use:    3,223 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    vuls
Logon Server:              \\vuls
Hotfix(s):                 5 Hotfix(s) Installed.
						   [01]: KB5022511
						   [02]: KB5012170
						   [03]: KB5023702
						   [04]: KB5020374
						   [05]: KB5023789
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

before

$ vuls server
[Mar 28 20:21:34]  INFO [localhost] vuls-v0.22.2-build-20230328_202031_de1ed8e
...
[Mar 28 20:21:34]  INFO [localhost] Listening on localhost:5515
[Mar 28 20:21:46] ERROR [localhost] Failed to parse systeminfo.exe. err: Failed to detect installation type. line: OS Configuration:          Primary Domain Controller

$ curl -X POST -H "Content-Type: text/plain" -H "X-Vuls-OS-Family: windows" --data-binary @systeminfo.txt http://localhost:5515/vuls
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1883  100   132  100  1751  76610   992k --:--:-- --:--:-- --:--:-- 1838k
parse error: Invalid numeric literal at line 1, column 7

after

$ vuls server
[Mar 28 20:22:45]  INFO [localhost] vuls-v0.22.2-build-20230328_201950_30a3460
...
[Mar 28 20:22:45]  INFO [localhost] Listening on localhost:5515
[Mar 28 20:22:52]  INFO [localhost] : 11 CVEs are detected with gost
[Mar 28 20:22:52]  INFO [localhost] Fill CVE detailed with gost
[Mar 28 20:22:52]  INFO [localhost] Fill CVE detailed with CVE-DB
[Mar 28 20:22:52]  INFO [localhost] : 0 PoC detected
[Mar 28 20:22:52]  INFO [localhost] : 0 exploits are detected
[Mar 28 20:22:52]  INFO [localhost] : Known Exploited Vulnerabilities are detected for 1 CVEs
[Mar 28 20:22:52]  INFO [localhost] : Cyber Threat Intelligences are detected for 2 CVEs

$ curl -X POST -H "Content-Type: text/plain" -H "X-Vuls-OS-Family: windows" --data-binary @systeminfo.txt http://localhost:5515/vuls
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 70832    0 69081  100  1751   264k   6865 --:--:-- --:--:-- --:--:--  272k
[
  {
    "jsonVersion": 0,
    "lang": "",
    "serverUUID": "",
    "serverName": "",
    "family": "windows",
    "release": "Windows Server 2019",
...

Checklist:

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n self-assigned this Mar 28, 2023
@MaineK00n MaineK00n force-pushed the MaineK00n/windows-domain-controller branch from 30a3460 to 7c82a46 Compare March 28, 2023 11:35
@kotakanbe kotakanbe merged commit 8ccaa8c into master Mar 28, 2023
@kotakanbe kotakanbe deleted the MaineK00n/windows-domain-controller branch March 28, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants