Skip to content

Commit

Permalink
changed ssl verify logic for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpc500 committed Dec 21, 2021
1 parent 4a972c5 commit 920f33d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Payload_Type/medusa/mythic/agent_functions/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ async def build(self) -> BuildResponse:

if self.get_parameter("https_check") == "No":
base_code = base_code.replace("urlopen(req)", "urlopen(req, context=gcontext)")
base_code = base_code.replace("#CERTSKIP", \
"gcontext = ssl.SSLContext(ssl.PROTOCOL_TLS)\n gcontext.verify_mode = ssl.CERT_NONE")
base_code = base_code.replace("#CERTSKIP",
"""
gcontext = ssl.create_default_context()
gcontext.check_hostname = False
gcontext.verify_mode = ssl.CERT_NONE\n""")
else:
base_code = base_code.replace("#CERTSKIP", "")

Expand Down

0 comments on commit 920f33d

Please sign in to comment.