Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read target address(es) from file #398

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions kickthemout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down