def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type, task_type_name): ''' Constructor ''' self._running = False self._validTask = True #ldaphost:192.168.12.200;ldapport:389;ldapuser:admin;ldappass:temporal;ldapdomain:alienvault.com;ldapbasedn:"ou=kktuaDevel,dc=testcfg,dc=qa,dc=alienvault,dc=com" self._pattern = re.compile( "ldaphost:(?P<ldaphost>[^;]+);ldapport:(?P<ldapport>[^;]+);ldapuser:(?P<ldapuser>[^;]+);ldappass:(?P<ldappass>[^;]+);ldapdomain:(?P<ldapdomain>[^;]+);ldapbasedn:\"(?P<basedn>[^;]+)\"" ) values = self._pattern.match(task_params) self._ldapHost = '' self._ldapPort = '' self._ldapUser = '' self._ldapPass = '' self._ldapDomain = '' self._ldapBasedn = '' if values: groupdict = values.groupdict() self._ldapHost = groupdict['ldaphost'] self._ldapPort = groupdict['ldapport'] self._ldapUser = groupdict['ldapuser'] self._ldapPass = groupdict['ldappass'] self._ldapDomain = groupdict['ldapdomain'] self._ldapBasedn = groupdict['basedn'] else: logger.warning("Invalid ldap task") self._validTask = False self._ldapURL = 'ldap://%s:%s' % (self._ldapHost, self._ldapPort) self._ldapInstance = None InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type, task_type_name)
def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name): ''' Constructor ''' self._running = False self._nm = nmap.PortScanner() InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name)
def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name): ''' Constructor ''' self._running = False self._validTask = True #ldaphost:192.168.12.200;ldapport:389;ldapuser:admin;ldappass:temporal;ldapdomain:alienvault.com;ldapbasedn:"ou=kktuaDevel,dc=testcfg,dc=qa,dc=alienvault,dc=com" self._pattern = re.compile("ldaphost:(?P<ldaphost>[^;]+);ldapport:(?P<ldapport>[^;]+);ldapuser:(?P<ldapuser>[^;]+);ldappass:(?P<ldappass>[^;]+);ldapdomain:(?P<ldapdomain>[^;]+);ldapbasedn:\"(?P<basedn>[^;]+)\"") values = self._pattern.match(task_params) self._ldapHost = '' self._ldapPort = '' self._ldapUser = '' self._ldapPass = '' self._ldapDomain = '' self._ldapBasedn = '' if values: groupdict = values.groupdict() self._ldapHost = groupdict['ldaphost'] self._ldapPort = groupdict['ldapport'] self._ldapUser = groupdict['ldapuser'] self._ldapPass = groupdict['ldappass'] self._ldapDomain = groupdict['ldapdomain'] self._ldapBasedn = groupdict['basedn'] else: logger.warning("Invalid ldap task") self._validTask = False self._ldapURL = 'ldap://%s:%s' % (self._ldapHost, self._ldapPort) self._ldapInstance = None InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name)
def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type, task_type_name): ''' Constructor ''' self._running = False self._wmicPath = '/usr/bin/wmic' #wmihost:192.168.2.121;wmiuser:wmiuser;wmipass:alien4ever self._pattern = re.compile( "wmihost:(?P<wmihost>[^;]+);wmiuser:(?P<wmiuser>[^;]+);wmipass:(?P<wmipass>[^;]+)" ) values = self._pattern.match(task_params) self._win32User = '' self._win32Password = '' self._remoteIPAddress = '' if values: groupdict = values.groupdict() self._win32User = groupdict['wmiuser'] self._win32Password = groupdict['wmipass'] self._remoteIPAddress = groupdict['wmihost'] else: logger.warning("Invalid wmi task") self._validTask = False #query ('query','parser funtion pointer) self._queries = [ ("Select * from Win32_UserAccount", self.getEventFromWin32_UserAccountQuery), ] InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type, task_type_name)
def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name, fmkip, fmkport): ''' Constructor ''' self._running = False self._fmkSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self._framework_ip = fmkip self._framework_port = fmkport #self._fmkSocket.connect((self._framework_ip, int(self._framework_port))) InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name)
def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type, task_type_name, fmkip, fmkport): ''' Constructor ''' self._running = False self._fmkSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self._framework_ip = fmkip self._framework_port = fmkport #self._fmkSocket.connect((self._framework_ip, int(self._framework_port))) InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type, task_type_name)
def __init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name): ''' Constructor ''' self._running = False self._wmicPath = '/usr/bin/wmic' #wmihost:192.168.2.121;wmiuser:wmiuser;wmipass:alien4ever self._pattern = re.compile("wmihost:(?P<wmihost>[^;]+);wmiuser:(?P<wmiuser>[^;]+);wmipass:(?P<wmipass>[^;]+)") values = self._pattern.match(task_params) self._win32User = '' self._win32Password = '' self._remoteIPAddress = '' if values: groupdict = values.groupdict() self._win32User = groupdict['wmiuser'] self._win32Password = groupdict['wmipass'] self._remoteIPAddress = groupdict['wmihost'] else: logger.warning("Invalid wmi task") self._validTask = False #query ('query','parser funtion pointer) self._queries = [("Select * from Win32_UserAccount",self.getEventFromWin32_UserAccountQuery),] InventoryTask.__init__(self, task_name, task_params, task_period, task_reliability, task_enable, task_type,task_type_name)