From 7b855b2969880342ec9ca17c0317cdc33025b3b1 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Mon, 2 Feb 2015 07:52:49 +0100 Subject: [PATCH] set of IP addresses per fingerprint added --- bin/x509/hoststoredis.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/x509/hoststoredis.py b/bin/x509/hoststoredis.py index bf4948d..b04096a 100644 --- a/bin/x509/hoststoredis.py +++ b/bin/x509/hoststoredis.py @@ -1,11 +1,11 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Tool to dump IP,FP into a Redis database +# Tool to dump IP,set(FP) and FP,set(IP) into a Redis database # # Software is free software released under the GNU General Public License version 3 and later # -# Copyright (c) 2014 Alexandre Dulaunoy - a@foo.be +# Copyright (c) 2015 Alexandre Dulaunoy - a@foo.be import fileinput import argparse @@ -22,7 +22,6 @@ args = argParser.parse_args() if args.s: try: - #Redis structure Set of (FP) per IP r = redis.StrictRedis(host=args.b, port=args.p) except: print "Unable to connect to the Redis server" @@ -31,6 +30,8 @@ if args.s: for l in fileinput.input(args.r): (ip, fp) = l.split(',') if args.s: - r.sadd(ip, fp.rstrip()) + cfp = fp.rstrip() + r.sadd(ip, cfp) + r.sadd("s:"+cfp, ip) else: sys.exit(1)