PyADRecon-ADWS 0.4.7__tar.gz → 0.4.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/CHANGELOG.md +7 -7
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PKG-INFO +2 -2
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PyADRecon_ADWS.egg-info/PKG-INFO +2 -2
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/README.md +1 -1
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/dashboard_generator.py +18 -0
- pyadrecon_adws-0.4.8/package.json +3 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/pyadrecon_adws.py +86 -17
- pyadrecon_adws-0.4.7/package.json +0 -3
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.dockerignore +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.github/FUNDING.yml +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.github/pyadrecon.png +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.github/workflows/conventional-commits.yml +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.github/workflows/pypi.yml +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/.gitignore +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/Dockerfile +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/LICENSE +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PyADRecon_ADWS.egg-info/SOURCES.txt +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PyADRecon_ADWS.egg-info/dependency_links.txt +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PyADRecon_ADWS.egg-info/entry_points.txt +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PyADRecon_ADWS.egg-info/requires.txt +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/PyADRecon_ADWS.egg-info/top_level.txt +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/__init__.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/__init__.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/adws.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/__init__.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/encoder.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/__init__.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/attributes.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/constants.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/datatypes.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/elements.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/record.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/text.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/records/utils.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/encoder/xml_parser.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/ms_nmf.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/ms_nns.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws/soap_templates.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/helpers/adws_wrapper.py +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/pyproject.toml +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/requirements.txt +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/setup.cfg +0 -0
- {pyadrecon_adws-0.4.7 → pyadrecon_adws-0.4.8}/windows/README.md +0 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [0.4.8](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.4.7...v0.4.8) (2026-02-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* refactor ESC2, ESC3, ESC4 detection; add manager approval to dashboard ([9f2a78b](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/9f2a78b513d0b4c5edb97037fbff9e5e2cd0905f))
|
|
7
|
+
|
|
1
8
|
## [0.4.7](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.4.6...v0.4.7) (2026-02-21)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -26,10 +33,3 @@
|
|
|
26
33
|
|
|
27
34
|
* show detected cleartext pws in description/info fields ([bcdfc22](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/bcdfc223e00bd696b3145c1c146967eb48ebb629))
|
|
28
35
|
|
|
29
|
-
## [0.4.3](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.4.2...v0.4.3) (2026-02-21)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### Bug Fixes
|
|
33
|
-
|
|
34
|
-
* add krbtgt rotation and protected users group to dashboard ([93d9e4b](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/93d9e4b36c6fb417549e805788db60099735fb09))
|
|
35
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyADRecon-ADWS
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary: Python Active Directory Reconnaissance Tool (ADRecon port) using ADWS with NTLM support.
|
|
5
5
|
Author: LRVT
|
|
6
6
|
License-Expression: MIT
|
|
@@ -22,7 +22,7 @@ Dynamic: license-file
|
|
|
22
22
|
|
|
23
23
|
A Python3 implementation of [PyADRecon](https://github.com/l4rm4nd/PyADRecon) using ADWS instead of LDAP for Pentesters, Red and Blue Teams
|
|
24
24
|
|
|
25
|
-
> PyADRecon is a tool which gathers information about MS Active Directory and generates an XSLX report to provide a holistic picture of the current state of the target AD environment.
|
|
25
|
+
> PyADRecon is a tool which gathers information about MS Active Directory and generates an XSLX + HTML report to provide a holistic picture of the current security state of the target AD environment.
|
|
26
26
|
|
|
27
27
|
>[!TIP]
|
|
28
28
|
>Queries Active Directory Web Services (ADWS) over TCP/9389 instead of LDAP to fly under the EDR radar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyADRecon-ADWS
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary: Python Active Directory Reconnaissance Tool (ADRecon port) using ADWS with NTLM support.
|
|
5
5
|
Author: LRVT
|
|
6
6
|
License-Expression: MIT
|
|
@@ -22,7 +22,7 @@ Dynamic: license-file
|
|
|
22
22
|
|
|
23
23
|
A Python3 implementation of [PyADRecon](https://github.com/l4rm4nd/PyADRecon) using ADWS instead of LDAP for Pentesters, Red and Blue Teams
|
|
24
24
|
|
|
25
|
-
> PyADRecon is a tool which gathers information about MS Active Directory and generates an XSLX report to provide a holistic picture of the current state of the target AD environment.
|
|
25
|
+
> PyADRecon is a tool which gathers information about MS Active Directory and generates an XSLX + HTML report to provide a holistic picture of the current security state of the target AD environment.
|
|
26
26
|
|
|
27
27
|
>[!TIP]
|
|
28
28
|
>Queries Active Directory Web Services (ADWS) over TCP/9389 instead of LDAP to fly under the EDR radar.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A Python3 implementation of [PyADRecon](https://github.com/l4rm4nd/PyADRecon) using ADWS instead of LDAP for Pentesters, Red and Blue Teams
|
|
4
4
|
|
|
5
|
-
> PyADRecon is a tool which gathers information about MS Active Directory and generates an XSLX report to provide a holistic picture of the current state of the target AD environment.
|
|
5
|
+
> PyADRecon is a tool which gathers information about MS Active Directory and generates an XSLX + HTML report to provide a holistic picture of the current security state of the target AD environment.
|
|
6
6
|
|
|
7
7
|
>[!TIP]
|
|
8
8
|
>Queries Active Directory Web Services (ADWS) over TCP/9389 instead of LDAP to fly under the EDR radar.
|
|
@@ -869,6 +869,11 @@ class DashboardGenerator:
|
|
|
869
869
|
<i v-if="vulnCertTemplateSortColumn === 'Enrollment Rights'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
|
|
870
870
|
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
|
|
871
871
|
</th>
|
|
872
|
+
<th @click="sortVulnCertTemplates('Requires Manager Approval')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
873
|
+
Manager Approval
|
|
874
|
+
<i v-if="vulnCertTemplateSortColumn === 'Requires Manager Approval'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
|
|
875
|
+
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
|
|
876
|
+
</th>
|
|
872
877
|
<th @click="sortVulnCertTemplates('Risk Level')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
873
878
|
Risk Level
|
|
874
879
|
<i v-if="vulnCertTemplateSortColumn === 'Risk Level'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
|
|
@@ -887,6 +892,10 @@ class DashboardGenerator:
|
|
|
887
892
|
</td>
|
|
888
893
|
<td class="px-6 py-4 text-sm">{{{{ template['Risk Factors'] !== 'None' ? template['Risk Factors'] : '-' }}}}</td>
|
|
889
894
|
<td class="px-6 py-4 text-sm">{{{{ template['Enrollment Rights'] }}}}</td>
|
|
895
|
+
<td class="px-6 py-4">
|
|
896
|
+
<span v-if="template['Requires Manager Approval'] === true || template['Requires Manager Approval'] === 'True'" class="badge badge-low">Yes</span>
|
|
897
|
+
<span v-else class="badge badge-high">No</span>
|
|
898
|
+
</td>
|
|
890
899
|
<td class="px-6 py-4">
|
|
891
900
|
<span v-if="template['Risk Level'] === 'CRITICAL'" class="badge badge-critical">CRITICAL</span>
|
|
892
901
|
<span v-else-if="template['Risk Level'] === 'HIGH'" class="badge badge-high">HIGH</span>
|
|
@@ -1502,6 +1511,11 @@ class DashboardGenerator:
|
|
|
1502
1511
|
<i v-if="certTemplateSortColumn === 'Enrollment Rights'" :class="certTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
|
|
1503
1512
|
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
|
|
1504
1513
|
</th>
|
|
1514
|
+
<th @click="sortCertTemplates('Requires Manager Approval')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
1515
|
+
Manager Approval
|
|
1516
|
+
<i v-if="certTemplateSortColumn === 'Requires Manager Approval'" :class="certTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
|
|
1517
|
+
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
|
|
1518
|
+
</th>
|
|
1505
1519
|
</tr>
|
|
1506
1520
|
</thead>
|
|
1507
1521
|
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
|
@@ -1517,6 +1531,10 @@ class DashboardGenerator:
|
|
|
1517
1531
|
</td>
|
|
1518
1532
|
<td class="px-6 py-4 text-sm">{{{{ template['ESC Vulnerabilities'] || 'None' }}}}</td>
|
|
1519
1533
|
<td class="px-6 py-4 text-sm">{{{{ template['Enrollment Rights'] || 'N/A' }}}}</td>
|
|
1534
|
+
<td class="px-6 py-4">
|
|
1535
|
+
<span v-if="template['Requires Manager Approval'] === true || template['Requires Manager Approval'] === 'True'" class="badge badge-low">Yes</span>
|
|
1536
|
+
<span v-else class="badge badge-high">No</span>
|
|
1537
|
+
</td>
|
|
1520
1538
|
</tr>
|
|
1521
1539
|
</tbody>
|
|
1522
1540
|
</table>
|
|
@@ -77,7 +77,7 @@ except ImportError:
|
|
|
77
77
|
DASHBOARD_AVAILABLE = False
|
|
78
78
|
|
|
79
79
|
# Constants
|
|
80
|
-
VERSION = "v0.4.
|
|
80
|
+
VERSION = "v0.4.8" # Automatically updated by CI/CD pipeline during release
|
|
81
81
|
BANNER = f"""
|
|
82
82
|
╔═══════════════════════════════════════════════════════════════════
|
|
83
83
|
║ PyADRecon-ADWS {VERSION} - Python AD Reconnaissance Tool (ADWS)
|
|
@@ -1546,9 +1546,9 @@ class PyADRecon:
|
|
|
1546
1546
|
|
|
1547
1547
|
def _is_low_privilege_principal(self, principal_name: str) -> bool:
|
|
1548
1548
|
"""Check if a principal is low-privileged based on SID resolution."""
|
|
1549
|
-
# Extract SID from principal name if it's in [
|
|
1550
|
-
if '[SID]' in principal_name:
|
|
1551
|
-
# Extract SID from "[SID] S-1-..."
|
|
1549
|
+
# Extract SID from principal name if it's in [SID] or [domain SID] format
|
|
1550
|
+
if '[SID]' in principal_name or 'SID]' in principal_name:
|
|
1551
|
+
# Extract SID from "[SID] S-1-..." or "[domain.name SID] S-1-..."
|
|
1552
1552
|
sid_match = re.search(r'S-1-[0-9-]+', principal_name)
|
|
1553
1553
|
if sid_match:
|
|
1554
1554
|
sid = sid_match.group(0)
|
|
@@ -1568,7 +1568,23 @@ class PyADRecon:
|
|
|
1568
1568
|
'[group] domain guests',
|
|
1569
1569
|
}
|
|
1570
1570
|
|
|
1571
|
-
|
|
1571
|
+
if principal_lower in low_priv_names:
|
|
1572
|
+
return True
|
|
1573
|
+
|
|
1574
|
+
# Check if this is an individual user account (not a well-known admin)
|
|
1575
|
+
# Individual users who are not privileged accounts should be considered low-priv for ESC detection
|
|
1576
|
+
if '[user]' in principal_lower:
|
|
1577
|
+
# Exclude well-known privileged user accounts
|
|
1578
|
+
admin_users = {
|
|
1579
|
+
'[user] administrator',
|
|
1580
|
+
'[user] krbtgt',
|
|
1581
|
+
'[user] guest'
|
|
1582
|
+
}
|
|
1583
|
+
if principal_lower not in admin_users:
|
|
1584
|
+
# This is a regular user account, consider it low-privilege
|
|
1585
|
+
return True
|
|
1586
|
+
|
|
1587
|
+
return False
|
|
1572
1588
|
|
|
1573
1589
|
def _initialize_sid_mappings(self):
|
|
1574
1590
|
"""Initialize SID to domain name mappings for cross-domain SID resolution.
|
|
@@ -4341,6 +4357,11 @@ class PyADRecon:
|
|
|
4341
4357
|
# Check authorization flags
|
|
4342
4358
|
no_security_extension = bool(enrollment_flag & 0x80000000) # ESC9
|
|
4343
4359
|
auto_enroll = bool(enrollment_flag & 0x00000020)
|
|
4360
|
+
requires_manager_approval = bool(enrollment_flag & 0x00000002)
|
|
4361
|
+
|
|
4362
|
+
# Check if authorized signatures are required (ESC3 check)
|
|
4363
|
+
ra_signature_count = safe_int(get_attr(entry, 'msPKI-RA-Signature', 0))
|
|
4364
|
+
requires_authorized_signatures = ra_signature_count > 0
|
|
4344
4365
|
|
|
4345
4366
|
# Check if exportable
|
|
4346
4367
|
exportable_key = bool(private_key_flag & 0x00000010) # CT_FLAG_EXPORTABLE_KEY
|
|
@@ -4420,33 +4441,71 @@ class PyADRecon:
|
|
|
4420
4441
|
|
|
4421
4442
|
# ESC1: Domain escalation via Subject Alternative Name
|
|
4422
4443
|
if enrollee_supplies_subject and has_client_auth and enrollment_principals and not only_admins_can_enroll:
|
|
4423
|
-
|
|
4444
|
+
esc_vulns.append('ESC1')
|
|
4445
|
+
if requires_manager_approval:
|
|
4446
|
+
# Manager approval mitigates but doesn't eliminate the risk
|
|
4447
|
+
if risk_level == 'Low':
|
|
4448
|
+
risk_level = 'MEDIUM'
|
|
4449
|
+
risk_factors.append('ESC1: Enrollee supplies subject + Client Auth (mitigated by manager approval)')
|
|
4450
|
+
elif low_priv_can_enroll:
|
|
4424
4451
|
risk_level = 'CRITICAL'
|
|
4425
|
-
esc_vulns.append('ESC1')
|
|
4426
4452
|
risk_factors.append('ESC1: Enrollee supplies subject + Client Auth + Low-priv enrollment')
|
|
4427
4453
|
else:
|
|
4428
4454
|
risk_level = 'HIGH'
|
|
4429
|
-
esc_vulns.append('ESC1')
|
|
4430
4455
|
risk_factors.append('ESC1: Enrollee supplies subject + Client Auth')
|
|
4431
4456
|
|
|
4432
4457
|
# ESC2: Any Purpose EKU
|
|
4433
4458
|
if has_any_purpose_eku and enrollment_principals and not only_admins_can_enroll:
|
|
4434
|
-
|
|
4459
|
+
esc_vulns.append('ESC2')
|
|
4460
|
+
if requires_manager_approval:
|
|
4461
|
+
# Manager approval mitigates but doesn't eliminate the risk
|
|
4462
|
+
if risk_level == 'Low':
|
|
4463
|
+
risk_level = 'Low'
|
|
4464
|
+
risk_factors.append('ESC2: Any Purpose EKU (mitigated by manager approval requirement)')
|
|
4465
|
+
elif low_priv_can_enroll:
|
|
4435
4466
|
if risk_level != 'CRITICAL':
|
|
4436
4467
|
risk_level = 'HIGH'
|
|
4437
|
-
|
|
4468
|
+
risk_factors.append('ESC2: Any Purpose EKU allows arbitrary certificate usage')
|
|
4469
|
+
else:
|
|
4470
|
+
if risk_level not in ['CRITICAL', 'HIGH']:
|
|
4471
|
+
risk_level = 'MEDIUM'
|
|
4438
4472
|
risk_factors.append('ESC2: Any Purpose EKU allows arbitrary certificate usage')
|
|
4439
4473
|
|
|
4440
4474
|
# ESC3: Enrollment Agent template
|
|
4475
|
+
# ESC3 requires: Certificate Request Agent EKU + No authorized signatures + No manager approval
|
|
4441
4476
|
if has_enrollment_agent and enrollment_principals and not only_admins_can_enroll:
|
|
4442
|
-
|
|
4477
|
+
esc_vulns.append('ESC3')
|
|
4478
|
+
# Check if both manager approval AND authorized signatures are missing (both mitigations absent)
|
|
4479
|
+
if not requires_manager_approval and not requires_authorized_signatures:
|
|
4480
|
+
# No mitigations in place - this is exploitable
|
|
4481
|
+
if low_priv_can_enroll:
|
|
4482
|
+
if risk_level not in ['CRITICAL', 'HIGH']:
|
|
4483
|
+
risk_level = 'HIGH'
|
|
4484
|
+
risk_factors.append('ESC3: Certificate Request Agent EKU with no approval/signature requirements')
|
|
4485
|
+
else:
|
|
4486
|
+
if risk_level not in ['CRITICAL', 'HIGH']:
|
|
4487
|
+
risk_level = 'MEDIUM'
|
|
4488
|
+
risk_factors.append('ESC3: Certificate Request Agent EKU with no approval/signature requirements')
|
|
4489
|
+
elif requires_manager_approval and requires_authorized_signatures:
|
|
4490
|
+
# Both mitigations present
|
|
4491
|
+
if risk_level == 'Low':
|
|
4492
|
+
risk_level = 'Low'
|
|
4493
|
+
risk_factors.append('ESC3: Certificate Request Agent EKU (mitigated by manager approval + authorized signatures)')
|
|
4494
|
+
elif requires_manager_approval or requires_authorized_signatures:
|
|
4495
|
+
# One mitigation present
|
|
4496
|
+
if risk_level == 'Low':
|
|
4497
|
+
risk_level = 'Low'
|
|
4498
|
+
mitigation = 'manager approval' if requires_manager_approval else 'authorized signatures'
|
|
4499
|
+
risk_factors.append(f'ESC3: Certificate Request Agent EKU (partially mitigated by {mitigation})')
|
|
4500
|
+
else:
|
|
4501
|
+
# Edge case - shouldn't reach here
|
|
4443
4502
|
if risk_level not in ['CRITICAL', 'HIGH']:
|
|
4444
|
-
risk_level = '
|
|
4445
|
-
|
|
4446
|
-
risk_factors.append('ESC3: Certificate Request Agent EKU (enrollment agent)')
|
|
4503
|
+
risk_level = 'MEDIUM'
|
|
4504
|
+
risk_factors.append('ESC3: Certificate Request Agent EKU')
|
|
4447
4505
|
|
|
4448
4506
|
# ESC4: Vulnerable template ACLs
|
|
4449
4507
|
if low_priv_can_write:
|
|
4508
|
+
# ESC4 is not mitigated by manager approval - attackers can modify the template to disable it
|
|
4450
4509
|
if risk_level not in ['CRITICAL', 'HIGH']:
|
|
4451
4510
|
risk_level = 'HIGH'
|
|
4452
4511
|
esc_vulns.append('ESC4')
|
|
@@ -4454,10 +4513,16 @@ class PyADRecon:
|
|
|
4454
4513
|
|
|
4455
4514
|
# ESC9: No security extension
|
|
4456
4515
|
if vulnerable_to_esc9 and enrollment_principals and not only_admins_can_enroll:
|
|
4457
|
-
if risk_level == 'Low':
|
|
4458
|
-
risk_level = 'Medium'
|
|
4459
4516
|
esc_vulns.append('ESC9')
|
|
4460
|
-
|
|
4517
|
+
if requires_manager_approval:
|
|
4518
|
+
# Manager approval provides some mitigation for ESC9
|
|
4519
|
+
if risk_level == 'Low':
|
|
4520
|
+
risk_level = 'Low'
|
|
4521
|
+
risk_factors.append('ESC9: No security extension (mitigated by manager approval)')
|
|
4522
|
+
else:
|
|
4523
|
+
if risk_level == 'Low':
|
|
4524
|
+
risk_level = 'Medium'
|
|
4525
|
+
risk_factors.append('ESC9: No security extension (vulnerable to certificate theft)')
|
|
4461
4526
|
|
|
4462
4527
|
# Additional risk factors
|
|
4463
4528
|
if only_admins_can_enroll and (enrollee_supplies_subject and has_client_auth):
|
|
@@ -4479,8 +4544,11 @@ class PyADRecon:
|
|
|
4479
4544
|
|
|
4480
4545
|
# Check if owner is low-privileged (potential ESC4 variant)
|
|
4481
4546
|
if owner_principal and self._is_low_privilege_principal(owner_principal):
|
|
4547
|
+
# ESC4 is not mitigated by manager approval - owner can modify the template
|
|
4482
4548
|
if risk_level not in ['CRITICAL', 'HIGH']:
|
|
4483
4549
|
risk_level = 'HIGH'
|
|
4550
|
+
if 'ESC4' not in esc_vulns:
|
|
4551
|
+
esc_vulns.append('ESC4')
|
|
4484
4552
|
risk_factors.append('ESC4: Low-privileged owner can modify template')
|
|
4485
4553
|
|
|
4486
4554
|
# If no ESC vulnerabilities and no risk factors, set risk level to None
|
|
@@ -4511,6 +4579,7 @@ class PyADRecon:
|
|
|
4511
4579
|
"Exportable Key": exportable_key,
|
|
4512
4580
|
"Auto-Enrollment": auto_enroll,
|
|
4513
4581
|
"Requires Manager Approval": bool(enrollment_flag & 0x00000002),
|
|
4582
|
+
"Authorized Signatures Required": ra_signature_count,
|
|
4514
4583
|
"Enrollment Flag": hex(enrollment_flag),
|
|
4515
4584
|
"Certificate Name Flag": hex(cert_name_flag),
|
|
4516
4585
|
"Private Key Flag": hex(private_key_flag),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|