Skip to content

Conversation

VakarisZ
Copy link
Contributor

Both, island and agent needs to get local IP's/interfaces. We should also consider merging them, since interfaces also contain IP's

What does this PR do?

Fixes #2216

Add any further explanations here.

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Have you successfully tested your changes locally? Elaborate:

    Tested by {Running the Monkey locally with relevant config/running Island/...}

  • If applicable, add screenshots or log transcripts of the feature working

@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Base: 59.37% // Head: 59.49% // Increases project coverage by +0.11% 🎉

Coverage data is based on head (c82ee2c) compared to base (54f1bd2).
Patch coverage: 72.58% of modified lines in pull request are covered.

❗ Current head c82ee2c differs from pull request most recent head 77a23b7. Consider uploading reports for the commit 77a23b7 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2298      +/-   ##
===========================================
+ Coverage    59.37%   59.49%   +0.11%     
===========================================
  Files          531      532       +1     
  Lines        13765    13766       +1     
===========================================
+ Hits          8173     8190      +17     
+ Misses        5592     5576      -16     
Impacted Files Coverage Δ
monkey/infection_monkey/exploit/mssqlexec.py 0.00% <0.00%> (ø)
monkey/infection_monkey/exploit/smbexec.py 0.00% <0.00%> (ø)
monkey/infection_monkey/exploit/tools/smb_tools.py 0.00% <0.00%> (ø)
monkey/infection_monkey/exploit/wmiexec.py 0.00% <0.00%> (ø)
monkey/infection_monkey/monkey.py 0.00% <0.00%> (ø)
monkey/monkey_island/cc/server_setup.py 0.00% <0.00%> (ø)
monkey/monkey_island/cc/services/node.py 27.77% <20.00%> (ø)
...nkey/monkey_island/cc/services/reporting/report.py 25.64% <50.00%> (ø)
...key/monkey_island/cc/server_utils/network_utils.py 90.00% <83.33%> (+19.41%) ⬆️
monkey/common/credentials/__init__.py 100.00% <100.00%> (ø)
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@mssalvatore mssalvatore left a comment

Choose a reason for hiding this comment

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

None of these functions should have local in the name. If interfaces have public IPs (not local network IPs), the function will return them. Furthermore, the functions filter out the loopback interface, which is traditionally considered a local interface.

Use get_network_interfaces()

@VakarisZ
Copy link
Contributor Author

I'm not sure what's a better name to indicate that we are getting ip's of the current/local machine (not victim host or anything).

@mssalvatore
Copy link
Collaborator

I'm not sure what's a better name to indicate that we are getting ip's of the current/local machine (not victim host or anything).

What about get_system_ips()?

@VakarisZ VakarisZ force-pushed the 2216-redundant-ip-lookup branch from 12a218e to 2474416 Compare September 16, 2022 12:45
@VakarisZ VakarisZ marked this pull request as ready for review September 16, 2022 12:46
@mssalvatore mssalvatore merged commit b02bc0c into develop Sep 16, 2022
@mssalvatore mssalvatore deleted the 2216-redundant-ip-lookup branch September 16, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace tunnel/proxy with relay
2 participants