mirror of
https://github.com/Pennyw0rth/NetExec
synced 2026-06-06 16:34:30 +00:00
091915b990
Update LDAP proto: - can fetch a LDAP domain from an account from another domain (trust relation between forest) - fix sizeLimit to unlimited on LDAP queries - fix little mistake in LDAP modules Update SMB proto: - fix users function when DC is vulnerable to NULL SESSION - add SAMRPC function to fetch users on the domain - add option --computers to fetch all computers Update CLI - add function export, but it's not tested
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
from impacket.ldap import ldapasn1 as ldapasn1_impacket
|
|
|
|
|
|
class CMEModule:
|
|
'''
|
|
Module by Shutdown and Podalirius
|
|
|
|
Initial module:
|
|
https://github.com/ShutdownRepo/CrackMapExec-MachineAccountQuota
|
|
|
|
Authors:
|
|
Shutdown: @_nwodtuhs
|
|
Podalirius: @podalirius_
|
|
'''
|
|
|
|
def options(self, context, module_options):
|
|
pass
|
|
|
|
name = 'MAQ'
|
|
description = 'Retrieves the MachineAccountQuota domain-level attribute'
|
|
supported_protocols = ['ldap']
|
|
opsec_safe = True
|
|
multiple_hosts = False
|
|
|
|
def on_login(self, context, connection):
|
|
result = []
|
|
context.log.info('Getting the MachineAccountQuota')
|
|
searchFilter = '(objectClass=*)'
|
|
attributes = ['ms-DS-MachineAccountQuota']
|
|
result = connection.search(searchFilter, attributes, 1)
|
|
for item in result:
|
|
if isinstance(item, ldapasn1_impacket.SearchResultEntry) is not True:
|
|
continue
|
|
context.log.highlight("MachineAccountQuota: %d" % item['attributes'][0]['vals'][0])
|