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

Add more granular support and server 2025 support for versioning #738

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 87 additions & 8 deletions c/meterpreter/source/extensions/stdapi/server/sys/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,93 @@ DWORD add_windows_os_version(Packet** packet)
{
if (v.dwMinorVersion == 0)
{
if (v.dwBuildNumber < 17763) {
osName = v.wProductType == VER_NT_WORKSTATION ? "Windows 10" : "Windows Server 2016";
} else if (v.dwBuildNumber < 20348) {
osName = v.wProductType == VER_NT_WORKSTATION ? "Windows 10" : "Windows Server 2019";
} else if (v.dwBuildNumber < 22000) {
osName = v.wProductType == VER_NT_WORKSTATION ? "Windows 10" : "Windows Server 2022";
} else {
osName = v.wProductType == VER_NT_WORKSTATION ? "Windows 11" : "Windows Server 2022";
if (v.wProductType == VER_NT_WORKSTATION) {
if (v.dwBuildNumber < 10586) {
osName = "Windows 10";
}
else if (v.dwBuildNumber < 14393) {
osName = "Windows 10_1511";
}
else if (v.dwBuildNumber < 15063) {
osName = "Windows 10_1607";
}
else if (v.dwBuildNumber < 16299) {
osName = "Windows 10_1703";
}
else if (v.dwBuildNumber < 17134) {
osName = "Windows 10_1709";
}
else if (v.dwBuildNumber < 17763) {
osName = "Windows 10_1803";
}
else if (v.dwBuildNumber < 18362) {
osName = "Windows 10_1809";
}
else if (v.dwBuildNumber < 18363) {
osName = "Windows 10_1903";
}
else if (v.dwBuildNumber < 19041) {
osName = "Windows 10_1909";
}
else if (v.dwBuildNumber < 19042) {
osName = "Windows 10_2004";
}
else if (v.dwBuildNumber < 19043) {
osName = "Windows 10_20H2";
}
else if (v.dwBuildNumber < 19044) {
osName = "Windows 10_21H2";
}
else if (v.dwBuildNumber < 19045) {
osName = "Windows 10_22H2";
}
else if (v.dwBuildNumber < 22000) {
osName = "Windows 10_22H2+";
}
else if (v.dwBuildNumber < 22621) {
osName = "Windows 11_21H2";
}
else if (v.dwBuildNumber < 22631) {
osName = "Windows 11_22H2";
}
else {
osName = "Windows 11_22H2+";
}
}
else {
if (v.dwBuildNumber < 16299) {
osName = "Windows Server 2016";
}
else if (v.dwBuildNumber < 17134) {
osName = "Windows Server 1709";
}
else if (v.dwBuildNumber < 17763) {
osName = "Windows Server 1803";
}
else if (v.dwBuildNumber < 18362) {
osName = "Windows Server 1809";
}
else if (v.dwBuildNumber < 18363) {
osName = "Windows Server 1903";
}
else if (v.dwBuildNumber < 19041) {
osName = "Windows Server 1909";
}
else if (v.dwBuildNumber < 19042) {
osName = "Windows Server 2004";
}
else if (v.dwBuildNumber < 20348) {
osName = "Windows Server 20H2";
}
else if (v.dwBuildNumber < 25398) {
osName = "Windows Server 21H2";
}
else if (v.dwBuildNumber < 26100) {
osName = "Windows Server 23H2";
}
else {
osName = "Windows Server 2025";
}
}
}
}
Expand Down
Loading