NetExec/nxc/modules/MachineAccountQuota.py

33 lines
904 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
2023-05-02 15:17:59 +00:00
class NXCModule:
"""
2023-05-02 15:17:59 +00:00
Module by Shutdown and Podalirius
2023-05-02 15:17:59 +00:00
Initial module:
2023-09-17 20:16:22 +00:00
https://github.com/ShutdownRepo/CrackMapExec-MachineAccountQuota
2023-05-02 15:17:59 +00:00
Authors:
Shutdown: @_nwodtuhs
Podalirius: @podalirius_
"""
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"]
opsec_safe = True
multiple_hosts = False
2023-05-02 15:17:59 +00:00
def on_login(self, context, connection):
result = []
2023-05-02 15:17:59 +00:00
context.log.display("Getting the MachineAccountQuota")
searchFilter = "(objectClass=*)"
attributes = ["ms-DS-MachineAccountQuota"]
result = connection.search(searchFilter, attributes)
2023-05-08 18:39:36 +00:00
context.log.highlight("MachineAccountQuota: %d" % result[0]["attributes"][0]["vals"][0])