標準 CMOS RAM 共 128 Bytes (00h~7Fh)。經實測多款主板 (AOpen AP58/AX5T、EPoX MVP3E/P2-112A、FIC PA-2007) 的 Award BIOS (1997-1998 年版本),**使用者密碼雜湊值固定儲存於 38h 與 3Ah 兩個位元組** (39h、3Bh 恆為 00h)。Supervisor 密碼位置不同,本文不予公開。
設密碼為 8 字元 ABCDEFGH (不足 8 字元視同高位為 0);計算:
Hash = H + 4×G + 0x10×F + 0x40×E + 0x100×D + 0x400×C + 0x1000×B + 0x4000×A
結果為 24-bit 值,拆為三個位元組 H1 H2 H3 (低位在前):
3Ah = H238h = H1 + H3 (模 256 加法)密碼 r*vte (5 字元) → ASCII: 72 2A 76 74 65 → 對應 A=0, B=0, C=0, D=72h, E=2Ah, F=76h, G=74h, H=65h
計算:65 + 4×74 + 10h×76 + 40h×2A + 100h×72 = 8615h
→ H1=00h, H2=86h, H3=15h
→ 3Ah=86h, 38h=15h ✓ 符合實測值。
2^16 = 65,536 種96^8 ≈ 7.2×10^15 種~10^11 組密碼r*vte 即有 25 萬組 同效 5 字元密碼,6~8 字元更多結論:Award CMOS 密碼極易碰撞,僅能防君子,無法阻擋具備實體存取權的攻擊者。現代主板皆改用 SHA-256 等單向雜湊並加鹽 (Salt),且支援 UEFI Secure Boot 鎖定 BIOS 設定。
void FindPasswords(BYTE hash38, BYTE hash3A) {
for (len = 1; len <= 8; len++) {
// 遞迴枚舉所有字元組合
Recurse(0, len, 0, hash38, hash3A);
}
}
void Recurse(pos, len, currentHash, target38, target3A) {
if (pos == len) {
BYTE h1 = currentHash & 0xFF;
BYTE h2 = (currentHash >> 8) & 0xFF;
BYTE h3 = (currentHash >> 16) & 0xFF;
if (h2 == target3A && ((h1 + h3) & 0xFF) == target38)
PrintCandidate(currentPassword);
return;
}
for (ch = 0x20; ch <= 0x7F; ch++) {
// 依公式累加權重
DWORD weight = (pos==0?0x4000: pos==1?0x1000: pos==2?0x400: pos==3?0x100: pos==4?0x40: pos==5?0x10: pos==6?4:1);
Recurse(pos+1, len, currentHash + ch*weight, target38, target3A);
}
}
本文完整揭示 Award BIOS (1990 年代主流) CMOS 密碼的儲存位置、專屬加權加總雜湊演算法、碰撞機率與搜尋方法。雖屬歷史技術,但展示了早期 BIOS 設計在安全性與儲存空間妥協下的典型缺陷,為現代韌體安全演進提供反面教材。