跳到主要內容

發表文章

以 PowerShell 建立 Switch Embedded Teaming (SET)

最近的文章

憑證檔案格式與應用場景對照表

副檔名 主要內容 公鑰 私鑰 憑證鏈 封裝檔 密碼保護情況 應用場景 .crt / .cer X.509 憑證(Base64 或二進位 DER) ✓ ✗ ✓(可含中繼憑證) ✗ 不需要(只有公鑰) 網站 SSL/TLS 部署(Apache/Nginx/IIS 等),也可作為客戶端憑證 .der X.509 憑證(二進位) ✓ ✗ ✗(通常單一憑證) ✗ 不需要(只有公鑰) Java Keystore (JKS)、防火牆或設備匯入 .csr 憑證簽署請求(公鑰 + 主體資訊) ✓ ✗ ✗ ✗ 不需要(只有公鑰) 提交給 CA 申請憑證,僅用於憑證簽署請求 .key 私鑰(PEM 或 DER 格式) ✗ ✓ ✗ ✗ 可選(有無加密皆可) 伺服器端私鑰檔,與 .crt 搭配使用(如 Nginx/Apache HTTPS) .pem 容器格式(可含憑證、公鑰、私鑰) ✓ ✓(若含) ✓(可含中繼憑證) ✗ 可選:憑證 → 無需密碼;私鑰 → 可加密 Linux/OpenSSL 環境常見(Apache、Postfix、HAProxy、Kub...

Windows 11 移除預先佈建的應用程式 (Provisioned Package)

Provisioned Package (預先佈建的應用程式) PowerShell # 列出目前的 Provisioned Package: Get-AppxProvisionedPackage -Online | Format-Table DisplayName, PackageFullName PowerShell # 除特定的 Provisioned App: Remove-AppxProvisionedPackage -Online -PackageName <packagefullname> Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -like "*Xbox*"} | Remove-AppxProvisionedPackage -Online <packagefullname> PowerShell # 移除所有使用者已安裝和預先布建的 AppxPackage: $packagefullname = (Get-AppxProvisionedPackage -online | Where-Object {$_.DisplayName -like "*應用程式名稱*"}).PackageFullName if ($packagefullname) { Get-AppxPackage -AllUsers | Where-Object {$_.PackageFullName -like $packagefullname} | Remove-AppxPackage Remove-AppxProvisionedPackage -online -PackageName $packagefullname }

客製 Windows 11 安裝光碟

假設  install.wim 所在目錄為:D:\CustomWin11  wim 掛載目錄:D:\CustomWin11\WIM 將索引3 中指定的 AppXProvisioned Package 移除   PowerShell # 列出 install.wim 的索引資訊: dism /get-wiminfo /wimfile:D:\CustomWin11\install.wim 上圖可知,此映像有五個索引,所以要針對每一個索引做處理 PowerShell # 掛載每個索引 範例 dism /mount-wim /wimfile:D:\CustomWin11\install.wim /index:3 /mountdir:D:\CustomWin11\WIM PowerShell # 列出預配置的應用 dism /image:D:\CustomWin11\WIM /get-provisionedappxpackages PowerShell # 移除不需要的應用 dism /image:D:\CustomWin11\WIM /remove-provisionedappxpackage /packagename:Microsoft.YourAppName_* PowerShell $apps=@( #"Microsoft 新聞、搜尋、天氣" "*Bing*" #"Xbox" "*xbox*" "*Gaming*" #"Office 365" "*MicrosoftOfficeHub*" #"Solitaire & Casual Games" "*SolitaireCollection*" #"Outlook for Windows" "*OutlookForWindows*" #"Goove Music" "*ZuneMu...

Block ICMP timestamp on FortiGate interface (CVE-1999-0524)

 今年的弱掃,被掃出一個 low 等級弱點:『ICMP Timestamp Request Remote Date Disclosure』: "The remote host answers to an ICMP timestamp request.  This allows an attacker to know the date that is set on the targeted machine, which may assist an unauthenticated, remote attacker in defeating time-based authentication protocols." (遠端主機會回應 ICMP 時間戳請求。這使得攻擊者能夠知道目標機器上設置的日期,這可能會幫助未經身份驗證的遠程攻擊者破解基於時間的身份驗證協議。) 如果是無對外的服務,基本上可以略過。 基於方便除錯,Firewall Wan Port 上有開啟 Ping 服務,所以要排除這個弱點,就要在 Firewall 做設定。 這個弱點是利用 ICMP Type13 功能,所以要在 Firewall 上禁用,Fortigate 的設定如下: Ref:  Block ICMP timestamp on FortiGate interface while keeping ping enabled Create a firewall service for ICMP type 13 (timestamp request): (7.2.x已內建)       config firewall service custom     edit "TIMESTAMP"         set protocol ICMP         set icmptype 13     next end   Create address entry for wan1 interface IP:   config firewa...

RECOVERING DELETED PARTITION USING TESTDISK

  做了蠢事,誤刪非目標的 RAID 配置。 記錄一下救回的過程,順便介紹好用的免費工具   TestDisk   。 介紹一下犯錯的環境: HPE DL380G9 w/ Smary Array P440ar RAID 6 w/ 480G*12 Windows 2019 STD GPT Partation 通常 RAID 設定被刪除,原廠的文就應該都是請你從備份資料還原。 但多數的 RAID 配置刪除,是不會刪除實際資料,如果你還記得該 RAID 的配置參數,理論上是有機會可以救回來的。以下參數必須一樣: RAID 等級,如 RAID1 、 RAID6 ,以及成員磁碟 ( 在多磁碟的環境 ) Logical Drive 的 Strip Size / Full Strip Size ( 如果 Array 分成多個 Logical Drive ,那必須依原始配置的大小和順序 ) 分割區的類型,如 MBR 、 GPT…. 我的經驗 HPE 、 Intel 、 LSI 的 RAID Card 都可以 ( 好像常犯錯 Orz) Tips :由於掃描磁碟會花很久的時候。磁碟容量越大,時間需要越久。這時候要抉擇救援還是從備份還原或兩案並進,因為救援有可能失敗,超出 RTO ( Recovery Time Objective )目標。 還原過程: 1.         執行 Testdisk ,選擇是否要輸出 Log 記錄 ( 如果使用 LiveCD 類,當然無法輸出 ) 2.         選擇要救援的磁碟 3.         選擇當初的磁碟分割表類型 4.         選擇『 Analyse 』來找出被刪除的分割區 5.         ...

HP Smart array CLI commands

  HP Smart array CLI commands Show configuration /opt/hp/hpssacli/bin/hpssacli ctrl all show config Controller status /opt/hp/hpssacli/bin/hpssacli ctrl all show status Show detailed controller information for all controllers /opt/hp/hpssacli/bin/hpssacli ctrl all show detail Show detailed controller information for controller in slot 0 /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 show detail Rescan for New Devices /opt/hp/hpssacli/bin/hpssacli rescan Physical disk status /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show status Show detailed physical disk information /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show detail Logical disk status /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status View Detailed Logical Drive Status /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 show Create New RAID 0 Logical Drive /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:2 raid=0 Create New RAID 1 Logical Drive /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create t...