Commit Graph

355 Commits

Author SHA1 Message Date
Tim Potter 59e1cb5d57 Add more entries to the query/set path/file info value_strings for
some extra info levels discovered by tridge.

Put subcommand information in COL_INFO for trans2 query fs/path/file
info.

svn path=/trunk/; revision=8011
2003-07-10 04:44:58 +00:00
Ronnie Sahlberg fc70d21834 The MID field in the SMB header is in reality only ~10 bits in size
so it is pretty common for MID values to be reused even in
moderately sized captures.

The test to compare that the command type between the request
and reply is not sufficient for when most of the commands between the client
and the server are the same (e.g. streaming Read/Write)

Change the matching so that ONLY the first "response" we see for a certain
open MID will be matched to the original request.

I.e.  Prevent
Read Request
Read Reply
[missing from capture] Read Request
Read Reply

From incorrectly matching the second reply (if it has a reused MID) with the
first request.

This makes the response time statistics a bit more reliable as well.

svn path=/trunk/; revision=7888
2003-06-15 00:35:49 +00:00
Guy Harris ee97ce3196 Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
	arguments, allocates a buffer big enough to hold a string with
	the specified number of bytes plus an added null terminator
	(i.e., length+1), copies the specified number of bytes from the
	tvbuff, at the specified offset, to that buffer and puts in a
	null terminator, and returns a pointer to that buffer (or throws
	an exception before allocating the buffer if that many bytes
	aren't available in the tvbuff);

	tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
	a "gint" as arguments, gets the size of the null-terminated
	string starting at the specified offset in the tvbuff (throwing
	an exception if the null terminator isn't found), allocates a
	buffer big enough to hold that string, copies the string to that
	buffer, and returns a pointer to that buffer and stores the
	length of the string (including the terminating null) in the
	variable pointed to by the "gint" pointer.

Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).

Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string).  Use "tvb_get_stringz()", instead.

In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.

svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
Guy Harris a048cbebed Show the upper 2 bytes of the formerly-reserved area as a "High Part of
PID" even for SMB-over-IPX.

svn path=/trunk/; revision=7823
2003-06-10 05:28:02 +00:00
Guy Harris 9166bdd968 Put the right data into the protocol tree for the high 16 bits of the PID.
svn path=/trunk/; revision=7819
2003-06-09 22:59:11 +00:00
Richard Sharpe 21f9f7ec48 Dissect the 12-byte reserved field as a 2-byte PID high, 8-byte sig, and
2-byte reserved field.

svn path=/trunk/; revision=7812
2003-06-09 03:01:02 +00:00
Guy Harris 99f861be11 Update the section numbers in various information level strings to
reflect the 1.0 version of the CIFS spec.  Similarly update function
names containing section numbers.

Change the strings for query file levels 0x0200 and 0x0201 to say
"Query" rather than "Set" (we now have separate tables for "query" and
"set" information levels, as some of them differ), and get rid of the
string for 0x0202, as that's documented in the CIFS spec only as a "set"
level.

svn path=/trunk/; revision=7810
2003-06-09 00:02:13 +00:00
Guy Harris 84e74c735d The information levels for TRANS2_SET_{PATH,FILE}_INFORMATION are,
according to the SNIA CIFS 1.0 spec and some captures I've seen, are not
the same as for the corresponding TRANS2_GET_{PATH,FILE}_INFORMATION.
Handle the SET information levels as per the CIFS spec.

svn path=/trunk/; revision=7806
2003-06-08 09:11:04 +00:00
Tim Potter 13994411a9 Rename EA length field to EA list length. Field was originally just
list length before my previous commit.

svn path=/trunk/; revision=7797
2003-06-06 02:09:35 +00:00
Tim Potter ab7c3c1195 Dissect extended attribute lists in trans2 QUERY_FILE_INFORMATION,
info level 4.

svn path=/trunk/; revision=7796
2003-06-06 02:05:38 +00:00
Guy Harris 53c2e25a9f There can be more than one DCE RPC call per frame, e.g. there can be
multiple NetBIOS-over-TCP session service messages in a TCP segment, and
they can contain the final portions of different DCERPC calls.  Don't
assume a frame number is sufficient to identify DCE RPC calls.

svn path=/trunk/; revision=7777
2003-06-04 05:41:37 +00:00
Guy Harris 2573a5527a From Laurent Rabret: use "g_free()", not "free()", to free stuff
allocated with "g_malloc()" and related GLib routines.

svn path=/trunk/; revision=7758
2003-05-28 22:40:19 +00:00
Tim Potter c2036f97f1 Initialise sid_str in case dissect_nt_sid() can't return a string
representation for the sid.

svn path=/trunk/; revision=7719
2003-05-23 01:45:27 +00:00
Ronnie Sahlberg 5feaba4955 make dissect_nt_sid() return a sid string that also contains the proper name for the sid.
this prettifies some dcerpc interfaces

svn path=/trunk/; revision=7712
2003-05-22 11:32:06 +00:00
Ronnie Sahlberg 14f5d761c1 Change the interface to dissect_nt_sid so that we can provide a hf field to use
to describe the sid instead of the default smb.sid one

svn path=/trunk/; revision=7708
2003-05-21 10:16:10 +00:00
Ronnie Sahlberg be8c81fc84 Tap SMB packets before we call the dissecotrs so that even if there
is an exception (i.e. short packet) the tap listener will still
be alled.

svn path=/trunk/; revision=7684
2003-05-16 10:24:13 +00:00
Tim Potter cabe2eebf8 More work on dissecting generic and standard mappings for NT access masks.
svn path=/trunk/; revision=7668
2003-05-15 02:14:00 +00:00
Tim Potter 2b39831b5b Move the ntlmv2 response dissection out of packet-ntlmssp.c and in to
packet-smb-common.c so it can be used elsewhere.

Dissect a ntlmv2 response in a session setup SMB if detected.

svn path=/trunk/; revision=7655
2003-05-09 01:41:28 +00:00
Guy Harris 1025817e84 Add a "proto_item_set_end()" routine that sets the length of an item
given a tvbuff/offset pair referring to the byte past the end of the
item.  Use it in one place in the SMB dissector (there are plenty of
other places where it could be used as well).

svn path=/trunk/; revision=7603
2003-04-29 21:27:19 +00:00
Ronnie Sahlberg be831f9845 dissect_nt_access_mask() sometimes ami is NULL.
check that it is non-NULL before we dereference it.

svn path=/trunk/; revision=7592
2003-04-28 10:42:14 +00:00
Tim Potter e3dabb27e2 Move the specific rights dissection function and name into a structure
instead of passing them around as separate parameters.  This is a
prelude to adding generic and standard mapping to the access mask
dissection.

svn path=/trunk/; revision=7591
2003-04-28 04:44:54 +00:00
Guy Harris 4915f5e6a2 Note some weirdness seen in some captures, where the direction flag in
the SMB isn't set on replies.

svn path=/trunk/; revision=7588
2003-04-27 23:52:11 +00:00
Guy Harris e875c3330f From Jim McDonough: fix smb transact2 findfirst decoding of info level
2's (including EA sizes, requested by os2 clients).

svn path=/trunk/; revision=7547
2003-04-24 09:04:31 +00:00
Guy Harris d359286841 Add a pointer to an hf_ value for a "reassembled_in" field (which can be
null) to the "fragment_items" structure, and don't pass that value into
"process_reassembled_data()", just have it use the value in the
"fragment_items" structure passed to it.

Make "process_reassembled_data()" capable of handling reassembly done by
"fragment_add_seq_check()", and use it in the ATP and 802.11 dissectors;
give them "reassembled_in" fields.  Make "process_reassembled_data()"
handle only the case of a completed reassembly (fd_head != NULL) so that
we can use it in those dissectors without gunking the code up too much.

svn path=/trunk/; revision=7513
2003-04-20 11:36:16 +00:00
Richard Sharpe 15a665d461 Add some comments about the 0x10 bit in the Flags field of an NTcreate&X.
svn path=/trunk/; revision=7493
2003-04-18 18:07:50 +00:00
Guy Harris 197b9b228b Add a heuristic dissector table to Vines SPP, use it for dissecting SPP
data packets, and register the SMB dissector with it.

Dissect the Control field of SPP packets.

svn path=/trunk/; revision=7480
2003-04-17 20:30:43 +00:00
Guy Harris 8c06187052 Update a URL, and note that the Open Group publications are now
available for free download.

svn path=/trunk/; revision=7476
2003-04-17 07:55:42 +00:00
Guy Harris 9dcf00fe5c Support SMB as one of the protocols that can run over OSI COTP.
svn path=/trunk/; revision=7474
2003-04-17 00:13:26 +00:00
Guy Harris 579ab38577 Add a new routine "dissect_file_data_maybe_dcerpc()" to handle file
read/write data that might, or might not, be DCE RPC information on a
pipe, and use that routine rather than duplicating similar code in
multiple places.

svn path=/trunk/; revision=7455
2003-04-14 17:38:49 +00:00
Guy Harris 82ff4f49a5 Fix up some comments.
svn path=/trunk/; revision=7454
2003-04-14 17:31:42 +00:00
Ronnie Sahlberg 176c885a3d The two extra bytes in the write_andx request is only present if both
the MEssageStart and the Raw bits are set.

svn path=/trunk/; revision=7452
2003-04-14 10:58:21 +00:00
Guy Harris 46416f7b7e Use symbolic names for the various write mode bits.
To test whether a single bit is set, just do "if (mode&bit)", not
"if ((mode&bit)==bit)".

In the places where read and write data is processed, have both a
comment indicating that it's file data and that you can transport DCERPC
over SMB just with reads and writes, to indicate why we may call the
DCERPC-over-a-pipe dissector.

svn path=/trunk/; revision=7450
2003-04-14 00:27:00 +00:00
Guy Harris f2b07ad411 "dcerpc_fragment_table" is used only in packet-smb-pipe.c, except for
the call to initialize it; move the call to initialize it to the
registration routine for the dissector that uses it, move the definition
of ""dcerpc_fragment_table" to packet-smb-pipe.c, make it static, and
remove the declaration of it from smb.h.

Add some casts to squelch compiler complaints.

svn path=/trunk/; revision=7449
2003-04-13 23:58:37 +00:00
Ronnie Sahlberg f469559385 Rewrite the DCERPC over SMB reassembly completely.
Move the actual reassembly to packet-smb-pipe.c instead of having it inside
the packet-smb.b/Write_andX and ReadAndX dissectors.

Change the dissector to only call dcerpc dissector from the packet where
reassembly was completed instead of always from the first fragment.
Add display fiulter field for the other fragments that display which frame the dcerpc pdu was reassembled in.

This is needed in order to be able to reassemble the type of dcerpc fragments
that are sent between nt4 dc's.
The DCERPC fragment reassembly in the dcerpc layer is still broken though, and
i think it has been broken for quite some time.   That will be addressed shortly.

svn path=/trunk/; revision=7445
2003-04-12 08:14:02 +00:00
Ronnie Sahlberg 1294318b4d The NT Security Descriptor revision field is only one byte, not two.
Make the dissector decode the first two bytes of the security descriptor as
one byte for the revision and the second byte as nothing/should be zero.

svn path=/trunk/; revision=7436
2003-04-10 08:41:58 +00:00
Guy Harris 4727ca154d Squelch a compiler warning - the problem "should not happen", as a
WriteAndX request should have a full complement of word parameters, but,
just in cast it doesn't....

(Should we somehow arrange to throw an exception if there aren't enough
word or byte parameters in SMBs, i.e. impose a minimum in some cases?)

svn path=/trunk/; revision=7430
2003-04-09 18:35:27 +00:00
Ronnie Sahlberg d1b5e90a50 Update to WriteAndX request decoding so it can handle the pipe bits properly.
If both mode bits  MessageStart and WriteRaw are set, then the first two bytes of the byte-field is the total length of the data written to the pipe.

svn path=/trunk/; revision=7428
2003-04-09 09:35:57 +00:00
Guy Harris be0dfb63e0 Add some additional fields to SMB-over-IPX dissection, as per what
NetMon 2.x does.

svn path=/trunk/; revision=7403
2003-04-03 22:58:54 +00:00
Guy Harris 61a448bb25 Add support for SMB-over-IPX.
svn path=/trunk/; revision=7402
2003-04-03 09:12:46 +00:00
Tim Potter 795926735d When dissecting specific rights, pass a name string down so the
proto item says "foo specific rights" instead of just "specific
rights".

svn path=/trunk/; revision=7401
2003-04-03 05:43:59 +00:00
Ronnie Sahlberg cec5c81ac3 Added SMB option : sid_name_snooping.
This feature, when enabled through Edit/preferences/protocols/smb,
will look at certain SMB and CIFS related protocols to discover the
mapping between SIDs and their Names.

For those SIDs whose name has been snooped/discovered ethereal will
also add "(<name>)" to the end of the SID when printed in the tree pane
through the function dissect_nt_sid().

Currently the feature is not too exciting since the only thing that packet-smb-sidsnooping.c will look at to build this mapping table is
replies to the LSA/QueryInfoPolicy infolevel 3  packets and thus
discover mappings between a Domain SID and a Domain Name.
In the near future this future will be enhanced to also look at more interesting calls such as LSA/LookupSIDs2 and similar.

svn path=/trunk/; revision=7362
2003-03-25 09:41:42 +00:00
Ronnie Sahlberg 3cde372091 Turn SIDs into FT_STRING fields so that we can filter for them using
display filters.

svn path=/trunk/; revision=7355
2003-03-17 09:02:49 +00:00
Ronnie Sahlberg a86693c355 Rename hf_smb_sid to the more appropriate hf_smb_search_id
since we will need hf_smb_sid for the SID string later

svn path=/trunk/; revision=7354
2003-03-17 08:28:56 +00:00
Richard Sharpe daea30c214 Make sure that we display all the file attributes ...
svn path=/trunk/; revision=7352
2003-03-14 00:46:54 +00:00
Richard Sharpe 043ef892af Make sure we don't obliterate the UNICODE flag ...
svn path=/trunk/; revision=7278
2003-03-04 23:09:59 +00:00
Tim Potter 41b5162c2c Added 'server unavailable' dos error message.
svn path=/trunk/; revision=7192
2003-02-25 02:00:33 +00:00
Guy Harris e6b5a93461 Properly set the ACE type in the summary line for an ACE - and, while
we're at it, avoid going past the end of a packet.  Put the ACE type's
hex value into that line if it's an unknown type.

svn path=/trunk/; revision=7144
2003-02-14 04:54:47 +00:00
Tim Potter 6f4661637a Decorate ACE items in an ACL with the SID and flag values.
svn path=/trunk/; revision=7122
2003-02-11 04:33:24 +00:00
Guy Harris dae6dd9bcf Update some comments.
svn path=/trunk/; revision=7112
2003-02-10 02:38:24 +00:00
Guy Harris fcea88589c At least in regular SMB requests, the access mask in an ACE is not
guaranteed to be aligned on a 4-byte boundary, so, if we're not
dissecting an ACE from a DCE RPC request or reply, don't use
"dissect_ndr_uint32()" to extract the access mask.  (Is it guaranteed to
be so aligned even if the ACE is part of a DCE RPC message?  Or are ACLs
just opaque blobs from the point of view of DCE RPC?)

Use "%u", not "%d", to print unsigned quantities.

svn path=/trunk/; revision=7106
2003-02-08 08:55:13 +00:00