ADD zls_check.py
This commit is contained in:
+14
-2
@@ -80,7 +80,7 @@ def get_winver():
|
||||
|
||||
def get_local_ip():
|
||||
powershell_script = '''
|
||||
(Get-NetIPAddress | Where-Object { $_.PrefixOrigin -eq "Dhcp" }).IPAddress
|
||||
Get-NetIPAddress | Where-Object { $_.PrefixOrigin -eq "Dhcp" -and $_.InterfaceAlias -like "*Ethernet*" } | Select-Object -ExpandProperty IPAddress
|
||||
'''
|
||||
result = subprocess.check_output(["powershell.exe", "-command", powershell_script], universal_newlines=True)#
|
||||
ip = result.rsplit('.',1)
|
||||
@@ -97,4 +97,16 @@ def get_lastlogon(user):
|
||||
result = subprocess.check_output(["powershell.exe", "-command", powershell_script], universal_newlines=True)
|
||||
return result
|
||||
|
||||
print(get_cpu_brand())
|
||||
def get_client_info():
|
||||
powershell_script = f'''Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty ProductType'''
|
||||
result = subprocess.check_output(["powershell.exe", "-command", powershell_script], universal_newlines=True)
|
||||
if result[0] == "1":
|
||||
return "Client"
|
||||
else:
|
||||
return "Server"
|
||||
|
||||
def get_smb_credential():
|
||||
powershell_script = f'''Get-SmbConnection | Select-Object -ExpandProperty Credential'''
|
||||
result = subprocess.check_output(["powershell.exe", "-command", powershell_script], universal_newlines=True)
|
||||
result.split("\\")
|
||||
return result[1]
|
||||
Reference in New Issue
Block a user