Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion APACHE/Map.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ $DATA_MAP{bitlockerstatus} = {
CONVERSIONSTATUS => {},
PROTECTIONSTATUS => {},
ENCRYPMETHOD => {},
INITPROTECT => {}
INITPROTECT => {},
RECOVERYPASSWORD => {},
PROTECTORS => {},
PASSWORDID => {}
}
};
1;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# bitlockerstatus
Retrieve status of bitlocker Windows volumes
Retrieve status of bitlocker Windows volumes with recovery key if exist
62 changes: 35 additions & 27 deletions agent/bitlockerstatus.vbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
'----------------------------------------------------------
' Plugin for OCS Inventory NG 2.x
' Script : Retrieve bitlocker status
' Version : 1.00
' Date : 13/07/2018
' Author : Stéphane PAUTREL (acb78.com)
' Version : 1.2
' Date : 16/09/2020
' Author : Stéphane PAUTREL (acb78.com)/ GUIRONNET Nicolas
'----------------------------------------------------------
' OS checked [X] on 32b 64b (Professionnal edition)
' Windows XP [ ]
' Windows Vista [ ] [ ]
' Windows 7 [ ] [ ]
' Windows 8.1 [ ] [ ]
' Windows 10 [X] [X]
' Windows 2k8R2 [ ]
' Windows 2k12R2 [ ]
' Windows 2k16 [ ]
' ---------------------------------------------------------
' NOTE : No checked on Windows 8
' ---------------------------------------------------------
On Error Resume Next

arEncryptionMethod = Array("None", "AES 128 With Diffuser", "AES 256 With Diffuser", "AES 128", "AES 256", "HARDWARE ENCRYPTION", "XTS AES 128", "XTS AES 256")
arConversionStatus = Array("Fully Decrypted", "Fully Encrypted", "Encryption In Progress", "Decryption In Progress", "Encryption Paused", "Decryption Paused")
arLockStatus = Array("Unlocked", "Locked")
arVolumeType = Array("OperatingSystem","Data")

Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")

Set BitLocker = SWBemlocator.ConnectServer(strComputer,"root\CIMV2\security\microsoftvolumeencryption")
Expand All @@ -28,22 +21,37 @@ For Each BitLockerItem in BitLockerItems

Result = "<BITLOCKERSTATUS>" & VbCrLf
Result = Result & "<DRIVE>" & BitLockerItem.DriveLetter & "</DRIVE>" & VbCrLf
Result = Result & "<VOLUMETYPE>" & BitLockerItem.VolumeType & "</VOLUMETYPE>" & VbCrLf

If BitLockerItem.ConversionStatus = 1 Then
Result = Result & "<CONVERSIONSTATUS>" & "ENABLED" & "</CONVERSIONSTATUS>" & VbCrLf
Result = Result & "<VOLUMETYPE>" & arVolumeType(BitLockerItem.VolumeType) & "</VOLUMETYPE>" & VbCrLf
BitLockerItem.GetConversionStatus ConversionStatus, EncryptionPercentage
If EncryptionPercentage < 100 and EncryptionPercentage >0 Then
Result = Result & "<CONVERSIONSTATUS>" & arConversionStatus(BitLockerItem.ConversionStatus) & " - " & (EncryptionPercentage) & "%</CONVERSIONSTATUS>" & VbCrLf
Else
Result = Result & "<CONVERSIONSTATUS>" & "DISABLED" & "</CONVERSIONSTATUS>" & VbCrLf
Result = Result & "<CONVERSIONSTATUS>" & arConversionStatus(BitLockerItem.ConversionStatus) & "</CONVERSIONSTATUS>" & VbCrLf
End If
Result = Result & "<PROTECTIONSTATUS>" & arLockStatus(BitLockerItem.ProtectionStatus) & "</PROTECTIONSTATUS>" & VbCrLf

If BitLockerItem.ProtectionStatus = 1 Then
Result = Result & "<PROTECTIONSTATUS>" & "ENABLED" & "</PROTECTIONSTATUS>" & VbCrLf
Else
Result = Result & "<PROTECTIONSTATUS>" & "DISABLED" & "</PROTECTIONSTATUS>" & VbCrLf
End If

Result = Result & "<ENCRYPMETHOD>" & BitLockerItem.EncryptionMethod & "</ENCRYPMETHOD>" & VbCrLf
Result = Result & "<ENCRYPMETHOD>" & arEncryptionMethod(BitLockerItem.EncryptionMethod) & "</ENCRYPMETHOD>" & VbCrLf
Result = Result & "<INITPROTECT>" & BitLockerItem.IsVolumeInitializedForProtection & "</INITPROTECT>" & VbCrLf
BitLockerItem.GetKeyProtectors 0,VolumeKeyProtectorID
Protectors=""
PasswordId=""
Password=""
For Each objId in VolumeKeyProtectorID
BitLockerItem.GetKeyProtectorFriendlyName objId, VolumeKeyProtectorFriendlyName
Protectors=VolumeKeyProtectorFriendlyName & "," & Protectors
BitLockerItem.GetKeyProtectorType objId, ProtectorType
If ProtectorType=3 Then
PasswordId=objId & "," & PasswordId
BitLockerItem.GetKeyProtectorNumericalPassword objId,pwd
Password=pwd & "," & Password
End If
Next
Protectors=Left(Protectors,Len(Protectors)-1)
PasswordId=Left(PasswordId,Len(PasswordId)-1)
Password=Left(Password,Len(Password)-1)
Result = Result & "<PROTECTORS>" & Protectors & "</PROTECTORS>" & VbCrLf
Result = Result & "<PASSWORDID>" & PasswordId & "</PASSWORDID>" & VbCrLf
Result = Result & "<RECOVERYPASSWORD>" & Password & "</RECOVERYPASSWORD>" & VbCrLf
Result = Result & "</BITLOCKERSTATUS>" & VbCrLf
WScript.Echo Result

Expand Down
5 changes: 4 additions & 1 deletion cd_bitlockerstatus/cd_bitlockerstatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
'Conversion status' => 'CONVERSIONSTATUS',
'Protection status' => 'PROTECTIONSTATUS',
'Encryption method' => 'ENCRYPMETHOD',
'Volume initialization for protection' => 'INITPROTECT'
'Volume initialization for protection' => 'INITPROTECT',
'Recovery Password' => 'RECOVERYPASSWORD',
'Protectors' => 'PROTECTORS',
'Password ID' => 'PASSWORDID'
);
$list_col_cant_del=$list_fields;
$default_fields= $list_fields;
Expand Down
4 changes: 2 additions & 2 deletions infos.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"displayName" : "Bitlocker status",
"author" : ["Stephane PAUTREL"],
"author" : ["Stephane PAUTREL/Nicolas GUIRONNET"],
"contributor" : [],
"supportedAgent" : ["Windows"],
"version" : "2.0",
"version" : "2.2",
"licence" : "GPLv2",
"description" : {
"fr" : "Remonte le statut de Bitlocker",
Expand Down
3 changes: 3 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ function extension_install_bitlockerstatus()
`PROTECTIONSTATUS` VARCHAR(255) DEFAULT NULL,
`ENCRYPMETHOD` VARCHAR(255) DEFAULT NULL,
`INITPROTECT` VARCHAR(255) DEFAULT NULL,
`RECOVERYPASSWORD` VARCHAR(255) DEFAULT NULL,
`PROTECTORS` VARCHAR(255) DEFAULT NULL,
`PASSWORDID` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`ID`,`HARDWARE_ID`)
) ENGINE=INNODB ;");
}
Expand Down