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

Solves External IP issue for the monkey Island #510

Closed
wants to merge 20 commits into from
Closed
Changes from 2 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
14 changes: 13 additions & 1 deletion monkey/infection_monkey/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,24 @@ def initialize(self):
self._network = NetworkScanner()
self._dropper_path = sys.argv[0]

server_num=0
shivank1234 marked this conversation as resolved.
Show resolved Hide resolved
secondary_servers= len(self._args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not all command arguments are server ip's. Look above: there is -p for parrent argument, -t for tunnel argument and so on... I'm pretty sure this doesn't give you a number of servers passed with -s flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that.. Working on that ..
Thanks for your reviews .. :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not solve. Why is it called secondary_servers if it's argument list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected


if self._default_server:
if self._default_server not in WormConfiguration.command_servers:
LOG.debug("Added default server: %s" % self._default_server)
WormConfiguration.command_servers.insert(0, self._default_server)
WormConfiguration.command_servers.insert(server_num, self._default_server)
else:
LOG.debug("Default server: %s is already in command servers list" % self._default_server)
server_num=server_num+1

while server_num<(secondary_servers+1):
if self._args[server_num -1] not in WormConfiguration.command_servers:
LOG.debug("Added default server: %s" % self._args[server_num -1])
WormConfiguration.command_servers.insert(server_num, self._args[server_num-1])
else:
LOG.debug("Default server: %s is already in command servers list" % self._args[server_num-1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. So you add server IPs to command servers list. Can you verify that monkey tries all IPs in that list when connecting to server?

server_num=server_num+1

def start(self):
LOG.info("Monkey is running...")
Expand Down