diff --git a/kickthemout.py b/kickthemout.py index 15e7924..8d7db31 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -716,6 +716,7 @@ def main(): ' sudo python3 kickthemout.py --target 192.168.1.10 \n'+ ' sudo python3 kickthemout.py -t 192.168.1.5,192.168.1.10 -p 30\n'+ ' sudo python3 kickthemout.py -s\n'+ + ' sudo python3 kickthemout.py -f IPs.txt\n'+ ' sudo python3 kickthemout.py (interactive mode)\n') parser = optparse.OptionParser(epilog=examples, @@ -737,6 +738,17 @@ def targetList(option, opt, value, parser): callback=targetList, type='string', dest='targets', help='specify target IP address(es) and perform attack') + + def targetFiles(option, opt, value, parser): + with open(value) as file: + addrList = file.readlines() + setattr(parser.values, option.dest, addrList) + + parser.add_option('-f', '--file', action='callback', + callback=targetFiles, type='string', metavar='FILE', + dest='targets', help='read target IP address(es) from line-separated file and perform attack') + + (options, argv) = parser.parse_args() try: