diff --git a/src/proto-banner1.c b/src/proto-banner1.c index 1bc30d3748d6634971d5765ac2c18644b8e3cdc6..dc2508d18acdd2a25e999cb24a9d636546f3d082 100644 --- a/src/proto-banner1.c +++ b/src/proto-banner1.c @@ -28,6 +28,8 @@ struct Patterns patterns[] = { {"\x00\x00" "**" "\xff" "SMB", 8, PROTO_SMB, SMACK_ANCHOR_BEGIN | SMACK_WILDCARDS}, {"\x00\x00" "**" "\xfe" "SMB", 8, PROTO_SMB, SMACK_ANCHOR_BEGIN | SMACK_WILDCARDS}, + {"\x82\x00\x00\x00", 4, PROTO_SMB, SMACK_ANCHOR_BEGIN}, /* Positive Session Response */ + {"\x83\x00\x00\x01\x80", 5, PROTO_SMB, SMACK_ANCHOR_BEGIN}, /* Not listening on called name */ {"\x83\x00\x00\x01\x81", 5, PROTO_SMB, SMACK_ANCHOR_BEGIN}, /* Not listening for calling name */ {"\x83\x00\x00\x01\x82", 5, PROTO_SMB, SMACK_ANCHOR_BEGIN}, /* Called name not present */ diff --git a/src/proto-smb.c b/src/proto-smb.c index 7e912009a4fb59a4e31d0e29be4265588c217da2..2e8b68628f0ea7df160180235f4913af9032968b 100644 --- a/src/proto-smb.c +++ b/src/proto-smb.c @@ -92,6 +92,20 @@ struct SmbParams params[] = { #define memberat(t, s, offset) (t*)((char*)(s)+(offset)) +static const char +smb1_hello_template[] = { + 0x00, 0x00, 0x00, 0x45, 0xff, 0x53, 0x4d, 0x42, + 0x72, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0xc8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x22, 0x00, 0x02, + 0x4e, 0x54, 0x20, 0x4c, 0x4d, 0x20, 0x30, 0x2e, + 0x31, 0x32, 0x00, 0x02, 0x53, 0x4d, 0x42, 0x20, + 0x32, 0x2e, 0x30, 0x30, 0x32, 0x00, 0x02, 0x53, + 0x4d, 0x42, 0x20, 0x32, 0x2e, 0x3f, 0x3f, 0x3f, + 0x00 + +}; static char smb1_null_session_setup[] = { 0x00, 0x00, 0x00, 0x7e, 0xff, 0x53, 0x4d, 0x42, @@ -1648,6 +1662,9 @@ smb_parse_record( state = NBT_UNKNOWN; break; case 0x82: + tcp_transmit(more, smb1_hello_template, sizeof(smb1_hello_template), 0); + state = NBT_DRAIN; + break; case 0x85: state = NBT_DRAIN; break; @@ -1705,6 +1722,12 @@ smb_parse_record( break; case NBT_DRAIN: + if (smb->nbt_length == 0) { + state = 0; + i--; + } else + smb->nbt_length--; + break; case NBT_UNKNOWN: default: break; @@ -1770,7 +1793,7 @@ smb0_hello_template[] = { 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, 0x41, 0x00, - 0x00, 0x00, 0x00, 0x45, 0xff, 0x53, 0x4d, 0x42, + /*0x00, 0x00, 0x00, 0x45, 0xff, 0x53, 0x4d, 0x42, 0x72, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, @@ -1779,7 +1802,7 @@ smb0_hello_template[] = { 0x31, 0x32, 0x00, 0x02, 0x53, 0x4d, 0x42, 0x20, 0x32, 0x2e, 0x30, 0x30, 0x32, 0x00, 0x02, 0x53, 0x4d, 0x42, 0x20, 0x32, 0x2e, 0x3f, 0x3f, 0x3f, - 0x00 + 0x00*/ }; static const char smb1x_hello_template[] = { @@ -1806,20 +1829,6 @@ xsmb1_hello_template[] = { 0x00 }; -static const char -smb1_hello_template[] = { - 0x00, 0x00, 0x00, 0x45, 0xff, 0x53, 0x4d, 0x42, - 0x72, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0xc8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x22, 0x00, 0x02, - 0x4e, 0x54, 0x20, 0x4c, 0x4d, 0x20, 0x30, 0x2e, - 0x31, 0x32, 0x00, 0x02, 0x53, 0x4d, 0x42, 0x20, - 0x32, 0x2e, 0x30, 0x30, 0x32, 0x00, 0x02, 0x53, - 0x4d, 0x42, 0x20, 0x32, 0x2e, 0x3f, 0x3f, 0x3f, - 0x00 - -}; static const unsigned char smb2_negot_response[] = { diff --git a/src/proto-x509.c b/src/proto-x509.c index 795f075e8a47ccd18090b78879e4cce5d1e42340..6d991dbc911f08a58d2b602ac1d9f2f313a355c1 100644 --- a/src/proto-x509.c +++ b/src/proto-x509.c @@ -1357,7 +1357,6 @@ spnego_decode(struct SpnegoDecode *spnego, * ready to parse the 'value'. Push the current state on the * stack, then decend into the child field. */ - printf("\n%u\n", x->u.tag.remaining); ASN1_push(x, x->brother_state, x->u.tag.remaining); state = x->child_state; memset(&x->u, 0, sizeof(x->u));