~ubuntu-branches/ubuntu/gutsy/wireshark/gutsy-security

« back to all changes in this revision

Viewing changes to epan/dissectors/packet-smb-logon.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2007-04-01 08:58:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070401085840-or3qhrpv8alt1bwg
Tags: 0.99.5-1
* New upstream release.
* debian/patches/09_idl2wrs.dpatch: updated to patch idl2wrs.sh.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Routines for SMB net logon packet dissection
3
3
 * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
4
4
 *
5
 
 * $Id: packet-smb-logon.c 18196 2006-05-21 04:49:01Z sahlberg $
 
5
 * $Id: packet-smb-logon.c 19986 2006-11-26 13:22:14Z jake $
6
6
 *
7
7
 * Wireshark - Network traffic analyzer
8
8
 * By Gerald Combs <gerald@wireshark.org>
36
36
#include "packet-smb-common.h"
37
37
 
38
38
static int proto_smb_logon = -1;
 
39
static int proto_smb_netlogon = -1;
 
40
static int proto_smb_ntlogon = -1;
39
41
static int hf_command = -1;
40
42
static int hf_computer_name = -1;
41
43
static int hf_unicode_computer_name = -1;
 
44
static int hf_unknown_int = -1;
42
45
static int hf_server_name = -1;
43
46
static int hf_user_name = -1;
44
47
static int hf_domain_name = -1;
 
48
static int hf_server_dns_name = -1;
 
49
static int hf_forest_dns_name = -1;
 
50
static int hf_domain_dns_name = -1;
45
51
static int hf_mailslot_name = -1;
46
52
static int hf_pdc_name = -1;
47
53
static int hf_unicode_pdc_name = -1;
75
81
static int hf_large_serial = -1;
76
82
static int hf_nt_date_time = -1;
77
83
 
 
84
static int hf_unknown8 = -1;
 
85
static int hf_unknown32 = -1;
 
86
 
 
87
static int hf_domain_guid = -1;
 
88
static int hf_server_ip = -1;
 
89
 
 
90
static int hf_server_site_name = -1;
 
91
static int hf_client_site_name = -1;
 
92
 
78
93
static int ett_smb_logon = -1;
79
94
static int ett_smb_account_flags = -1;
80
95
static int ett_smb_db_info = -1;
531
546
}
532
547
 
533
548
 
534
 
 
535
549
static int
536
550
dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
537
551
{
705
719
        proto_tree *tree, int offset)
706
720
{
707
721
        /* Netlogon command 0x13 - decode the SAM logon response from server */
 
722
        /* Netlogon command 0x15 - decode the SAM logon response from server unknown user */
708
723
 
709
724
        /* server name */
710
725
        offset = display_unicode_string(tvb, tree, offset, hf_server_name, NULL);
729
744
}
730
745
 
731
746
static int
 
747
dissect_smb_pdc_response_ads(tvbuff_t *tvb, packet_info *pinfo _U_,
 
748
        proto_tree *tree, int offset)
 
749
{
 
750
        /* Netlogon command 0x17 - decode the response from PDC ADS */
 
751
        /* Netlogon command 0x19 - decode the response from PDC ADS USER ?*/
 
752
 
 
753
        /* Align to four-byte boundary */
 
754
        offset = ((offset + 3)/4)*4;
 
755
 
 
756
        /* unknown uint32 type */
 
757
        proto_tree_add_item(tree, hf_unknown32, tvb, offset, 4, TRUE);
 
758
        offset += 4;
 
759
 
 
760
        /* Domain GUID */
 
761
        proto_tree_add_item(tree, hf_domain_guid, tvb, offset, 16, TRUE);
 
762
        offset += 16;
 
763
 
 
764
        /* forest dns name */
 
765
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_forest_dns_name, FALSE, NULL);
 
766
 
 
767
        /* domain dns name */
 
768
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_domain_dns_name, FALSE, NULL);
 
769
 
 
770
        /* server dns name */
 
771
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_server_dns_name, FALSE, NULL);
 
772
 
 
773
        /* domain name */
 
774
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_domain_name, FALSE, NULL);
 
775
 
 
776
        /* server name */
 
777
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_server_name, FALSE, NULL);
 
778
 
 
779
        /* user name */
 
780
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_user_name, FALSE, NULL);
 
781
 
 
782
        /* server_site name */
 
783
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_server_site_name, FALSE, NULL);
 
784
 
 
785
        /* client_site name */
 
786
        offset=dissect_ms_compressed_string(tvb, tree, offset, hf_client_site_name, FALSE, NULL);
 
787
 
 
788
        /* unknown uint8 type */
 
789
        proto_tree_add_item(tree, hf_unknown8, tvb, offset, 1, TRUE);
 
790
        offset += 1;
 
791
 
 
792
        /* unknown uint32 type */
 
793
        proto_tree_add_item(tree, hf_unknown32, tvb, offset, 4, TRUE);
 
794
        offset += 4;
 
795
 
 
796
        /* server ip */
 
797
        proto_tree_add_item(tree, hf_server_ip, tvb, offset, 4, FALSE);
 
798
        offset += 4;
 
799
 
 
800
        /* unknown uint32 type */
 
801
        proto_tree_add_item(tree, hf_unknown32, tvb, offset, 4, TRUE);
 
802
        offset += 4;
 
803
 
 
804
        /* unknown uint32 type */
 
805
        proto_tree_add_item(tree, hf_unknown32, tvb, offset, 4, TRUE);
 
806
        offset += 4;
 
807
 
 
808
        /* NT version */
 
809
        proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, TRUE);
 
810
        offset += 4;
 
811
 
 
812
        /* LMNT token */
 
813
        offset = display_LMNT_token(tvb, offset, tree);
 
814
 
 
815
        /* LM token */
 
816
        offset = display_LM_token(tvb, offset, tree);
 
817
 
 
818
        return offset;
 
819
}
 
820
 
 
821
static int
732
822
dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
733
823
{
734
824
        /* display data as unknown */
819
909
        dissect_smb_sam_logon_req,  /* 0x12 (SAM LOGON request )        */
820
910
        dissect_smb_sam_logon_resp, /* 0x13 (SAM LOGON response)        */
821
911
        dissect_smb_unknown,        /* 0x14 (SAM Response during LOGON Pause) */
822
 
        dissect_smb_unknown,        /* 0x15 (SAM Response User Unknown) */
 
912
        dissect_smb_sam_logon_resp, /* 0x15 (SAM Response User Unknown) */
823
913
        dissect_smb_unknown,        /* 0x16 (SAM Response to Interrogate)*/
824
 
        dissect_smb_unknown,        /* 0x17 (SAM AD response User Unknown*/
 
914
        dissect_smb_pdc_response_ads,        /* 0x17 (SAM AD response User Unknown*/
825
915
        dissect_smb_unknown,        /* 0x18 (Unknown command)           */
826
 
        dissect_smb_unknown         /* 0x19 (SAM LOGON AD response)     */
 
916
        dissect_smb_pdc_response_ads         /* 0x19 (SAM LOGON AD response)    */
827
917
};
828
918
 
829
919
 
890
980
                        { "Server Name", "smb_netlogon.server_name", FT_STRING, BASE_NONE,
891
981
                          NULL, 0, "SMB NETLOGON Server Name", HFILL }},
892
982
 
 
983
                { &hf_server_dns_name,
 
984
                        { "Server DNS Name", "smb_netlogon.server_dns_name", FT_STRING, BASE_NONE,
 
985
                          NULL, 0, "SMB NETLOGON Server DNS Name", HFILL }},
 
986
 
893
987
                { &hf_user_name,
894
988
                        { "User Name", "smb_netlogon.user_name", FT_STRING, BASE_NONE,
895
989
                          NULL, 0, "SMB NETLOGON User Name", HFILL }},
898
992
                        { "Domain Name", "smb_netlogon.domain_name", FT_STRING, BASE_NONE,
899
993
                          NULL, 0, "SMB NETLOGON Domain Name", HFILL }},
900
994
 
 
995
                { &hf_domain_dns_name,
 
996
                        { "Domain DNS Name", "smb_netlogon.domain_dns_name", FT_STRING, BASE_NONE,
 
997
                          NULL, 0, "SMB NETLOGON Domain DNS Name", HFILL }},
 
998
 
 
999
                { &hf_forest_dns_name,
 
1000
                        { "Forest DNS Name", "smb_netlogon.forest_dns_name", FT_STRING, BASE_NONE,
 
1001
                          NULL, 0, "SMB NETLOGON Forest DNS Name", HFILL }},
 
1002
 
901
1003
                { &hf_mailslot_name,
902
1004
                        { "Mailslot Name", "smb_netlogon.mailslot_name", FT_STRING, BASE_NONE,
903
1005
                          NULL, 0, "SMB NETLOGON Mailslot Name", HFILL }},
1027
1129
                { &hf_nt_date_time,
1028
1130
                        { "NT Date/Time", "smb_netlogon.nt_date_time", FT_ABSOLUTE_TIME, BASE_NONE,
1029
1131
                          NULL, 0, "SMB NETLOGON NT Date/Time", HFILL }},
 
1132
 
 
1133
                { &hf_unknown8,
 
1134
                        { "Unknown", "smb_netlogon.unknown", FT_UINT8, BASE_HEX,
 
1135
                          NULL, 0, "Unknown", HFILL }},
 
1136
 
 
1137
                { &hf_unknown32,
 
1138
                        { "Unknown", "smb_netlogon.unknown", FT_UINT32, BASE_HEX,
 
1139
                          NULL, 0, "Unknown", HFILL }},
 
1140
 
 
1141
                { &hf_domain_guid,
 
1142
                        { "Domain GUID", "smb_netlogon.domain.guid", FT_BYTES, BASE_HEX,
 
1143
                           NULL, 0x0, "Domain GUID", HFILL }},
 
1144
 
 
1145
                { &hf_server_ip, {
 
1146
                        "Server IP", "smb_netlogon.server_ip", FT_IPv4, BASE_NONE,
 
1147
                        NULL, 0x0, "Server IP Address", HFILL }},
 
1148
 
 
1149
                { &hf_server_site_name,
 
1150
                        { "Server Site Name", "smb_netlogon.server_site_name", FT_STRING, BASE_NONE,
 
1151
                          NULL, 0, "SMB NETLOGON Server Site Name", HFILL }},
 
1152
 
 
1153
                { &hf_client_site_name,
 
1154
                        { "Client Site Name", "smb_netlogon.client_site_name", FT_STRING, BASE_NONE,
 
1155
                          NULL, 0, "SMB NETLOGON Client Site Name", HFILL }},
1030
1156
        };
1031
1157
 
1032
1158
        static gint *ett[] = {