1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

209 Commits

Author SHA1 Message Date
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
0001-01-01 00:00:00 +00:00
Luke Leighton
6b67d6164d using "abstracted" cli_connection, got \PIPE\srvsvc commands up and running
again.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Luke Leighton
2dad9d912d remove use of client_info lsa_info_pol. 0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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$

:-)
0001-01-01 00:00:00 +00:00
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...
0001-01-01 00:00:00 +00:00
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...
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Luke Leighton
7cacf8bd02 service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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!
0001-01-01 00:00:00 +00:00
Luke Leighton
eaac0923e0 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
0001-01-01 00:00:00 +00:00
Luke Leighton
447143be81 oops, freed argc,argv arguments twice. 0001-01-01 00:00:00 +00:00
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00
Luke Leighton
cbbfef6d2a oops!!!! wrong command!!! 0001-01-01 00:00:00 +00:00
Luke Leighton
d5869df371 adding svcctl 0x1b function 0001-01-01 00:00:00 +00:00
Luke Leighton
e88e7d529b shuffling msrpc code around so that it can be used independently of rpcclient 0001-01-01 00:00:00 +00:00
Luke Leighton
ca803c17fa the last one. that concludes the removal of all next_token() calls
from rpcclient/cmd_*.c.
0001-01-01 00:00:00 +00:00
Luke Leighton
3e76ca9b17 another four next_token() removals (using getopt instead) 0001-01-01 00:00:00 +00:00
Luke Leighton
b0f8ef6168 another two. 0001-01-01 00:00:00 +00:00
Luke Leighton
c1ba1bfd68 another one 0001-01-01 00:00:00 +00:00
Luke Leighton
de360d1e90 moved two more commands over to getopt. 0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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);
0001-01-01 00:00:00 +00:00
Luke Leighton
e885027eb7 moving create user function into msrpc_samr.c 0001-01-01 00:00:00 +00:00
Luke Leighton
3ec269b402 doing a code reshuffle. want to add code to establish trust relationships. 0001-01-01 00:00:00 +00:00
Luke Leighton
569babb393 added \PIPE\browser plus experimental brsinfo command. you wouldn't
believe the XXXX that MIGHT be involved in getting nt5rc2 to join
a samba domain...
0001-01-01 00:00:00 +00:00
Luke Leighton
4aea261cb0 responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, the
request name.

modified createuser rpcclient command to examine name being added.  if it
ends in a $, assume that a workstation trust account is being added.
0001-01-01 00:00:00 +00:00
Luke Leighton
c3913f8ae2 added samuserset2 rpcclient command to test ACB_XXX bit-setting on
samr opcode 0x25.  _yet_ another failed attempt to get nt5rc2 to join
a samba domain.  what _is_ it with this stuff, dammit?
0001-01-01 00:00:00 +00:00
Luke Leighton
3df7c903c5 updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*.  now copes with multiple types.
0001-01-01 00:00:00 +00:00
Luke Leighton
98ddeaf442 added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly.  previously they weren't well
understood (well, they were the first of the registry functions i did,
back in december 97, ok??? :-)

set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
0001-01-01 00:00:00 +00:00
Luke Leighton
3273bc068d oops, mistake in parsing command-arguments. repeated calls to
next_token() should not have line to parse as first arg.  oops.
0001-01-01 00:00:00 +00:00
Luke Leighton
3146aa6b60 added rpcclient "enumdomains" command. enumerates names of domains
for which a PDC is responsible.  typical answers are:
<Name of Domain> plus <Builtin>.

against a hierarchical, down-level-compatible NT5 PDC, there's likely to
be more than these two entries!!!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
e6e5caf16c debugging rpcclient spoolenum and spooljobs commands. oh, did i forget
to mention, there's a spooljobs <printer name> command, and it uses
command-line completion?  prints out NT print jobs really nicely, too.
0001-01-01 00:00:00 +00:00
Luke Leighton
ea1d5af105 riccardo sibilia spotted line 1884 has uint32 group_rid[0] not group_rid[1]
oops!
0001-01-01 00:00:00 +00:00
Luke Leighton
e0eb390ab3 const feeding frenzy 0001-01-01 00:00:00 +00:00
Luke Leighton
6d27c5f32d const feeding frenzy 0001-01-01 00:00:00 +00:00
Luke Leighton
6947f8fac7 added command-completion printer enum code. 0001-01-01 00:00:00 +00:00
Luke Leighton
0249ae50ad fixed string function for reading in printer_info_N. 0001-01-01 00:00:00 +00:00
Luke Leighton
135eaa9773 added rpcclient spoolenum command. enumerates printers.
spoolss_r_io_enumprinters doesn't decode strings correctly
as printer_info_1/2 code has only been written to write
structures, not read them.
0001-01-01 00:00:00 +00:00
Luke Leighton
ef7fa58fd3 spoolss openprinterex / closeprinter client-code.
experimental spoolopen <printer name> command added.

jean-francois, f.y.i. i changed the #define for SPOOLSS_OPENPRINTEREX from
op code 0x44 to 0x45.
0001-01-01 00:00:00 +00:00
Luke Leighton
c86edef90e experimental spoolss rpcclient commands 0001-01-01 00:00:00 +00:00
Luke Leighton
f52504c553 samuserset <username> -p password. YESSSSS :)
you have to use "ntlmv1" at the moment (i.e set client ntlmv2 = no).
0001-01-01 00:00:00 +00:00
Luke Leighton
b3f16e6b5a adding experimental set user password command to rpcclient, it returns
error wrong password against nt.  ????
0001-01-01 00:00:00 +00:00
Luke Leighton
3f9455c535 created msrpc_srv_enum_tprt() function by massaging cmd_srv_enum_tprt(). 0001-01-01 00:00:00 +00:00
Luke Leighton
6b919ebb4e dynamic mem allocation in net_srv_transport_enum() parsing. 0001-01-01 00:00:00 +00:00
Luke Leighton
0c700fb609 added samalias <aliasname> rpcclient command (shows info on alias)
added samaliasmem <aliasname> rpcclient command (shows members in alias)

added tab command-completion to SAM alias related commands (inc 2 above).
0001-01-01 00:00:00 +00:00
Luke Leighton
baa789fabc dynamic mem allocation in enum dom groups and enum dom aliases 0001-01-01 00:00:00 +00:00
Luke Leighton
fbeceec501 yet another attempt to get lsaquerysecret working. 0001-01-01 00:00:00 +00:00