@@ -15,9 +15,9 @@ def __init__(self, context=None, module_options=None):
1515 self .module_options = module_options
1616
1717 def options (self , context , module_options ):
18- """
18+ """
1919 USAGE:
20-
20+
2121 NetExec smb <IP> -u <username> -p <password> -M bitlocker
2222 NetExec wmi <IP> -u <username> -p <password> -M bitlocker (Better option to use on real life.)
2323 """
@@ -43,18 +43,18 @@ def check_bitlocker_status(self):
4343 try :
4444 # Executing the PowerShell command to get BitLocker volumes status.
4545 check_bitlocker_command_str_output = self .connection .execute (check_bitlocker_command_str , True )
46-
46+
4747 if "'Get-BitLockerVolume' is not recognized" in check_bitlocker_command_str_output :
4848 self .context .log .fail ("BitLockerVolume not found on target." )
4949 return
5050
5151 # Splitting the output into lines.
5252 lines = str (check_bitlocker_command_str_output ).splitlines ()
5353 data_lines = [line for line in lines if re .match (r"\w:" , line )]
54-
54+
5555 for line in data_lines :
5656 # Checking every line for starting with drive
57- if line [1 ] == ":" :
57+ if line [1 ] == ":" :
5858 parts = line .split ()
5959 MountPoint , EncryptionMethod , protection_status = parts [0 ], parts [1 ], parts [2 ]
6060
@@ -85,15 +85,15 @@ def check_bitlocker_status(self):
8585 oxidResolver = True ,
8686 doKerberos = self .connection .kerberos ,
8787 kdcHost = self .connection .kdcHost )
88-
88+
8989 try :
9090 # CoCreateInstanceEx for WMI login
9191 i_interface = dcom_conn .CoCreateInstanceEx (wmi .CLSID_WbemLevel1Login , wmi .IID_IWbemLevel1Login )
9292 iWbemLevel1Login = wmi .IWbemLevel1Login (i_interface )
9393
9494 # Specify the namespace for BitLocker
9595 bitlockerNamespace = "root\\ CIMv2\\ Security\\ MicrosoftVolumeEncryption"
96-
96+
9797 # NTLM login for WMI
9898 iWbemServices = iWbemLevel1Login .NTLMLogin (bitlockerNamespace , NULL , NULL )
9999
@@ -113,7 +113,7 @@ def check_bitlocker_status(self):
113113 6 : "XTS_AES_128" ,
114114 7 : "XTS_AES_256_WITH_DIFFUSER"
115115 }
116-
116+
117117 try :
118118 while True :
119119 iWbemClassObject = iEnumWbemClassObject .Next (0xffffffff , 1 )
0 commit comments