From e59ee5e97155ecf09b1080093210718c4b61e17a Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Wed, 5 Dec 2012 18:59:43 +0100 Subject: [PATCH] -d destination address option added The destination IPv4 address where to send the netbeacon to. IPv6 is currently not supported. --- nb_send.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nb_send.py b/nb_send.py index 2430127..788068a 100644 --- a/nb_send.py +++ b/nb_send.py @@ -42,6 +42,7 @@ usage = "usage: %prog [options] " parser = OptionParser(usage) parser.add_option("-s","--storeseq", dest="storeseq", action='store_true', help="store sequence and validate sequence") parser.add_option("-i","--iteration", dest="iteration", type=int, help="set the number of interation for sending the netbeacon") +parser.add_option("-d","--destination", dest="destination", help="set the destination IPv4 address (default: 127.0.0.1)") (options, args) = parser.parse_args() @@ -59,8 +60,11 @@ else: if not options.iteration: options.iteration=10 +if not options.destination: + options.destination="127.0.0.1" + for x in range(seqstart,seqstart+options.iteration): - nbsend(destination="127.0.0.1", payload=nbmessage(x), logging=True) + nbsend(destination=options.destination, payload=nbmessage(x), logging=True) if options.storeseq: s['seq'] = x