-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Quality of life improvements #1439
Conversation
@@ -76,7 +76,12 @@ def _run(self): | |||
certificate = response.read().decode() | |||
|
|||
certificate_store = self.generate_pfx(key, certificate) | |||
LOG.info("Base64 certificate of user %s: \n%s" % (self.username, base64.b64encode(certificate_store).decode())) | |||
LOG.info("Writing certificate to %s.pfx" % self.username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to add a try except here to catch possible errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if file exists already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@666Danger-sudo added try / except block where adcs relay attack will default to original behavior of printing b64 encoded certificate to console if writing to file fails. Also added ability for certificates to be written within lootdir specified in command line
LOG.info("Writing certificate to %s/%s.pfx" % (self.config.lootdir, self.username)) | ||
try: | ||
if not os.path.isdir(self.config.lootdir): | ||
os.mkdir(self.config.lootdir) | ||
f = open("%s/%s.pfx" % (self.config.lootdir, self.username), 'wb') | ||
f.write(certificate_store) | ||
f.close() | ||
LOG.info("Certificate successfully written to file") | ||
except Exception as e: | ||
LOG.info("Unable to write certificate to file, printing B64 of certificate to console instead") | ||
LOG.info("Base64 certificate of user %s: \n%s" % (self.username, base64.b64encode(certificate_store).decode())) | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my pull request #1440. Does the same thing with less code. More easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@666Danger-sudo implemented your solution for opening the file to write the certificate.
Hi, I'm reviewing this PR. @RazzburyPi could you rebase it, in order to avoid conflicts and then continue with the reviewing process? |
…nds / output while using the smbclient shell
…bility to skip specific users when dumping NTDS.dit or skip SAM hive when dumping remote machine
@anadrianmanrique - Rebased and pushed! Let me know if you need anything else, I appreciate your help! |
examples/smbclient.py
Outdated
if line[0] != '#': | ||
print("# %s" % line, end=' ') | ||
shell.onecmd(line) | ||
else: | ||
print(line, end=' ') | ||
else: | ||
f = open(options.outputfile, 'a') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input and output files aren't mutually exclusive. move these changes outside the else block and check options.outputfile to be active in order to avoid crash when not passing parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anadrianmanrique - Submitted commit moving the output file logic out of the if/else for the input file
@RazzburyPi changes seemed to work as expected. Please apply the sugested changes in order to merge and close this PR. |
Thanks for the PR! merging changes |
Multiple small quality of life improvements including:
ntlmrelayx
smbclient
secretsdump