Netapi example question

Henrik henke at mac.se
Wed Aug 6 12:43:42 GMT 2008


30 jul 2008 kl. 18.37 skrev Guenther Deschner:

> Henrik wrote:
>> 16 jun 2008 kl. 13.35 skrev Guenther Deschner:
>>> Hi,
>>>
>>> Henrik wrote:
>>>> Hi list,
>>>> I'm using the user_enum.c example to enumerate users and it works  
>>>> great.
>>>
>>> Cool, glad to hear it's useful for you :)
>>>
>>>> I know wonder if its possible to use the USER_INFO structure to  
>>>> also resolve users SID?
>>>
>>> Not yet, these are in other USER_INFO levels (USER_INFO_23 I  
>>> think), that have just not been implemented yet. It's really just  
>>> a matter of doing, maybe I find some time to work on these later  
>>> this week.
>> Any updates on this :)
>
> Yep, with current 3-3-test git, you should now be able to call  
> NetUserEnum with level 23.
>
> Just call example code like this:
>
> lib/netapi/examples/bin/user_enum yourdc 23
>

After some fixes from Michael the user_enum example would compile but  
I do not get anything back while running the code.

I tried it against both a windows 2008 DC and some ordinary XP boxes  
without result. It should be able to enumerate local user on a  
standard XP box, correct?

Also if I try to use the new SID enumeration I get "NetUserEnum failed  
with: Not supported"

Below is a level 4 debug output.

cubiq-debian:~/samba/gitsamba/source/lib/netapi/examples/bin# ./ 
user_enum -U admin -p secret 10.168.1.132 -d4
Connecting to 10.168.1.132 at port 445
  session request ok
Doing spnego session setup (blob length=16)
server didn't supply a full spnego negprot
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
   NTLMSSP_NEGOTIATE_UNICODE
   NTLMSSP_REQUEST_TARGET
   NTLMSSP_NEGOTIATE_SIGN
   NTLMSSP_NEGOTIATE_NTLM
   NTLMSSP_NEGOTIATE_ALWAYS_SIGN
   NTLMSSP_CHAL_ACCEPT_RESPONSE
   NTLMSSP_NEGOTIATE_NTLM2
   NTLMSSP_CHAL_TARGET_INFO
   NTLMSSP_NEGOTIATE_128
   NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
   NTLMSSP_NEGOTIATE_UNICODE
   NTLMSSP_REQUEST_TARGET
   NTLMSSP_NEGOTIATE_SIGN
   NTLMSSP_NEGOTIATE_NTLM
   NTLMSSP_NEGOTIATE_ALWAYS_SIGN
   NTLMSSP_NEGOTIATE_NTLM2
   NTLMSSP_NEGOTIATE_128
   NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
   NTLMSSP_NEGOTIATE_UNICODE
   NTLMSSP_REQUEST_TARGET
   NTLMSSP_NEGOTIATE_SIGN
   NTLMSSP_NEGOTIATE_NTLM
   NTLMSSP_NEGOTIATE_ALWAYS_SIGN
   NTLMSSP_NEGOTIATE_NTLM2
   NTLMSSP_NEGOTIATE_128
   NTLMSSP_NEGOTIATE_KEY_EXCH
  session setup ok
  tconx ok
dos_clean_name [(null)]
rpc_pipe_bind: Remote machine 10.168.1.132 pipe \samr fnum 0x4004 bind  
request returned ok.



More information about the samba-technical mailing list