Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/spec/lib/rex/parser/fs/bitlocker_spec.rb
Views: 11705
1volume_header = [%(2eb58902d4656452d46532d00020800000000000000f800003f00ff008000010000000000e01f00003000000000000000001000600000000000000000000000000800029000000004e4f204e414d45202042020464154333220202033c98ed1bcf47b8ec18ed9bd007ca0fb7db47d8bf0ac9840740c48740eb450ebb0700cd10ebefa0fd7debe6cd16cd19000000000000000000000000000000000000000000000063bd66749292ed84a8399f6a339e3d00100001002000000000000c0020000000000007003000000007000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000d0a52656d6f7665206469736b73206f72206f746865722096d656469612eff0d0a4469736b206572726f72ff0d0a507265737320616e79206b657920746f2072106573746172740d0a0000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000078787878787878787878787878787878787878787878787878787878787878781378787878787878787878787878787878787878787878787878787878787878787878787878787878147878787878787878ffffffffffffffffffffffffffffffffffffff001f2c55aa15).delete("\n")].pack("H*")1617fve_header = [%(182d4656452d46532d3e00020004000400000020040000000000000000100000000000100200000000190000c002000000000000700300000000000011020000000098030000010000003000000098030000209d741575626b6a448609e461ac9c8b3b42000000008000004dbe2a92b8e4d00118000f000f00010021000011020000000000200000000000003e0007000200010053004500560045004e002000420049002254004c004f0043004b00450052002000300031002f00300039002f0032003000310035000000e00023020008000100880a7dfcb963ff40a31f67e865794a263018fda4b8e4d001000000206c0000000300240100011000007e237a2aefe43ace0d1a3dfe90e4d347500000000500010090de09a4b8e4d0010200250000372139682c273872d1af0d7cfae5a85fe856af890c642e5ec4f195580b7fde1c00c1b01b088426a432294f09d96531a3bffee92c653c6d8a4f62d7e888500000000500010090de09a4b8e4d00103002700000ce9565de838333811caacb594662fddf1fbc7fd4a2792646d918196307b7305083c47ab6f3228f91b7b0050b98c27a2ad6bf0884306389e15aa771e7cd000020008000100e219e43f2baf3c40a27529ce93a895876a70799eb2b8e4d001000000025c0000000400010002200000500000000500010090de3009a4b8e4d0010600000013951bd6f84f1ff002c6e1080daf91ebf938b554b9dde6ceaef4a3ccce73317fd526ceb00bb39233689942e31dc2f17dcb6e7f5955e880a753ecbe6661500000000500010090de3209a4b8e4d00107000000e2b4c5db81a0d0fc5f1a8f13a2906da7561fce73bc0be872fa450a26aa7033f00af575ff72e29565bd7e54cc7281f16e28c91664d69d1ac0349817f03a700003000500010090de3409a4b8e4d00108000000a963bb6baad0198476db06ef28cdffbbff46f2bd37e94328fb9610a63db235c81a222a402801a43bb83d4c78ac349f8a0c911f8b82f4f74ed801d81911402b29351f8f1fb7413536928326c12c0c3e92d5ebfcba3a2e865208de579985d7f200020008000100000e3e29fa338c409d4d37edf0a07e3af770b7400a1d1bd1010000000822000000020001004400690073006b0050006100730038730077006f007200640000005c0000000300010000100000410c97f721e4203936b2da255c94f2d339400000000500010060cf7a091d1bd1013f00000034912ac8588851df6a4fc4e116153484c193daab40d02518fa2403fd43eebeeced237fabd4fb3c6b5b8c5829e3500000000500010060cf7a091d1bd1014140000000490277082603ea9b968cf1b7aa599140bf33bd2580fcf501bf67fdb9ee49fc44c0adf17c4221f7b5435a7a75bec6601b28ce3537d2607bf52207008620000000000000000020fc02009e1b2f8b435000000005000100a4c7400a1d1bd10141000000db197743fdd35661f8e332c5fcfe93324080dd414463a6efbf510e99984d2c42b2b9009efb9653c83c1ff0bad8fa38c0e0e2f791de8a8211af74cf231345).delete("\n")].pack("H*")4647recovery_password = '657096-479369-488587-457336-698588-612986-598950-103389'4849fvek_dislocker_format = [%(500080923550357e1cdd9f0810773a82001fdb332a0e577d90931ea627d2df51355308c32f20e94d434edcf28f64798ee530cc63220bee6277e988e4363852be9530d7052453).delete("\n")].pack("H*")5455###56#57# This Test class emulate the header of a bitlocker drive and the fve header58#59###60class BitlockerDrive61def initialize(volume_header, fve_header)62@volume_header = volume_header63@fve_header = fve_header64@offset = 065end6667def seek(offset)68@offset = offset69end7071def read(_size)72if @offset == 073@volume_header74else75@fve_header76end77end78end7980RSpec.describe Rex::Parser::BITLOCKER do81Bitlocker = Rex::Parser::BITLOCKER.new(BitlockerDrive.new(volume_header,82fve_header))83##84# Decrypt85##86it "Extract and decrypt recovery key from recovery password" do87result = Bitlocker.fvek_from_recovery_password_dislocker(recovery_password)88expect(result).to eq fvek_dislocker_format89end90end919293