From d140602ad0b3832b2318e61ad5ff80718aecbb40 Mon Sep 17 00:00:00 2001 From: Filippo Date: Thu, 16 May 2019 17:28:08 +0200 Subject: [PATCH] added -f option: read target IP(s) from file and perform attack --- kickthemout.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kickthemout.py b/kickthemout.py index 15e7924..4f97909 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -737,6 +737,17 @@ if __name__ == '__main__': callback=targetList, type='string', dest='targets', help='specify target IP address(es) and perform attack') + + def target_files(option, opt, value, parser): + with open(value) as file: + addr_list = file.readlines() + setattr(parser.values, option.dest, addr_list) + + parser.add_option('-f', '--file', action='callback', + callback=target_files, type='string',metavar='FILE', + dest='targets', help='read target IP address(es) from given file and perform attack') + + (options, argv) = parser.parse_args() try: