checkvm for mac os

This commit is contained in:
AlessandroZ 2017-02-10 12:01:29 +01:00
parent e6ae5bf4f4
commit a630a79435
1 changed files with 10 additions and 1 deletions

View File

@ -6,7 +6,7 @@ from modules.lib.windows.powershell_upload import execute_powershell_script
__class_name__="CheckVM" __class_name__="CheckVM"
ROOT=os.path.abspath(os.path.join(os.path.dirname(__file__),"..")) ROOT=os.path.abspath(os.path.join(os.path.dirname(__file__),".."))
@config(compat=['linux', 'windows'], category="gather") @config(category="gather")
class CheckVM(PupyModule): class CheckVM(PupyModule):
""" check if running on Virtual Machine """ """ check if running on Virtual Machine """
@ -29,3 +29,12 @@ class CheckVM(PupyModule):
self.success('This appears to be a %s virtual machine' % vm) self.success('This appears to be a %s virtual machine' % vm)
else: else:
self.success('This does not appear to be a virtual machine') self.success('This does not appear to be a virtual machine')
elif self.client.is_darwin():
self.client.load_package("checkvm")
self.info('Be patient, could take a while')
vm = self.client.conn.modules["checkvm"].checkvm()
if vm:
self.success('This appears to be a %s virtual machine' % vm)
else:
self.success('This does not appear to be a virtual machine')