Exemple #1
0
def scan(targetObject, IOCObjects, hostConfidential):

    HANDLER_NAME = '%s@%s' % (targetObject['login'], targetObject['ip'])

    # Init PsExec tunnel to target
    try:
        RemCom = remotecmd.RemoteCmd(threadname,
                                        targetObject['ip'],
                                        targetObject['login'],
                                        targetObject['password'],
                                        domain = targetObject['domain'],
                                        rootDir = IOC_COMPONENT_ROOT
                                     )
        loggingiocscan.info('Handler %s has been succesfully created' % HANDLER_NAME)
    # too bad, error in connection
    except Exception, e:
        loggingiocscan.error('Handler '+HANDLER_NAME+' could not be created : '+str(e).decode('cp1252'))
        return None
def scanTarget(targetObject, IOCObjects, hostConfidential):

    HANDLER_NAME = '%s@%s' % (targetObject['login'], targetObject['ip'])

    # Init PsExec tunnel to target
    try:
        remoteSystem = remotecmd.RemoteCmd(threadname,
                                           targetObject['ip'],
                                           targetObject['login'],
                                           targetObject['password'],
                                           domain=targetObject['domain'],
                                           rootDir=IOC_COMPONENT_ROOT)
        loggingscan.info('Handler %s has been succesfully created' %
                         HANDLER_NAME)

        remoteSystem.setup()
    # too bad, error in connection
    except Exception, e:
        loggingscan.error(HANDLER_NAME + ' startup error: ' +
                          str(e).encode(sys.stdout.encoding))
        return None