PyADRecon-ADWS 0.3.7__tar.gz → 0.3.9__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.
Files changed (45) hide show
  1. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/CHANGELOG.md +10 -10
  2. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PKG-INFO +1 -1
  3. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PyADRecon_ADWS.egg-info/PKG-INFO +1 -1
  4. pyadrecon_adws-0.3.9/package.json +3 -0
  5. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/pyadrecon_adws.py +109 -17
  6. pyadrecon_adws-0.3.7/package.json +0 -3
  7. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.dockerignore +0 -0
  8. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.github/FUNDING.yml +0 -0
  9. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  10. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  11. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.github/pyadrecon.png +0 -0
  12. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.github/workflows/conventional-commits.yml +0 -0
  13. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.github/workflows/pypi.yml +0 -0
  14. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/.gitignore +0 -0
  15. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/Dockerfile +0 -0
  16. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/LICENSE +0 -0
  17. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PyADRecon_ADWS.egg-info/SOURCES.txt +0 -0
  18. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PyADRecon_ADWS.egg-info/dependency_links.txt +0 -0
  19. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PyADRecon_ADWS.egg-info/entry_points.txt +0 -0
  20. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PyADRecon_ADWS.egg-info/requires.txt +0 -0
  21. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/PyADRecon_ADWS.egg-info/top_level.txt +0 -0
  22. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/README.md +0 -0
  23. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/__init__.py +0 -0
  24. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/__init__.py +0 -0
  25. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/adws.py +0 -0
  26. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/__init__.py +0 -0
  27. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/encoder.py +0 -0
  28. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/__init__.py +0 -0
  29. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/attributes.py +0 -0
  30. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/constants.py +0 -0
  31. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/datatypes.py +0 -0
  32. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/elements.py +0 -0
  33. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/record.py +0 -0
  34. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/text.py +0 -0
  35. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/records/utils.py +0 -0
  36. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/encoder/xml_parser.py +0 -0
  37. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/ms_nmf.py +0 -0
  38. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/ms_nns.py +0 -0
  39. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws/soap_templates.py +0 -0
  40. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/helpers/adws_wrapper.py +0 -0
  41. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/pyproject.toml +0 -0
  42. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/requirements.txt +0 -0
  43. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/setup.cfg +0 -0
  44. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/windows/README.md +0 -0
  45. {pyadrecon_adws-0.3.7 → pyadrecon_adws-0.3.9}/windows/pyadrecon_adws.exe +0 -0
@@ -1,35 +1,35 @@
1
- ## [0.3.7](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.6...v0.3.7) (2026-02-19)
1
+ ## [0.3.9](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.8...v0.3.9) (2026-02-19)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * forest support for child domain environments ([1deacd3](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/1deacd355dc4ce58e336a3b72ba758209e24297d))
6
+ * columns coloring for user and computer stats tab ([c7b8b02](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/c7b8b0209722614685e5c4326a7d5c6d7328ec6d))
7
7
 
8
- ## [0.3.6](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.5...v0.3.6) (2026-02-19)
8
+ ## [0.3.8](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.7...v0.3.8) (2026-02-19)
9
9
 
10
10
 
11
11
  ### Bug Fixes
12
12
 
13
- * adjust ace parsing for adcs and fix esc4 detection ([56b91d1](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/56b91d19b2534553b8d1cf672d6a037db780b9b6))
13
+ * support forest-child enumerations with proper sid resolving ([15aff39](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/15aff39c015a5d017e8c6c9cb7a3dd4763af6d0b))
14
14
 
15
- ## [0.3.5](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.4...v0.3.5) (2026-02-19)
15
+ ## [0.3.7](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.6...v0.3.7) (2026-02-19)
16
16
 
17
17
 
18
18
  ### Bug Fixes
19
19
 
20
- * make --page-size and -v working ([e4bb00d](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/e4bb00d348f82b3685c11c90ab5bfaedf0452e3b))
20
+ * forest support for child domain environments ([1deacd3](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/1deacd355dc4ce58e336a3b72ba758209e24297d))
21
21
 
22
- ## [0.3.4](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.3...v0.3.4) (2026-02-19)
22
+ ## [0.3.6](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.5...v0.3.6) (2026-02-19)
23
23
 
24
24
 
25
25
  ### Bug Fixes
26
26
 
27
- * adcs ca parsing ([bde2e18](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/bde2e18b938e7be809ef4183294e0a025d2e1e26))
27
+ * adjust ace parsing for adcs and fix esc4 detection ([56b91d1](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/56b91d19b2534553b8d1cf672d6a037db780b9b6))
28
28
 
29
- ## [0.3.3](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.2...v0.3.3) (2026-02-19)
29
+ ## [0.3.5](https://github.com/l4rm4nd/PyADRecon-ADWS/compare/v0.3.4...v0.3.5) (2026-02-19)
30
30
 
31
31
 
32
32
  ### Bug Fixes
33
33
 
34
- * cell coloring; remove requirement for dns lookups and just lookup dumped dns records ([46d3d2a](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/46d3d2afc2b3980df396d5bccc1f5114b9033a61))
34
+ * make --page-size and -v working ([e4bb00d](https://github.com/l4rm4nd/PyADRecon-ADWS/commit/e4bb00d348f82b3685c11c90ab5bfaedf0452e3b))
35
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyADRecon-ADWS
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: Python Active Directory Reconnaissance Tool (ADRecon port) using ADWS with NTLM support.
5
5
  Author: LRVT
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyADRecon-ADWS
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: Python Active Directory Reconnaissance Tool (ADRecon port) using ADWS with NTLM support.
5
5
  Author: LRVT
6
6
  License-Expression: MIT
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": "0.3.9"
3
+ }
@@ -69,7 +69,7 @@ except ImportError:
69
69
  print("[*] openpyxl not available - Excel export disabled")
70
70
 
71
71
  # Constants
72
- VERSION = "v0.3.7" # Automatically updated by CI/CD pipeline during release
72
+ VERSION = "v0.3.9" # Automatically updated by CI/CD pipeline during release
73
73
  BANNER = f"""
74
74
  ╔═══════════════════════════════════════════════════════════════════
75
75
  ║ PyADRecon-ADWS {VERSION} - Python AD Reconnaissance Tool (ADWS)
@@ -878,7 +878,8 @@ class PyADRecon:
878
878
  return []
879
879
 
880
880
  def _resolve_sid_to_name(self, sid: str) -> str:
881
- """Resolve a SID to a readable name (user/group) with caching."""
881
+ """Resolve a SID to a readable name (user/group) with caching.
882
+ Handles cross-domain SIDs in forest environments."""
882
883
  # Check cache first
883
884
  if sid in self._sid_cache:
884
885
  return self._sid_cache[sid]
@@ -904,7 +905,51 @@ class PyADRecon:
904
905
  self._sid_cache[sid] = result
905
906
  return result
906
907
 
907
- # Try to resolve from domain
908
+ # Well-known RIDs (work with any domain SID)
909
+ well_known_rids = {
910
+ '498': 'Enterprise Read-only Domain Controllers',
911
+ '500': 'Administrator',
912
+ '501': 'Guest',
913
+ '502': 'KRBTGT',
914
+ '512': 'Domain Admins',
915
+ '513': 'Domain Users',
916
+ '514': 'Domain Guests',
917
+ '515': 'Domain Computers',
918
+ '516': 'Domain Controllers',
919
+ '517': 'Cert Publishers',
920
+ '518': 'Schema Admins',
921
+ '519': 'Enterprise Admins',
922
+ '520': 'Group Policy Creator Owners',
923
+ '521': 'Read-only Domain Controllers',
924
+ '522': 'Cloneable Domain Controllers',
925
+ '525': 'Protected Users',
926
+ '526': 'Key Admins',
927
+ '527': 'Enterprise Key Admins',
928
+ '553': 'RAS and IAS Servers',
929
+ '571': 'Allowed RODC Password Replication Group',
930
+ '572': 'Denied RODC Password Replication Group',
931
+ }
932
+
933
+ # Check if this is a domain SID with a well-known RID
934
+ if sid.startswith('S-1-5-21-'):
935
+ parts = sid.split('-')
936
+ if len(parts) >= 8:
937
+ rid = parts[-1]
938
+ if rid in well_known_rids:
939
+ # Check if it's from a different domain
940
+ sid_domain = '-'.join(parts[:7]) # S-1-5-21-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx
941
+ current_domain = self.domain_sid if hasattr(self, 'domain_sid') and self.domain_sid else None
942
+
943
+ if current_domain and sid_domain != current_domain:
944
+ # Cross-domain SID - mark it as from another domain
945
+ result = f"[Foreign Domain] {well_known_rids[rid]}"
946
+ else:
947
+ result = well_known_rids[rid]
948
+
949
+ self._sid_cache[sid] = result
950
+ return result
951
+
952
+ # Try to resolve from current domain
908
953
  try:
909
954
  # Search for the object by objectSid
910
955
  entries = self.search(
@@ -932,7 +977,36 @@ class PyADRecon:
932
977
  self._sid_cache[sid] = result
933
978
  return result
934
979
  except Exception as e:
935
- logger.debug(f"Could not resolve SID {sid}: {e}")
980
+ logger.debug(f"Could not resolve SID {sid} in current domain: {e}")
981
+
982
+ # If not found in current domain and we're in a child domain, try forest root
983
+ if hasattr(self, 'forest_root_dn') and self.forest_root_dn != self.base_dn:
984
+ try:
985
+ entries = self.search(
986
+ self.forest_root_dn,
987
+ f"(objectSid={sid})",
988
+ ['sAMAccountName', 'cn', 'distinguishedName', 'objectClass']
989
+ )
990
+
991
+ if entries:
992
+ entry = entries[0]
993
+ sam_name = get_attr(entry, 'sAMAccountName', '')
994
+ cn_name = get_attr(entry, 'cn', '')
995
+ obj_classes = get_attr_list(entry, 'objectClass')
996
+
997
+ if 'computer' in obj_classes:
998
+ result = f"[Computer] {sam_name or cn_name}"
999
+ elif 'group' in obj_classes:
1000
+ result = f"[Group] {sam_name or cn_name}"
1001
+ elif 'user' in obj_classes:
1002
+ result = f"[User] {sam_name or cn_name}"
1003
+ else:
1004
+ result = sam_name or cn_name
1005
+
1006
+ self._sid_cache[sid] = result
1007
+ return result
1008
+ except Exception as e:
1009
+ logger.debug(f"Could not resolve SID {sid} in forest root: {e}")
936
1010
 
937
1011
  # Return SID if resolution failed
938
1012
  result = f"[SID] {sid}"
@@ -1531,7 +1605,8 @@ class PyADRecon:
1531
1605
  attributes=['msDS-Behavior-Version', 'fSMORoleOwner', 'msDS-EnabledFeature', 'distinguishedName']
1532
1606
  )
1533
1607
 
1534
- forest_name = dn_to_fqdn(self.base_dn)
1608
+ # Use forest root DN (not current domain's base_dn) for forest name
1609
+ forest_name = dn_to_fqdn(self.forest_root_dn if hasattr(self, 'forest_root_dn') else self.base_dn)
1535
1610
  forest_fl = 0
1536
1611
 
1537
1612
  if entries:
@@ -1553,11 +1628,18 @@ class PyADRecon:
1553
1628
  if naming_entries:
1554
1629
  naming_owner = get_attr(naming_entries[0], 'fSMORoleOwner', '')
1555
1630
  if naming_owner:
1556
- # Extract DC name from DN
1631
+ # Extract DC FQDN from DN: CN=NTDS Settings,CN=DC1,CN=Servers,CN=Site,... -> DC1.domain.local
1632
+ # The DN contains domain components that tell us the actual domain
1557
1633
  parts = str(naming_owner).split(',')
1558
1634
  if len(parts) > 1:
1559
- dc_name = parts[1].replace('CN=', '')
1560
- results.append({"Category": "Domain Naming Master", "Value": f"{dc_name.lower()}.{forest_name}"})
1635
+ dc_name = parts[1].replace('CN=', '').strip()
1636
+ # Extract domain DN from the rest of the path
1637
+ domain_dn_parts = [p for p in parts if p.strip().upper().startswith('DC=')]
1638
+ if domain_dn_parts:
1639
+ domain_fqdn = dn_to_fqdn(','.join(domain_dn_parts))
1640
+ results.append({"Category": "Domain Naming Master", "Value": f"{dc_name.lower()}.{domain_fqdn}"})
1641
+ else:
1642
+ results.append({"Category": "Domain Naming Master", "Value": f"{dc_name.lower()}.{forest_name}"})
1561
1643
  except:
1562
1644
  pass
1563
1645
 
@@ -1573,8 +1655,14 @@ class PyADRecon:
1573
1655
  if schema_owner:
1574
1656
  parts = str(schema_owner).split(',')
1575
1657
  if len(parts) > 1:
1576
- dc_name = parts[1].replace('CN=', '')
1577
- results.append({"Category": "Schema Master", "Value": f"{dc_name.lower()}.{forest_name}"})
1658
+ dc_name = parts[1].replace('CN=', '').strip()
1659
+ # Extract domain DN from the DN path
1660
+ domain_dn_parts = [p for p in parts if p.strip().upper().startswith('DC=')]
1661
+ if domain_dn_parts:
1662
+ domain_fqdn = dn_to_fqdn(','.join(domain_dn_parts))
1663
+ results.append({"Category": "Schema Master", "Value": f"{dc_name.lower()}.{domain_fqdn}"})
1664
+ else:
1665
+ results.append({"Category": "Schema Master", "Value": f"{dc_name.lower()}.{forest_name}"})
1578
1666
  except:
1579
1667
  pass
1580
1668
 
@@ -5709,16 +5797,20 @@ class PyADRecon:
5709
5797
 
5710
5798
  stripe_fill = PatternFill(start_color="F2F2F2", end_color="F2F2F2", fill_type="solid")
5711
5799
 
5712
- # RGB values of security colors to preserve (with 00 prefix that openpyxl adds)
5713
- security_colors = {
5714
- "00FFB3BA", # Red
5800
+ # RGB values of colors to preserve (with 00 prefix that openpyxl adds)
5801
+ preserve_colors = {
5802
+ "00FFB3BA", # Red (security)
5715
5803
  "FFB3BA", # Red (without prefix)
5716
- "00FFD9B3", # Orange
5804
+ "00FFD9B3", # Orange (security)
5717
5805
  "FFD9B3", # Orange (without prefix)
5718
- "00FFFFB3", # Yellow
5806
+ "00FFFFB3", # Yellow (security)
5719
5807
  "FFFFB3", # Yellow (without prefix)
5720
5808
  "00E0E0E0", # Gray (disabled accounts)
5721
5809
  "E0E0E0", # Gray (without prefix)
5810
+ "000066CC", # Blue (headers)
5811
+ "0066CC", # Blue (without prefix)
5812
+ "00B3FFB3", # Green (positive indicators)
5813
+ "B3FFB3", # Green (without prefix)
5722
5814
  }
5723
5815
 
5724
5816
  logger.info(" Applying striped row formatting...")
@@ -5738,9 +5830,9 @@ class PyADRecon:
5738
5830
  for col_idx in range(1, ws.max_column + 1):
5739
5831
  cell = ws.cell(row=row_idx, column=col_idx)
5740
5832
  # Only apply striping if cell has no fill or has default fill
5741
- # Skip cells with security colors
5833
+ # Skip cells with colored fills (headers, security highlights, etc.)
5742
5834
  cell_rgb = cell.fill.start_color.rgb if cell.fill and hasattr(cell.fill.start_color, 'rgb') else None
5743
- if cell_rgb is None or cell_rgb == '00000000' or cell_rgb not in security_colors:
5835
+ if cell_rgb is None or cell_rgb == '00000000' or cell_rgb not in preserve_colors:
5744
5836
  cell.fill = stripe_fill
5745
5837
 
5746
5838
  def export_xlsx(self, output_dir: str, domain_name: str = ""):
@@ -1,3 +0,0 @@
1
- {
2
- "version": "0.3.7"
3
- }
File without changes
File without changes
File without changes