2022-07-18 23:59:14 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2023-05-02 15:17:59 +00:00
|
|
|
|
2023-09-17 20:20:40 +00:00
|
|
|
class NXCModule:
|
2023-04-07 16:40:48 +00:00
|
|
|
"""
|
2023-05-02 15:17:59 +00:00
|
|
|
Module by Shutdown and Podalirius
|
2021-05-28 08:07:50 +00:00
|
|
|
|
2023-05-02 15:17:59 +00:00
|
|
|
Initial module:
|
2023-09-17 20:16:22 +00:00
|
|
|
https://github.com/ShutdownRepo/CrackMapExec-MachineAccountQuota
|
2021-05-28 08:07:50 +00:00
|
|
|
|
2023-05-02 15:17:59 +00:00
|
|
|
Authors:
|
|
|
|
Shutdown: @_nwodtuhs
|
|
|
|
Podalirius: @podalirius_
|
2023-04-07 16:40:48 +00:00
|
|
|
"""
|
2021-05-28 08:07:50 +00:00
|
|
|
|
|
|
|
def options(self, context, module_options):
|
|
|
|
pass
|
|
|
|
|
2023-05-02 15:17:59 +00:00
|
|
|
name = "MAQ"
|
|
|
|
description = "Retrieves the MachineAccountQuota domain-level attribute"
|
|
|
|
supported_protocols = ["ldap"]
|
2021-05-28 08:07:50 +00:00
|
|
|
opsec_safe = True
|
|
|
|
multiple_hosts = False
|
|
|
|
|
2023-05-02 15:17:59 +00:00
|
|
|
def on_login(self, context, connection):
|
2021-06-24 18:37:54 +00:00
|
|
|
result = []
|
2023-05-02 15:17:59 +00:00
|
|
|
context.log.display("Getting the MachineAccountQuota")
|
|
|
|
searchFilter = "(objectClass=*)"
|
|
|
|
attributes = ["ms-DS-MachineAccountQuota"]
|
2022-02-06 12:40:49 +00:00
|
|
|
result = connection.search(searchFilter, attributes)
|
2023-05-08 18:39:36 +00:00
|
|
|
context.log.highlight("MachineAccountQuota: %d" % result[0]["attributes"][0]["vals"][0])
|