1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-19 10:03:58 +03:00

3094 Commits

Author SHA1 Message Date
Luke Leighton
4c3556fae7 this one's a handle-based one (missed in the first round). -
Luke Leighton
e4e5743a40 removed do_ prefix from srvsvc API -
Luke Leighton
3204829225 updated \PIPE\wkssvc commands to use new abstracted connection system.
modified resolve_srv_name() to return dest host of *SMBSERVER if
server name is \\ip.add.ress.format
-
Luke Leighton
6b67d6164d using "abstracted" cli_connection, got \PIPE\srvsvc commands up and running
again.
-
Luke Leighton
4fd4aeb574 modified cli_connect_serverlist to take server list of format
\\server_name \\other_server etc.
-
Luke Leighton
a1ff7e8fc3 further abstraction involving client states. main client-side code
is pretty much independent of SMB client states, which will make it
easier to add other transports.
-
Luke Leighton
2dad9d912d remove use of client_info lsa_info_pol. -
Luke Leighton
4e029d50fc enhanced samuser command to do same thing as enumusers command (-g -u -a)
except with only one user.  done by sharing same code.
-
Luke Leighton
c049865782 bug-fixing registry commands and the rpcclient "rpcclient" command.
the rpcclient "rpcclient" command allows user options to be reset
(e.g the username / password) _without_ terminating rpcclient.
try this:

rpcclient -S srv1 -U% -l log
srv1$ rpcclient -S srv2
srv2$

:-)
-
Luke Leighton
29c480085e whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.
found out that getopt() _must_ have optind set to 0 before reuse.

still haven't decided what to do with the net* api yet...
-
Luke Leighton
cda2577881 this file manages client states associated with handles. -
Luke Leighton
c1ea396de2 previous commit added an abstraction function that didn't even have
struct cli_state, uint16 fnum into the code: rpc_hnd_api_req().
modified cli_lsarpc.c to use this.  the rest is const issues.
-
Luke Leighton
8ce93b80d3 cool! completed a samr* API that _would_ look like an msdn samr* api...
if microsoft bothered to publish it.  actually, there are good reasons
for not publishing it: people might write programs for it, and then
those programs wouldn't work on nt5, for example...
-
Luke Leighton
45e92258e7 registry API moved over to new format. reg_connect() is the top-level
function, which takes \\server_name.

tested a _few_ functions.  found that regcreatekey receives a Fault PDU.
-
Luke Leighton
7cacf8bd02 service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
-
Luke Leighton
57bff6fe82 ok. *whew*. this is the first completed part of the restructure.
verified that lsaquery, lsalookupsids work, and found some bugs in the
parameters of these commands :-)

soo... we now have an lsa_* api that has the same arguments as the nt
Lsa* api!  cool!

the only significant coding difference is the introduction of a
user_credentials structure, containing user, domain, pass and ntlmssp
flags.
-
Luke Leighton
c01b18e632 first stages of removing struct cli_state* and uint16 fnum from all
msrpc client code.  the intent is to hide / abstract / associate
connection info behind policy handles.

this makes the msrpc functions look more and more like their nt equivalents.

who-hou!
-
Luke Leighton
c26e8a6ac5 WARNING! MOVED rpc_server/srv_lsa_hnd.c TO lib/util_hnd.c
CVS UPDATE MAY ISSUE WARNING ABOUT lib/util_hnd.c MODIFICATION
DATE BEING IN THE FUTURE.  CVS CHECKOUT A NEW REPOSITORY MAY BE
SAFER.
-
Luke Leighton
eaac0923e0 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
-
Luke Leighton
447143be81 oops, freed argc,argv arguments twice. -
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
-
Luke Leighton
cbbfef6d2a oops!!!! wrong command!!! -
Luke Leighton
d5869df371 adding svcctl 0x1b function -
Luke Leighton
e88e7d529b shuffling msrpc code around so that it can be used independently of rpcclient -
Luke Leighton
ca803c17fa the last one. that concludes the removal of all next_token() calls
from rpcclient/cmd_*.c.
-
Luke Leighton
3e76ca9b17 another four next_token() removals (using getopt instead) -
Luke Leighton
b0f8ef6168 another two. -
Luke Leighton
c1ba1bfd68 another one -
Luke Leighton
de360d1e90 moved two more commands over to getopt. -
Luke Leighton
9a1efa03c8 okay :) all cmd_() functions now take int argc, char **argv :) that
means that some commands need more work, as they still use next_token(),
the use of which i wish to avoid.

plus, i was getting fed up of the poor command-line processing in some
of these commands.  i'm starting to need getopt() in them, especially
in samsetuser.

WARNING: only cmd_samr has been modded to use getopt() so far!  reg
commands won't work, esp.
-
Luke Leighton
1092b4f6fb implement server-side generation of NTLMv2 session key. YESSS :-) -
Luke Leighton
ab174759cd you know what? this sort of thing makes me laugh. hmm, what functions
have we got.  and what data do we have.  hmm.. i wonder what the NTLMv2
user session key can be... hmmm... weell.... there's some hidden data
here, generated from the user password that doesn't go over-the-wire,
so that's _got_ to be involved.  and... that bit of data took a lot of
computation to produce, so it's probably _also_ involved... and md4 no, md5?
no, how about hmac_md5 yes let's try that one (the other's didn't work)
oh goodie, it worked!

i love it when this sort of thing happens.  took all of fifteen minutes to
guess it.  tried concatenating client and server challenges.  tried
concatenating _random_ bits of client and server challenges.  tried
md5 of the above.  tried hmac_md5 of the above.  eventually, it boils down
to this:

kr = MD4(NT#,username,domainname)
hmacntchal=hmac_md5(kr, nt server challenge)
sess_key = hmac_md5(kr, hmacntchal);
-
Luke Leighton
be6a6b1393 hmmm... have to add client-side support in domain_client_validate() to
_use_ user session key.
-
Luke Leighton
c73f6b0d02 adding user session key into network netlogon response. -
Luke Leighton
e885027eb7 moving create user function into msrpc_samr.c -
Luke Leighton
98c42764fb oops, #ifdef'd cli_shutdown out, as the fun has _already_ started:
NT refuses to play nice, and establish a trust relationship.
-
Luke Leighton
99ec0620c3 attempting to establish inter-domain trust relationships. modified
smbpasswd so it can be used to set up inter-domain trust account.
-
Luke Leighton
97ec74e1fa modified domain_client_validate to take trust account name / type. this
is to pass DOMAIN_NAME$ and SEC_CHAN_DOMAIN instead of WKSTA_NAME$ and
SEC_CHAN_WKSTA.

modified check_domain_security to determine if domain name is own domain,
and to use wksta trust account if so, otherwise check "trusting domains"
parameter and use inter-domain trust account if so, otherwise return
False.
-
Luke Leighton
3ec269b402 doing a code reshuffle. want to add code to establish trust relationships. -
Luke Leighton
a51f62f4cf dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.
-
Luke Leighton
f973195b5c adding bits about SAM database security, and what the SAM commands are
actually for.
-
Luke Leighton
b31de16407 explicit reference to tell people that rpcclient doesn't work with
Windows 95.  i can just imagine some people saying "it dunna wurk on
my box at home", and me having to reply, "i dunna care".
-
Luke Leighton
28a63ac24d yodl update -
Luke Leighton
d8d1daff6f oops. -
Luke Leighton
3a6900ad7b adding some command descriptions behind the rpcclient commands. -
Luke Leighton
9eef1817f8 yodl update - rpcclient -
Luke Leighton
a46b33079f added an rpcclient man page. wow! -
Luke Leighton
9795e5948c nt5rc2 falling over because the LsaQueryInfoPolicy() response _must_
have the string max length = string length + 1.

if not, then it gets its knickers in a twist over whether the string
is NULL-terminated or not.

four days.

four days i spent on this one.
-
Luke Leighton
172601b84a The First Necessary UNICODE String Support.
the random workstation trust account password is TOTAL garbage.  i mean,
complete garbage.  it's nowhere CLOSE to being a UNICODE string.  therefore
we can't just take every second character.

created nt_owf_genW() which creates NT#(password) instead of NT#(Unicode(pw)).
followed through to the password setting in srv_samr.c
-
Luke Leighton
3152bde7d8 - surprise! the number of UNICODE strings that didn't have alignment
after them is incredible.  how did we get away with this for so long?
-