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

Py3 logging improvements #475

Merged
merged 2 commits into from
Nov 4, 2019

Conversation

VakarisZ
Copy link
Contributor

Fixes

  • Fixed mssql uncaught error
  • Removed BB error.

Note:
With the latest changes we can improve exploiter code in following way:
Before:

def exploit_host(host):
    result = brute_force(host)
    if not result:
        return False

def brute_force(host):
    try:
         try_brute_force(host)
    except Exception:
         Log.debug("Brute force failed)
         return False

Now:

def exploit_host(host):
    result = brute_force(host)

def brute_force(host):
    try:
         try_brute_force(host)
    except Exception:
         raise FailedExploitationError("Brute force failed)

Note that FailedExploitationError allows us to remove if not some_func(): return False statements and makes code cleaner.

@ShayNehmad ShayNehmad added Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. Monkey UI User Interface labels Nov 4, 2019
@ShayNehmad ShayNehmad added this to the 1.7.1 milestone Nov 4, 2019
@VakarisZ VakarisZ merged commit 7de03d8 into guardicore:393/python-3 Nov 4, 2019
@VakarisZ VakarisZ deleted the py3_logging_improvements branch April 27, 2020 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. UI User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants