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

Address WMI hanging #3978

Merged
merged 1 commit into from
Dec 27, 2023
Merged

Address WMI hanging #3978

merged 1 commit into from
Dec 27, 2023

Conversation

ilija-lazoroski
Copy link
Contributor

What does this PR do?

Fixes part of #3654 .

We can live without the dcom_firewall_checker if we address impacket/#1600. Until we make a PR, get review, merge, release and relock, this is the solution.

Special thanks to @XiaoliChan for the suggested solution.

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?
  • Do all unit tests pass?
  • Do all end-to-end tests pass?
  • Any other testing performed?

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

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

30 seconds timeout
image

Copy link

codecov bot commented Dec 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (21d44ee) 77.57% compared to head (9240c90) 77.49%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3978      +/-   ##
===========================================
- Coverage    77.57%   77.49%   -0.09%     
===========================================
  Files          467      467              
  Lines        14759    14787      +28     
===========================================
+ Hits         11450    11459       +9     
- Misses        3309     3328      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

monkey/agent_plugins/exploiters/wmi/src/wmi_options.py Outdated Show resolved Hide resolved
monkey/agent_plugins/exploiters/wmi/src/wmi_client.py Outdated Show resolved Hide resolved
Comment on lines 109 to 112
try:
rpctransport = transport.DCERPCTransportFactory(stringBinding)
rpctransport.set_connect_timeout(timeout)
rpctransport.connect()
rpctransport.disconnect()
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is essentially establishing another connection and then immediately disconnecting? Isn't there another way to add a timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not that I found.

envs/monkey_zoo/blackbox/test_configurations/depth_1_a.py Outdated Show resolved Hide resolved
@ilija-lazoroski ilija-lazoroski force-pushed the 3654-wmi-firewall-checker branch 3 times, most recently from 14dc789 to b51551f Compare December 26, 2023 12:35
ilija-lazoroski added a commit that referenced this pull request Dec 26, 2023
ilija-lazoroski added a commit that referenced this pull request Dec 26, 2023
Copy link
Contributor

@shreyamalviya shreyamalviya left a comment

Choose a reason for hiding this comment

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

I'm not a fan of the logic (new connection that we're disconnecting immediately) but I don't think it's worth any more time if we're going to fix fortra/impacket#1600 eventually.

@ilija-lazoroski
Copy link
Contributor Author

I'm not a fan of the logic (new connection that we're disconnecting immediately) but I don't think it's worth any more time if we're going to fix fortra/impacket#1600 eventually.

This logic is used in a couple other projects that are using impacket for WMI. We will need to fix that eventually.

@ilija-lazoroski ilija-lazoroski merged commit 7031057 into develop Dec 27, 2023
2 of 3 checks passed
@ilija-lazoroski ilija-lazoroski deleted the 3654-wmi-firewall-checker branch December 27, 2023 12:37
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.

None yet

2 participants