2025年2月22日 星期六

XAMPP 漏洞修補 手動更新 2.4.63

xampp中,將 apache mysql都stop

Apache(下載 https://www.apachelounge.com/download/)

1先把原Apache 改名為 apache2458
2.解壓更新檔
3.copy to  Xampp 為 apache
4. copy apache2458中的 conf 到新的 apache中
-----------------------------------------------------
PHP (下載 X64 thread檔) https://windows.php.net/download/

1.複製原php 改名為 php8212
2.把新版本的  php8227 解壓縮後,全部複製到 php (覆蓋Yes)
--------------------------------------------------------
啟動
Xampp apache mysql

執行 http://127.0.0.1:8080/dashboard/phpinfo.php

檢查版本是否升級。

2.4.63 升級需 Server.crt需要重做2048長度
參考

解決 XAMPP的弱點掃瞄:35291 SSL Certificate Signed Using Weak Hashing Algorithm 與重建憑證2048位元

XAMPP的vhost與SSL設定 重建憑證2048位元


 解決

弱點掃瞄:
SSL Certificate Signed Using Weak Hashing Algorithm

編號: 35291

---------------------------------------------

停止Apache

copy c:\xampp\apache 並更名到 c:\apache24
先把 c:\xampp\apache\conf 建立 ssl 資料夾
把原 c:\xampp\apache\con\ssl.crt ssl.csr ssl.key資料夾內的檔案更名為*-old

---------------SSL設定禁用SHA1----------------------------
修正 c:\xampp\apache\conf\extra\httpd-ssl.conf 

52 SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES:!SHA1
53 SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES:!SHA1
---------------重建憑證2048位元用key---------------------------



CMD 命令列視窗模式到 c:\xampp\apache\bin 

檢查現有憑證是否 SHA1 
.\openssl x509 -in C:\xampp\apache\conf\ssl.crt\server-old.crt -text -noout

重建憑證用的Key
.\openssl genrsa -out C:\xampp\apache\conf\ssl\server.key 2048

openssl req -new -key C:\xampp\apache\conf\ssl\server.key -out C:\xampp\apache\conf\ssl\server.csr

-----憑證內資料設定------------
Country Name (2 letter code) [AU]:TW
State or Province Name (full name) [Some-State]:taipei
Locality Name (eg, city) []:taipei
Organization Name (eg, company) [Internet Widgits Pty Ltd]:LongBow
Organizational Unit Name (eg, section) []:LonBow
Common Name (e.g. server FQDN or YOUR name) []:localhost
Email Address []:slchang@bmeservice.net

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:bme8888
An optional company name []:Bmeservice


---------------重建憑證2048位元---------------------------
.\openssl x509 -req -days 365 -in C:\xampp\apache\conf\ssl\server.csr -signkey C:\xampp\apache\conf\ssl\server.key -out C:\xampp\apache\conf\ssl\server.crt

再把 c:\xampp\apache\conf\ssl的新建資料, 分別放入對應的資料夾

可以把c:\apache24 刪除

---------------更新到2.4.63---------------------------
把原 c:\xampp\apache\conf 資料copy 到原 c:\xampp\apache2463 (全部覆蓋)
把 apache 更名為apache2462
把 apache2463 更名為apache

啟動 Apache 

更新到2.4.63 (因為server.csr已更新到2048)