fortra/impacket

addcomputer.py Does not set machine object attributes (dnsHostName, SPNs, etc) when creating over SAMR

Open

#1.077 aberto em 11 de mai. de 2021

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)Python (3.421 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (12.244 stars)
Métricas de merge de PR
 (Mesclagem média 30d 8h) (10 fundiu PRs em 30d)

Description

Configuration

impacket version: Impacket v0.9.23.dev1+20210504.123629.24a0ae6f - Copyright 2020 SecureAuth Corporation Python version: 3.6 & 3.9 Target OS: Ubuntu & Kali

Debug Output With Command String

python3 addcomputer.py evilcorp.local/leon:<password> -method SAMR -computer-name rbcdFromLinux -computer-pass Password123 -dc-host dc01.evilcorp.local -dc-ip 192.168.2.10 -debug
Impacket v0.9.23.dev1+20210504.123629.24a0ae6f - Copyright 2020 SecureAuth Corporation

[+] Impacket Library Installation Path: /home/b1gbroth3r/.local/lib/python3.8/site-packages/impacket
[*] Opening domain EVILCORP...
[*] Successfully added machine account rbcdFromLinux$ with password Password123.

Additional context

The expected result is to have a new computer object created with the populated attributes being set on lines 217 -229. However, querying the new object with pywerview or viewing it in the GUI from the DC reveals this output:

accountexpires:         never
badpasswordtime:        1600-12-31 18:00:00
badpwdcount:            0
cn:                     rbcdFromLinux
codepage:               0
countrycode:            0
distinguishedname:      CN=rbcdFromLinux,CN=Computers,DC=EVILCORP,DC=LOCAL
dscorepropagationdata:  1601-01-01 00:00:00
instancetype:           4
iscriticalsystemobject: FALSE
isgroup:                False
lastlogoff:             1600-12-31 18:00:00
lastlogon:              1600-12-31 18:00:00
localpolicyflags:       0
logoncount:             0
ms-ds-creatorsid:       S-1-5-21-3737425248-4185734480-769832259-1156
name:                   rbcdFromLinux
objectcategory:         CN=Computer,CN=Schema,CN=Configuration,DC=EVILCORP,DC=LOCAL
objectclass:            top,
                        person,
                        organizationalPerson,
                        user,
                        computer
objectguid:             e4df1e58-e0c2-44f5-9083-84cdb60e8858
objectsid:              S-1-5-21-3737425248-4185734480-769832259-1190
primarygroupid:         515
pwdlastset:             1600-12-31 18:00:00
samaccountname:         rbcdFromLinux$
samaccounttype:         805306369
useraccountcontrol:     ['PASSWD_NOTREQD', 'WORKSTATION_TRUST_ACCOUNT']
usnchanged:             27348
usncreated:             27345
whenchanged:            2021-05-11 06:44:42
whencreated:            2021-05-11 06:44:42

Guia do colaborador