Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to target any machine and resuse a controlled machine account #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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