Skip to content

Conversation

@Margaruga
Copy link

@Margaruga Margaruga commented Jan 13, 2022

We've added minor changes to target a different account other than a domain controller. The target now is taken from the SPN.

self.computerName = options.spn.split('/')[1].split(".")[0]

We also added an additional option to specify if you want to use an existing machine account, instead of adding a new one. In order to not interfere too much with the current logic, this option just renames the machine account to the new target before continuing:

ma = MachineAccount(username, password, domain, options)
if options.use_computer:
    oldComputerName = ma.computerName
    oldNewComputerName = ma.newComputerName
    ma.computerName = options.use_computer
    ma.newComputerName = oldComputerName
    ma.rename()
    ma.computerName = oldComputerName
    ma.newComputerName = oldNewComputerName

ma.add()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant