2024年10月11日 星期五

[研究]ASP.NET,DocumentFormat.OpenXml.2.20.0 升級 DocumentFormat.OpenXml.3.1.0 問題

[研究]ASP.NET,DocumentFormat.OpenXml.2.20.0 升級 DocumentFormat.OpenXml.3.1.0 問題

2024-10-11

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C# + SQL Server 2019 + SQL Server Management Studio (SSMS) 19

********************************************************************************

如果是直接使用 OpenXml SDK (Open XML SDK, Open-XML-SDK) 語法,可能出錯;如果直接使用 ClosedXML 套件語法,可能不會有問題。

jobTitle = getOpenXMLSDKCellValue(workbookPart, (Cell)r.ChildElements.GetItem(0));

編譯出現錯誤

error CS1061: 'OpenXmlElementList' 未包含 'GetItem' 的定義,也找不到可接受類型 'OpenXmlElementList' 第一個引數的可存取擴充方法 'GetItem' (是否遺漏 using 指示詞或組件參考?)

********************************************************************************

實際測試,修該如下,編譯可以通過。
jobTitle = getOpenXMLSDKCellValue(workbookPart, (Cell)r.ChildElements[0]);   

(完)

相關

[研究]ASP.NET,HtmlSanitizer 8.1.870 與AngleSharp 相依套件測試

[研究]ASP.NET,HtmlSanitizer 8.1.870 與AngleSharp 相依套件測試

2024-10-11

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C# + SQL Server 2019 + SQL Server Management Studio (SSMS) 19

********************************************************************************


嚴重性 程式碼 說明 專案 檔案 隱藏項目狀態

錯誤 無法解析相依性。'AngleSharp 1.1.2' 與 'AngleSharp.Css 0.17.0 條件約束: AngleSharp (>= 0.17.0 && < 0.18.0)', 'HtmlSanitizer 8.1.870 條件約束: AngleSharp (= 0.17.1)' 不相容。

NuGet 沒有 AngleSharp 0.18.0 版

********************************************************************************

(完)

相關

[研究]ASP.NET,ClosedXML 與 SixLabors.Fonts.相依套件測試

[研究]ASP.NET,ClosedXML 與 SixLabors.Fonts.相依套件測試

2024-10-11

NuGet 安裝 ClosedXML 104.1 時,會自動安裝 SixLabors.Fonts.1.0.0

SixLabors.Fonts.1.0.0 -> SixLabors.Fonts.2.0.4,

出現

錯誤 無法安裝封裝 'SixLabors.Fonts 2.0.4'。您正嘗試將此封裝安裝到以 '.NETFramework,Version=v4.8' 為目標的專案,但該封裝不包含任何與架構相容的組件參考或內容檔。如需詳細資訊,請連絡封裝作者。

這個專案就是 .NET Framework 4.8,SixLabors.Fonts 2.x 似乎不支援。


********************************************************************************

ClosedXML 0.102.3 也需要 SixLabors.Fonts.1.0.1




嚴重性 程式碼 說明 專案 檔案 隱藏項目狀態
錯誤 無法安裝封裝 'SixLabors.Fonts 2.0.4'。您正嘗試將此封裝安裝到以 '.NETFramework,Version=v4.8' 為目標的專案,但該封裝不包含任何與架構相容的組件參考或內容檔。如需詳細資訊,請連絡封裝作者。

SixLabors.Fonts 1.0.1 支援 .NET Core 3.1 和 .NET Standard 2.0

SixLabors.Fonts 2.0.4 支援 .NET 6.0

(完)

相關

[研究]ASP.NET,錯誤CS0234命名空間 'X.PagedList' 中沒有類型或命名空間名稱 'Extensions'

[研究]ASP.NET,錯誤CS0234命名空間 'X.PagedList' 中沒有類型或命名空間名稱 'Extensions'

2024-10-11

NuGet套件升級成功,X.PagedList.10.0.3 -> X.PagedList.10.2.1,

編譯出現錯誤

錯誤 CS0234 命名空間 'X.PagedList' 中沒有類型或命名空間名稱 'Extensions' (是否遺漏了組件參考?) D:\Code\Solution1\WebApplication1\Controllers\S1Controller.cs 32 作用中

把所有 using X.PagedList.Extensions; 註解掉後,編譯成功。有可能只要 using X.PagedList; 就好。

把 packages.config 所有套件問 ChatGPT 哪一個使用到 X.PagedList,結果是沒有。

發佈成功,暫時先這樣。

(完)

[研究]Bootstrap 5.3.3 有 CVE-2024-6484 (NVD) Medium 中等級弱點

[研究]Bootstrap 5.3.3 有 CVE-2024-6484 (NVD) Medium 中等級弱點

2024-10-11

下圖,OWASP Dependency-Track (DT) 說 Bootstrap 5.3.3 有 CVE-2024-6484 (NVD) Medium 中等級弱點 (2024-09-26)

NVD = National Vulnerability Database

CVE-2024-6484 Detail (2024-07-11)
https://nvd.nist.gov/vuln/detail/CVE-2024-6484
Bootstrap 中已發現一個漏洞,該漏洞會使用戶遭受跨站點腳本 (XSS) 攻擊。這個問題存在於輪播元件中,由於清理不充分,可以透過 <a> 標籤的 href 屬性來利用 data-slide 和 data-slide-to 屬性。此漏洞可能使攻擊者能夠在受害者的瀏覽器中執行任意 JavaScript。


用 getbootstrap 找,bootstrap 5.x 在 NVD 沒有弱點
https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.3&orderBy=CPEURI&keyword=getbootstrap&status=FINAL&startIndex=40

Snyk 目前 bootstrap 5.x 無弱點
https://security.snyk.io/package/npm/bootstrap/5.0.0

Bootstrap 5 目前沒有 Vulnerabilities (Apr 4, 2024)
https://www.twingate.com/blog/tips/bootstrap-vulnerabilities

CVE-2024-6484
https://www.herodevs.com/vulnerability-directory/cve-2024-6484
跨站腳本,影響:>=2.0.0 且 <=3.4.1

弱點 CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
https://cwe.mitre.org/data/definitions/79

參考
https://www.herodevs.com/vulnerability-directory/cve-2024-6484

NuGet - bootstrap 5.3.3 是目前最新版了
https://getbootstrap.com/
https://www.nuget.org/packages/bootstrap


不知是弱點太新,很多資訊來源尚未更新,還是 Dependency-Track (DT) 誤判,尚待觀察。

如果沒有 data-slide 和 data-slide-to 屬性使用就不用擔心此弱點。

(完)

2024年10月9日 星期三

[研究]ASP.NET,WebForm, NuGet安裝ClosedXML 0.104.1相依套件測試

[研究]ASP.NET,WebForm, NuGet安裝ClosedXML 0.104.1相依套件測試

2024-10-09

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C# + SQL Server 2019 + SQL Server Management Studio (SSMS) 19

********************************************************************************

WebApplication1

正在安裝:

DocumentFormat.OpenXml.Framework.3.0.1

DocumentFormat.OpenXml.3.0.1

ExcelNumberFormat.1.1.0

Microsoft.Bcl.HashCode.1.1.1

Microsoft.NETCore.Platforms.1.1.0

Microsoft.Win32.Primitives.4.3.0

System.AppContext.4.3.0

System.Buffers.4.5.1

System.Collections.4.3.0

System.Collections.Concurrent.4.3.0

System.Console.4.3.0

System.Diagnostics.Debug.4.3.0

System.Diagnostics.DiagnosticSource.4.3.0

System.Diagnostics.Tools.4.3.0

System.Diagnostics.Tracing.4.3.0

System.Globalization.4.3.0

System.Globalization.Calendars.4.3.0

System.IO.4.3.0

System.IO.Compression.4.3.0

System.IO.Compression.ZipFile.4.3.0

System.IO.FileSystem.Primitives.4.3.0

System.IO.FileSystem.4.3.0

System.IO.Packaging.8.0.0

System.Linq.4.3.0

System.Linq.Expressions.4.3.0

System.Net.Primitives.4.3.0

System.Net.Sockets.4.3.0

System.Numerics.Vectors.4.5.0

System.ObjectModel.4.3.0

System.Reflection.4.3.0

System.Reflection.Extensions.4.3.0

System.Reflection.Primitives.4.3.0

System.Resources.ResourceManager.4.3.0

System.Runtime.4.3.0

System.Runtime.CompilerServices.Unsafe.4.7.0

System.Memory.4.5.4

ClosedXML.Parser.1.2.0

SixLabors.Fonts.1.0.0

System.Runtime.Extensions.4.3.0

System.Runtime.Handles.4.3.0

System.Runtime.InteropServices.4.3.0

System.Runtime.InteropServices.RuntimeInformation.4.3.0

System.Runtime.Numerics.4.3.0

System.Security.Cryptography.Encoding.4.3.0

System.Security.Cryptography.Primitives.4.3.0

System.Security.Cryptography.Algorithms.4.3.0

System.Security.Cryptography.X509Certificates.4.3.0

System.Net.Http.4.3.0

System.Text.Encoding.4.3.0

System.Text.Encoding.Extensions.4.3.0

System.Text.RegularExpressions.4.3.0

System.Threading.4.3.0

System.Threading.Tasks.4.3.0

System.Threading.Timer.4.3.0

System.Xml.ReaderWriter.4.3.0

System.Xml.XDocument.4.3.0

NETStandard.Library.1.6.1

RBush.3.2.0

ClosedXML.0.104.1

成功

********************************************************************************

再次更新

WebApplication1

更新:

NETStandard.Library.1.6.1 -> NETStandard.Library.2.0.3

System.Xml.ReaderWriter.4.3.0 -> System.Xml.ReaderWriter.4.3.1

System.Text.RegularExpressions.4.3.0 -> System.Text.RegularExpressions.4.3.1

System.Net.Http.4.3.0 -> System.Net.Http.4.3.4

System.Security.Cryptography.X509Certificates.4.3.0 -> System.Security.Cryptography.X509Certificates.4.3.2

System.Security.Cryptography.Algorithms.4.3.0 -> System.Security.Cryptography.Algorithms.4.3.1

System.Runtime.Extensions.4.3.0 -> System.Runtime.Extensions.4.3.1

SixLabors.Fonts.1.0.0 -> SixLabors.Fonts.2.0.4

System.Memory.4.5.4 -> System.Memory.4.5.5

System.Runtime.CompilerServices.Unsafe.4.7.0 -> System.Runtime.CompilerServices.Unsafe.6.0.0

System.Runtime.4.3.0 -> System.Runtime.4.3.1

System.Net.Primitives.4.3.0 -> System.Net.Primitives.4.3.1

System.IO.Packaging.8.0.0 -> System.IO.Packaging.8.0.1

System.Diagnostics.DiagnosticSource.4.3.0 -> System.Diagnostics.DiagnosticSource.8.0.1

System.Console.4.3.0 -> System.Console.4.3.1

Microsoft.NETCore.Platforms.1.1.0 -> Microsoft.NETCore.Platforms.7.0.4

Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1 -> Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0

DocumentFormat.OpenXml.3.0.1 -> DocumentFormat.OpenXml.3.1.0

DocumentFormat.OpenXml.Framework.3.0.1 -> DocumentFormat.OpenXml.Framework.3.1.0

出現

嚴重性 程式碼 說明 專案 檔案 隱藏項目狀態

錯誤 無法安裝封裝 'SixLabors.Fonts 2.0.4'。您正嘗試將此封裝安裝到以 '.NETFramework,Version=v4.8' 為目標的專案,但該封裝不包含任何與架構相容的組件參考或內容檔。如需詳細資訊,請連絡封裝作者。

但是這個專案就是 4.8 啊?


********************************************************************************
把 SixLabors.Fonts 勾選取消,再一次


WebApplication1

更新:

NETStandard.Library.1.6.1 -> NETStandard.Library.2.0.3
System.Xml.ReaderWriter.4.3.0 -> System.Xml.ReaderWriter.4.3.1
System.Text.RegularExpressions.4.3.0 -> System.Text.RegularExpressions.4.3.1
System.Net.Http.4.3.0 -> System.Net.Http.4.3.4
System.Security.Cryptography.X509Certificates.4.3.0 -> System.Security.Cryptography.X509Certificates.4.3.2
System.Security.Cryptography.Algorithms.4.3.0 -> System.Security.Cryptography.Algorithms.4.3.1
System.Runtime.Extensions.4.3.0 -> System.Runtime.Extensions.4.3.1
System.Memory.4.5.4 -> System.Memory.4.5.5
System.Runtime.CompilerServices.Unsafe.4.7.0 -> System.Runtime.CompilerServices.Unsafe.6.0.0
System.Runtime.4.3.0 -> System.Runtime.4.3.1
System.Net.Primitives.4.3.0 -> System.Net.Primitives.4.3.1
System.IO.Packaging.8.0.0 -> System.IO.Packaging.8.0.1
System.Diagnostics.DiagnosticSource.4.3.0 -> System.Diagnostics.DiagnosticSource.8.0.1
System.Console.4.3.0 -> System.Console.4.3.1
Microsoft.NETCore.Platforms.1.1.0 -> Microsoft.NETCore.Platforms.7.0.4
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1 -> Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0
DocumentFormat.OpenXml.3.0.1 -> DocumentFormat.OpenXml.3.1.0
DocumentFormat.OpenXml.Framework.3.0.1 -> DocumentFormat.OpenXml.Framework.3.1.0

嚴重性 程式碼 說明 專案 檔案 隱藏項目狀態
錯誤 由於另一個處理序正在使用檔案 'C:\CodeTemp6\WebApplication1\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\tasks/DotNetCompilerPlatformTasks.dll',所以無法存取該檔案。


********************************************************************************

再次


WebApplication1

更新:

NETStandard.Library.1.6.1 -> NETStandard.Library.2.0.3

System.Xml.ReaderWriter.4.3.0 -> System.Xml.ReaderWriter.4.3.1

System.Text.RegularExpressions.4.3.0 -> System.Text.RegularExpressions.4.3.1

System.Net.Http.4.3.0 -> System.Net.Http.4.3.4

System.Security.Cryptography.X509Certificates.4.3.0 -> System.Security.Cryptography.X509Certificates.4.3.2

System.Security.Cryptography.Algorithms.4.3.0 -> System.Security.Cryptography.Algorithms.4.3.1

System.Runtime.Extensions.4.3.0 -> System.Runtime.Extensions.4.3.1

System.Memory.4.5.4 -> System.Memory.4.5.5

System.Runtime.CompilerServices.Unsafe.4.7.0 -> System.Runtime.CompilerServices.Unsafe.6.0.0

System.Runtime.4.3.0 -> System.Runtime.4.3.1

System.Net.Primitives.4.3.0 -> System.Net.Primitives.4.3.1

System.IO.Packaging.8.0.0 -> System.IO.Packaging.8.0.1

System.Diagnostics.DiagnosticSource.4.3.0 -> System.Diagnostics.DiagnosticSource.8.0.1

System.Console.4.3.0 -> System.Console.4.3.1

Microsoft.NETCore.Platforms.1.1.0 -> Microsoft.NETCore.Platforms.7.0.4

Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1 -> Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0

DocumentFormat.OpenXml.3.0.1 -> DocumentFormat.OpenXml.3.1.0

DocumentFormat.OpenXml.Framework.3.0.1 -> DocumentFormat.OpenXml.Framework.3.1.0

成功

最後只剩下

********************************************************************************

packages.config 內容

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="ClosedXML" version="0.104.1" targetFramework="net48" />
  <package id="ClosedXML.Parser" version="1.2.0" targetFramework="net48" />
  <package id="DocumentFormat.OpenXml" version="3.1.0" targetFramework="net48" />
  <package id="DocumentFormat.OpenXml.Framework" version="3.1.0" targetFramework="net48" />
  <package id="ExcelNumberFormat" version="1.1.0" targetFramework="net48" />
  <package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net48" />
  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
  <package id="Microsoft.NETCore.Platforms" version="7.0.4" targetFramework="net48" />
  <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net48" />
  <package id="NETStandard.Library" version="2.0.3" targetFramework="net48" />
  <package id="RBush" version="3.2.0" targetFramework="net48" />
  <package id="SixLabors.Fonts" version="1.0.0" targetFramework="net48" />
  <package id="System.AppContext" version="4.3.0" targetFramework="net48" />
  <package id="System.Buffers" version="4.5.1" targetFramework="net48" />
  <package id="System.Collections" version="4.3.0" targetFramework="net48" />
  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net48" />
  <package id="System.Console" version="4.3.1" targetFramework="net48" />
  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net48" />
  <package id="System.Diagnostics.DiagnosticSource" version="8.0.1" targetFramework="net48" />
  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net48" />
  <package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net48" />
  <package id="System.Globalization" version="4.3.0" targetFramework="net48" />
  <package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net48" />
  <package id="System.IO" version="4.3.0" targetFramework="net48" />
  <package id="System.IO.Compression" version="4.3.0" targetFramework="net48" />
  <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net48" />
  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net48" />
  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net48" />
  <package id="System.IO.Packaging" version="8.0.1" targetFramework="net48" />
  <package id="System.Linq" version="4.3.0" targetFramework="net48" />
  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net48" />
  <package id="System.Memory" version="4.5.5" targetFramework="net48" />
  <package id="System.Net.Http" version="4.3.4" targetFramework="net48" />
  <package id="System.Net.Primitives" version="4.3.1" targetFramework="net48" />
  <package id="System.Net.Sockets" version="4.3.0" targetFramework="net48" />
  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
  <package id="System.ObjectModel" version="4.3.0" targetFramework="net48" />
  <package id="System.Reflection" version="4.3.0" targetFramework="net48" />
  <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net48" />
  <package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net48" />
  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net48" />
  <package id="System.Runtime" version="4.3.1" targetFramework="net48" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
  <package id="System.Runtime.Extensions" version="4.3.1" targetFramework="net48" />
  <package id="System.Runtime.Handles" version="4.3.0" targetFramework="net48" />
  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net48" />
  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net48" />
  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net48" />
  <package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net48" />
  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net48" />
  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net48" />
  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net48" />
  <package id="System.Text.RegularExpressions" version="4.3.1" targetFramework="net48" />
  <package id="System.Threading" version="4.3.0" targetFramework="net48" />
  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net48" />
  <package id="System.Threading.Timer" version="4.3.0" targetFramework="net48" />
  <package id="System.Xml.ReaderWriter" version="4.3.1" targetFramework="net48" />
  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net48" />
</packages>


相依套件頗多的,比較重要是 DocumentFormat.OpenXml,而且必須是 3.x 版才行。

********************************************************************************

額外補充




嚴重性 程式碼 說明 專案 檔案 隱藏項目狀態
錯誤 無法安裝封裝 'SixLabors.Fonts 2.0.4'。您正嘗試將此封裝安裝到以 '.NETFramework,Version=v4.8' 為目標的專案,但該封裝不包含任何與架構相容的組件參考或內容檔。如需詳細資訊,請連絡封裝作者。

SixLabors.Fonts 1.0.1 支援 .NET Core 3.1 和 .NET Standard 2.0

SixLabors.Fonts 2.0.4 支援 .NET 6.0

(完)

相關

[研究]WebInspect報告有Insecure Transport: Insufficient Diffie Hellman Strength ( 11520 )嚴重弱點

[研究]WebInspect報告有Insecure Transport: Insufficient Diffie Hellman Strength ( 11520 )嚴重弱點

2024-10-09

下圖,WebInspect報告有Insecure Transport: Insufficient Diffie Hellman Strength ( 11520 )嚴重弱點


下圖,nmap 7.95報告只是 Warning 而已
nmap --script ssl-enum-ciphers -p 443 <server-ip>

基本上,關閉這2個 Cipher Suites 就好

TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 1024)

TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 1024)

********************************************************************************
【解決】

下圖,使用 IIS Crypto 3.3 Build 17 - Released October 31, 2022
下載和執行 IISCrypto.exe 進行設定,若這2個有被勾選,取消勾選,重新啟動 Windows 即可。



下圖,或修改 Registry 機碼設定 
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\KeyExchangeAlgorithms\Diffie-Hellman
新增或修改一個名為 ClientMinKeyBitLength 的 DWORD 值,設置其值為 2048(單位:bit),重新啟動 Windows 

如果 nmap掃描依然存在,可能是其他問題。

下圖,直接在受測主機本機,用 nmap 測試,居然和從別台用 nmap 掃描的結果不同,和網管詢問,得知同網段掃描會過 WAF,有可能因此受影響,其實真正的受測主機,並無此弱點。

其他經過的網通 or 資安設備可能也會影響,掃描工具盡可能要能繞過它們,否則掃描結果錯誤,拼命從受測主機上解決,根本解決不掉,因為它根本沒問題。


(完)

2024年10月8日 星期二

[研究]Windows Server 2022關閉 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 1024) 和 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 1024)的影響

[研究]Windows Server 2022關閉 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 1024) 和 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 1024)的影響

2024-10-08

nmap掃描結果


TLSv1.2:

ciphers:

  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (secp521r1)
  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (secp521r1)
  • TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048)
  • TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048)
  • TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 1024)
  • TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 1024)

warnings:

Key exchange (dh 1024) of lower strength than certificate key

********************************************************************************

【敝人未驗證,僅供參考】

如果 Windows Server 2022 的 Web Server 僅提供下面4種 Cipher,那些用戶端 Windows 版本將無法連上 Web Serverv  ?

  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (secp521r1)
  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (secp521r1)
  • TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048)
  • TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048)

ChatGPT 說:

在你提供的情況下,Windows Server 2022 的 Web Server 僅支援這四種 Cipher 套件。它們分別為:

  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (secp521r1)
  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (secp521r1)
  • TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048)
  • TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048)

這些 Cipher 套件對應的客戶端要求如下:

  • RSA-based Cipher Suites(如第三和第四條):較舊的 Windows 版本,如 Windows 7、Windows Vista 及 Windows XP,在預設配置下可能不支援這些高級的 Cipher。雖然 Windows 7 可通過更新支援 TLS 1.2,但其仍可能無法預設支援 GCM 模式或更高的 RSA 鍵長。
  • ECDHE-based Cipher Suites(如第一和第二條):這些 Cipher 套件要求較新版本的 Windows 支援。Windows 7、Windows Vista、Windows XP(甚至通過更新後)通常不支援 secp521r1 橢圓曲線,因為它們的預設橢圓曲線只包含少數幾個常見的(例如 secp256r1)。Windows 8.1、Windows 10 以及更新版本才較可能預設支援這些 Cipher 套件和曲線。

可能無法連接到 Web Server 的客戶端 Windows 版本:

  • Windows XP:不支援 TLS 1.2,無法與這些 Cipher 套件兼容。
  • Windows Vista:預設不支援 TLS 1.2,也無法支援高級的 RSA 或 ECDHE Cipher 套件,無法連接。
  • Windows 7(未更新):如果沒有啟用 TLS 1.2,無法支援這些 Cipher,即使啟用了 TLS 1.2,也可能無法支援 secp521r1 橢圓曲線。
  • Windows 8:這些版本可能支援 TLS 1.2,但未必支援 secp521r1 橢圓曲線,因此對於 ECDHE 的 Cipher 套件會有問題。
會支持這些 Cipher 套件的客戶端 Windows 版本:
  • Windows 8.1 和更新的版本(例如 Windows 10、Windows 11):這些版本預設支援 TLS 1.2 並包括對這些 Cipher 套件的支援。

因此,Windows XP、Windows Vista、Windows 7 和 Windows 8 的某些版本可能無法連上你的 Web Server。

********************************************************************************

那些 Windows 作業系統支援下面 Cipher 

  • TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (dh 1024)
  • TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (dh 1024)

ChatGPT 說:

這兩個 Cipher 套件使用 DHE (Diffie-Hellman Ephemeral) 密鑰交換,並分別提供 128 位元和256 位元 AES-GCM 加密。

對於這些 Cipher 套件的支援情況,取決於 Windows 作業系統對於 DHE 和 AES-GCM 加密的支援能力。

Cipher 套件:

  • TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (DH 1024)
  • TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (DH 1024)

支援這些 Cipher 套件的 Windows 作業系統版本:

  • Windows 10 和更新版本(如 Windows 11):支援這些 Cipher 套件,因為它們支援 AES-GCM 和 DHE 密鑰交換,並且在安全協定中強制使用較高的 Diffie-Hellman 參數。
  • Windows 8.1:支援 TLS 1.2 並包括 DHE 和 AES-GCM 套件,因此這些 Cipher 可以在此系統上正常運行。
  • Windows Server 2012 R2 和更新版本:同樣支援這些 Cipher 套件,因為這些版本內建 TLS 1.2 和所需的加密演算法。

可能需要配置才能支援:

  • Windows 7:預設不支援 DHE_RSA 套件,但透過更新和啟用 TLS 1.2,可以添加支援。不過,1024 位元的 Diffie-Hellman 參數可能需要進行系統設定調整。
  • Windows 8:支援 TLS 1.2,但預設並不強化對 DHE 的支援,因此,DHE_RSA 的 Cipher 套件可能不完全受支援,並且也可能需要手動配置。

無法支援這些 Cipher 套件的 Windows 作業系統:

  • Windows XP 和 Windows Vista:這些系統不支援 TLS 1.2,且無法支援這些高級 Cipher 套件,即使有更新也無法支援 AES-GCM 和 DHE。

總結:

  • Windows 10 和更新版本:預設支援。
  • Windows 8.1 和 Windows Server 2012 R2 及更新版本:預設支援。
  • Windows 7 和 Windows 8:可能需要進行設定更新。
  • Windows XP 和 Windows Vista:無法支援這些 Cipher 套件。

因此,使用較舊的 Windows 版本(例如 Windows 7 或更早版本)可能無法無縫支援這些 Cipher 套件,或需要進行更新和手動設定。

********************************************************************************

(完)

2024年10月7日 星期一

[研究]bootstrap 3.4.1弱點CVE-2024-6485

[研究]bootstrap 3.4.1弱點CVE-2024-6485

2024-10-01

********************************************************************************

EOL (End of Life)

bootstrap 3.4.1 是 13 Feb 2019 釋出。

End of Life Status Bootstrap 4
https://getbootstrap.com/docs/4.6/end-of-life/
Bootstrap 3 reached end of life July 24, 2019, followed by Bootstrap 4 on January 1, 2023

********************************************************************************

該漏洞為網頁前端使用data-loading-text屬性才有機會觸發該漏洞,若專案無使用該屬性不受影響;另外,若使用者輸入皆於伺服器端檢查與過濾,不受此弱點影響。 

********************************************************************************

美國國家弱點資料庫( NVD, National Vulnerability Database )

根據NVD,bootstrap 3.4.1 並沒有弱點 

https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.3&keyword=cpe%3A2.3%3Aa%3Agetbootstrap%3Abootstrap%3A3.4.1%3A*%3A*%3A*%3A*%3A*%3A*%3A*

https://nvd.nist.gov/products/cpe/detail/6D2FBAA4-7EB8-42ED-9BD3-6209BECA01CF?namingFormat=2.3&orderBy=CPEURI&keyword=cpe%3A2.3%3Aa%3Agetbootstrap%3Abootstrap%3A3.4.1%3A*%3A*%3A*%3A*%3A*%3A*%3A*&status=FINAL
(更新日期 05/07/2019)

https://nvd.nist.gov/vuln/search/results?adv_search=true&isCpeNameSearch=true&query=cpe%3A2.3%3Aa%3Agetbootstrap%3Abootstrap%3A3.4.1%3A*%3A*%3A*%3A*%3A*%3A*%3A*

**********

根據這篇,NIST對CVE-2024-6485是等待分析。
https://nvd.nist.gov/vuln/detail/CVE-2024-6485

********************************************************************************

CVEdetails

CVE-2024-6485
https://www.cvedetails.com/cve/CVE-2024-6485/
A security vulnerability has been discovered in bootstrap that could enable Cross-Site Scripting (XSS) attacks. The vulnerability is associated with the data-loading-text attribute within the button plugin. This vulnerability can be exploited by injecting malicious JavaScript code into the attribute, which would then be executed when the button's loading state is triggered.

2024-07-11 18:09:59 公布的,認為 bootstrap 有弱點,沒說版本範圍。

整個網站也搜不到明確說 3.4.1 有 CVE-2024-6485 弱點。

********************************************************************************

HeroDevs公司

CVE-2024-6485
https://zh.herodevs.com/vulnerability-directory/cve-2024-6485

boostrap >=2.0.0 且 boostrap <=3.4.1 有 CVE-2024-6485 弱點

註:HeroDevs 是一家專注於開源軟體開發的公司,成立於 2018 年。該公司提供開源軟體包和專家服務,幫助用戶安全且合規地使用軟體,並在需要時進行遷移。

********************************************************************************

要注意的是,Bootstrap 3, 4, 5 都是大改版,敝人測試過某些專案,Bootstrap 3.4.1 => Bootstrap 5.x 或 Bootstrap 4.x => Bootstrap 5.x,會導致版面美工或某些功能異常,官方也沒有工具可以輕鬆升級,必須實際測試和手工調整,最好安排足夠的時間去升級、測試和修改。 

基本上,因為 Bootstrap 3 和  Bootstrap 4 都已經 EOS,就算不受此次影響,建議盡量升級到 Bootstrap 5。避免日後發現嚴重漏洞一定要升級時,時間不足,措手不及。

(完)

2024年10月5日 星期六

2024年10月4日 星期五

[研究]查記憶體硬體資訊 (Windows)

[研究]查記憶體硬體資訊 (Windows)

2024-10-04

畫面是擷取自不同台電腦,故不一致。

********************************************************************************

裝置管理員

裝置管理員不直接顯示記憶體(RAM)的容量或速度,這些資訊通常需要使用其他工具來查看。例如,您可以使用 BIOS 設定界面、Task Manager(工作管理員)、或 wmic 命令來查詢詳細的記憶體資訊。

********************************************************************************



********************************************************************************

命令提示字元systeminfo指令

C:\Users\Administrator>systeminfo

主機名稱:             WIN2019STD
作業系統名稱:         Microsoft Windows Server 2019 Standard
作業系統版本:         10.0.17763 N/A 組建 17763
作業系統製造商:       Microsoft Corporation
作業系統設定:         獨立伺服器
作業系統組建類型:     Multiprocessor Free
註冊的擁有者:         Windows 使用者
註冊公司:
產品識別碼:           00429-00520-64594-AA611
原始安裝日期:         2020/9/10, 上午 10:40:45
系統開機時間:         2024/9/16, 下午 03:47:20
系統製造商:           ASUSTeK COMPUTER INC.
系統型號:             ASUSPRO D840MB_D840MA
系統類型:             x64-based PC
處理器:               已安裝 1 處理器。
                      [01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~3201 Mhz
BIOS 版本:            ASUSTek COMPUTER INC. 306, 2019/1/23
Windows 目錄:         C:\Windows
系統目錄:             C:\Windows\system32
開機裝置:             \Device\HarddiskVolume2
系統地區設定:         zh-tw;中文 (台灣)
輸入法地區設定:       zh-tw;中文 (台灣)
時區:                 (UTC+08:00) 台北
實體記憶體總計:       32,571 MB
可用實體記憶體:       21,870 MB
虛擬記憶體: 大小上限: 37,435 MB
虛擬記憶體: 可用:     25,285 MB
虛擬記憶體: 使用中:   12,150 MB
分頁檔位置:           C:\pagefile.sys
網域:                 WORKGROUP
登入伺服器:           \\WIN2019STD
Hotfix:               已安裝 42 Hotfix。
                      [01]: KB5041974
                      [02]: KB4486153
                      [03]: KB4486156
                      [04]: KB4535680
                      [05]: KB4566424
                      [06]: KB4570332
                      [07]: KB4577586
                      [08]: KB4577667
                      [09]: KB4587735
                      [10]: KB4589208
                      [11]: KB4598480
                      [12]: KB5000859
                      [13]: KB5001404
                      [14]: KB5003243
                      [15]: KB5003711
                      [16]: KB5004424
                      [17]: KB5005112
                      [18]: KB5043050
                      [19]: KB5006754
                      [20]: KB5008539
                      [21]: KB5008287
                      [22]: KB5009642
                      [23]: KB5011574
                      [24]: KB5012675
                      [25]: KB5014031
                      [26]: KB5014797
                      [27]: KB5015896
                      [28]: KB5017400
                      [29]: KB5020374
                      [30]: KB5023789
                      [31]: KB5028316
                      [32]: KB5030505
                      [33]: KB5031589
                      [34]: KB5032306
                      [35]: KB5034863
                      [36]: KB5035963
                      [37]: KB5037017
                      [38]: KB5039335
                      [39]: KB5040563
                      [40]: KB5041577
                      [41]: KB5043126
                      [42]: KB5005701
網路卡:               已安裝 3 NIC。
                      [01]: Intel(R) Ethernet Connection (7) I219-LM
                            連線名稱:           乙太網路
                            DHCP 已啟用:          否
                            IP 位址
                            [01]: 10.3.121.11
                      [02]: VMware Virtual Ethernet Adapter for VMnet1
                            連線名稱:           VMware Network Adapter VMnet1
                            DHCP 已啟用:          否
                            IP 位址
                            [01]: 192.168.129.1
                            [02]: fe80::979a:e916:1421:9b2f
                      [03]: VMware Virtual Ethernet Adapter for VMnet8
                            連線名稱:           VMware Network Adapter VMnet8
                            DHCP 已啟用:          否
                            IP 位址
                            [01]: 192.168.128.1
                            [02]: fe80::bc96:8760:205b:3b04
Hyper-V 需求:         VM 監視器模式擴充: 是
                      韌體中已啟用虛擬化: 是
                      第二層位址轉譯: 是
                      具有資料執行防止: 是

C:\Users\Administrator>


命令提示字元 wmic memorychip 指令

C:\Users\Administrator>wmic memorychip
Attributes  BankLabel  Capacity     Caption     ConfiguredClockSpeed  ConfiguredVoltage  CreationClassName     DataWidth  Description  DeviceLocator   FormFactor  HotSwappable  InstallDate  InterleaveDataDepth  InterleavePosition  Manufacturer  MaxVoltage  MemoryType  MinVoltage  Model  Name        OtherIdentifyingInfo  PartNumber        PositionInRow  PoweredOn  Removable  Replaceable  SerialNumber  SKU  SMBIOSMemoryType  Speed  Status  Tag                TotalWidth  TypeDetail  Version
2           BANK 0     17179869184  實體記憶體  2666                  1200               Win32_PhysicalMemory  64         實體記憶體   ChannelA-DIMM1  8                                      2                    1                   Samsung       0           0           0                  實體記憶體                        M378A2K43CB1-CTD                                                    03239B2B           26                2666           Physical Memory 0  64          128
2           BANK 2     17179869184  實體記憶體  2666                  1200               Win32_PhysicalMemory  64         實體記憶體   ChannelB-DIMM1  8                                      2                    2                   Samsung       0           0           0                  實體記憶體                        M378A2K43CB1-CTD                                                    0323996D           26                2666           Physical Memory 2  64          128

C:\Users\Administrator>

命令提示字元 wmic memorychip list full 指令

C:\Users\Administrator>wmic memorychip list full


BankLabel=BANK 0
Capacity=17179869184
DataWidth=64
Description=實體記憶體
DeviceLocator=ChannelA-DIMM1
FormFactor=8
HotSwappable=
InstallDate=
InterleaveDataDepth=2
InterleavePosition=1
Manufacturer=Samsung
MemoryType=0
Model=
Name=實體記憶體
OtherIdentifyingInfo=
PartNumber=M378A2K43CB1-CTD
PositionInRow=
PoweredOn=
Removable=
Replaceable=
SerialNumber=03239B2B
SKU=
Speed=2666
Status=
Tag=Physical Memory 0
TotalWidth=64
TypeDetail=128
Version=


BankLabel=BANK 2
Capacity=17179869184
DataWidth=64
Description=實體記憶體
DeviceLocator=ChannelB-DIMM1
FormFactor=8
HotSwappable=
InstallDate=
InterleaveDataDepth=2
InterleavePosition=2
Manufacturer=Samsung
MemoryType=0
Model=
Name=實體記憶體
OtherIdentifyingInfo=
PartNumber=M378A2K43CB1-CTD
PositionInRow=
PoweredOn=
Removable=
Replaceable=
SerialNumber=0323996D
SKU=
Speed=2666
Status=
Tag=Physical Memory 2
TotalWidth=64
TypeDetail=128
Version=

C:\Users\Administrator>

命令提示字元 wmic memorychip get capacity 指令

C:\Users\Administrator>wmic memorychip get capacity
Capacity
17179869184
17179869184

C:\Users\Administrator>


********************************************************************************

Windows PowerShell


PS C:\Users\Administrator> Get-WmiObject -Class Win32_PhysicalMemory | Select-Object Manufacturer, Capacity, Speed, PartNumber

Manufacturer    Capacity Speed PartNumber
------------    -------- ----- ----------
Samsung      17179869184  2666 M378A2K43CB1-CTD
Samsung      17179869184  2666 M378A2K43CB1-CTD


PS C:\Users\Administrator> Get-CimInstance -ClassName Win32_PhysicalMemory | Select-Object Manufacturer, Capacity, Speed, PartNumber

Manufacturer    Capacity Speed PartNumber
------------    -------- ----- ----------
Samsung      17179869184  2666 M378A2K43CB1-CTD
Samsung      17179869184  2666 M378A2K43CB1-CTD


PS C:\Users\Administrator>

********************************************************************************

HWiNFO 8.12 免安裝版 - 電腦硬體規格檢查軟體

https://www.hwinfo.com/download/





(完)

相關

[研究]Windows 11 24H2 商業專業版安裝

[研究]Windows 11 24H2 商業專業版安裝

2024-10-04

MSDN,zh-tw_windows_11_business_editions_version_24h2_x64_dvd_a9b30de5.iso

5.33 GB (5,725,741,056 位元組)



































(完)

相關

[研究]Windows 11 24H2 商業專業版安裝
https://shaurong.blogspot.com/2024/10/windows-11-24h2_16.html

[研究]Windows 11 24H2 消費者專業版(跳過Microsoft帳戶)安裝
https://shaurong.blogspot.com/2024/10/windows-11-24h2-microsoft.html

[研究]Windows 11 24H2 消費者專業版(無SecureBoot)安裝
https://shaurong.blogspot.com/2024/10/windows-11-24h2-secureboot.html

[研究]Windows 11 24H2 消費者專業版安裝
https://shaurong.blogspot.com/2024/10/windows-11-24h2_4.html

[研究]Windows 11 24H2 專業版安裝失敗
https://shaurong.blogspot.com/2024/10/windows-11-24h2.html