-
Notifications
You must be signed in to change notification settings - Fork 438
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
d140602
3db187d
5574237
4a084a9
e636ba5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
192.168.0.2 | ||
192.168.0.3 | ||
192.168.1.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -716,6 +716,8 @@ 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 ip_list.txt\n'+ | ||
' sudo python3 kickthemout.py --file ip_list.txt\n' | ||
FilippoRanza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
' sudo python3 kickthemout.py (interactive mode)\n') | ||
|
||
parser = optparse.OptionParser(epilog=examples, | ||
|
@@ -737,6 +739,17 @@ def targetList(option, opt, value, parser): | |
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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I update all names to camel case |
||
setattr(parser.values, option.dest, addr_list) | ||
|
||
parser.add_option('-f', '--file', action='callback', | ||
callback=target_files, type='string',metavar='FILE', | ||
FilippoRanza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dest='targets', help='read target IP address(es), one per line, from given file and perform attack') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
||
(options, argv) = parser.parse_args() | ||
|
||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this file