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

3234 fix inconsistent value error #3365

Merged
merged 5 commits into from
May 22, 2023

Conversation

cakekoa
Copy link
Contributor

@cakekoa cakekoa commented May 22, 2023

What does this PR do?

Fixes #3234.

  • Adds additional logging to SNMP
  • Switches from using createAndGo to createAndWait, which proved to be more robust in testing

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 an abridged depth_1 test ~300 times without issue

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

@@ -90,12 +93,24 @@ def exploit_host(

def _exploit(self, target_ip: IPv4Address, community_string: str, command: str):
command_name = self._generate_command_name()
self._snmp_client.set_command(target_ip, command_name, community_string, command)
logger.debug(f"Executing SNMP command {command_name} on {target_ip}")
# self._try_set_command(target_ip, command_name, community_string, command)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# self._try_set_command(target_ip, command_name, community_string, command)

Comment on lines 100 to 102
self._snmp_client.set_command(target_ip, command_name, community_string, command)
self._snmp_client.activate_command(target_ip, command_name, community_string)
self._snmp_client.execute_command(target_ip, command_name, community_string)
finally:
self._snmp_client.clear_command(target_ip, command_name, community_string)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think set_command() and activate_command() should be encapsulated by create_command().

@mssalvatore mssalvatore force-pushed the 3234-fix-inconsistent-value-error branch from 3afa0fc to 2be5d68 Compare May 22, 2023 20:54
@mssalvatore mssalvatore merged commit dd26984 into develop May 22, 2023
@mssalvatore mssalvatore deleted the 3234-fix-inconsistent-value-error branch May 22, 2023 20:55
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.

Implement an SNMP exploiter
2 participants