Beispiel #1
0
def main():
    # load plugins
    plugins = Plugin.findPlugins()
    Plugin.loadPlugins(plugins)

    # prepare argument parser
    parser = argparse.ArgumentParser()
    parser.add_argument('-s',
                        '--starttls',
                        help='use STARTTLS for specific protocol',
                        choices=starttls_supported,
                        dest='starttls')
    parser.add_argument('-p',
                        '--port',
                        type=int,
                        default=443,
                        help='TCP port to be checked',
                        dest='port')
    parser.add_argument('host', help='hostname or IP address of target system')
    Plugin.executeLambda(None,
                         lambda p, parser=parser: p.prepareArguments(parser))
    args = parser.parse_args()

    # create storage
    storage = Plugin_Storage()

    # init plugins
    Plugin.executeLambda(None,
                         lambda p, stor=storage, args=args: p.init(stor, args))

    # create connection object
    if args.starttls == 'ftp':
        connection = Connection_STARTTLS_FTP(args.host, args.port)
    elif args.starttls == 'smtp':
        connection = Connection_STARTTLS_SMTP(args.host, args.port)
    else:
        connection = Connection_TCP_Socket(args.host, args.port)

    # execute all active tests
    Plugin.executeLambda(
        Active_Test_Plugin,
        lambda p, c=connection, stor=storage: p.execute(c, stor))

    # deinit plugins:
    Plugin.executeLambda(None, lambda p, stor=storage: p.deinit(stor))
Beispiel #2
0
 def reportCiphersuite(self, cs):
     l = lambda p, msg=msg: p.reportCiphersuite(cs)
     l = lambda p, s=self, l=l: s._helper(p, l)
     Plugin.executeLambda(Output_Ciphersuites_Plugin, l)
Beispiel #3
0
 def logError(self, msg):
     l = lambda p, msg=msg: p.logError(msg)
     l = lambda p, s=self, l=l: s._helper(p, l)
     Plugin.executeLambda(Output_Log_Plugin, l)