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

Some try/except to make it work in a test env #104

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion certipy/commands/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,11 @@ def get_certificate_authorities(self) -> List[LDAPEntry]:
def security_to_bloodhound_aces(self, security: ActiveDirectorySecurity) -> List:
aces = []

owner = self.connection.lookup_sid(security.owner)
try:
owner = self.connection.lookup_sid(security.owner)
except:
# todo this is a quick fix, the root cause is unknown and should be investigated
return aces

aces.append(
{
Expand Down
6 changes: 5 additions & 1 deletion certipy/commands/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ def request(

logging.info("Requesting certificate via RPC")

response = self.dce.request(request)
try:
response = self.dce.request(request)
except:
# todo this is a quick fix, the root cause is unknown and should be investigated
return False

error_code = response["pdwDisposition"]
request_id = response["pdwRequestId"]
Expand Down
5 changes: 4 additions & 1 deletion certipy/lib/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ def get_user_sids(self, username: str):
"Adding Domain Computers to list of current user's SIDs (Machine Account Quota: %d > 0)"
% self.machine_account_quota
)
sids.add("%s-515" % self.domain_sid)
try:
sids.add("%s-515" % self.domain_sid)
except:
logging.debug("[-] Failed adding computer")

dns = [user.get("distinguishedName")]
for sid in sids:
Expand Down