fortra/impacket

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

Open

#1,077 创建于 2021年5月11日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)Python (12,244 star) (3,421 fork)batch import
enhancementhelp wanted

描述

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

贡献者指南