diff --git a/src/proto-banout.c b/src/proto-banout.c index 60555c754f5c0bdcf759f4a393c2e0a9f8814618..b48e22e81e205402e1adad816462f8c30943c50d 100644 --- a/src/proto-banout.c +++ b/src/proto-banout.c @@ -203,36 +203,27 @@ banout_append_unicode(struct BannerOutput *banout, unsigned proto, unsigned c) if (c & ~0xFFFF) { unsigned c2; c2 = 0xF0 | ((c>>18)&0x03); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); c2 = 0x80 | ((c>>12)&0x3F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); c2 = 0x80 | ((c>> 6)&0x3F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); c2 = 0x80 | ((c>> 0)&0x3F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); } else if (c & ~0x7FF) { unsigned c2; c2 = 0xE0 | ((c>>12)&0x0F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); c2 = 0x80 | ((c>> 6)&0x3F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); c2 = 0x80 | ((c>> 0)&0x3F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); } else if (c & ~0x7f) { unsigned c2; c2 = 0xc0 | ((c>> 6)&0x1F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); c2 = 0x80 | ((c>> 0)&0x3F); - banout_append(banout, proto, "\\x", 2); - banout_append_hexint(banout, proto, c2, 2); + banout_append_char(banout, proto, c2); } else banout_append_char(banout, proto, c); } diff --git a/src/proto-ntlmssp.c b/src/proto-ntlmssp.c index 250b16d8900d5dbaa459f899f9cb7e1150c96901..e364d4e4da24e96dc9f7046667f4e01deac88d59 100644 --- a/src/proto-ntlmssp.c +++ b/src/proto-ntlmssp.c @@ -174,6 +174,7 @@ ntlmssp_decode(struct NtlmsspDecode *x, px[50] | px[51]<<8, px[55] ); + banout_append(banout, PROTO_SMB, buf, AUTO_LEN); } /* Parse all the fields */ diff --git a/src/proto-smb.c b/src/proto-smb.c index 5b030e5ed45860d6c1d00d785895bb3deba0bfd9..7e912009a4fb59a4e31d0e29be4265588c217da2 100644 --- a/src/proto-smb.c +++ b/src/proto-smb.c @@ -200,7 +200,6 @@ smb_params_parse(struct SMBSTUFF *smb, const unsigned char *px, size_t offset, s if (max > offset + (smb->hdr.smb1.param_length - smb->hdr.smb1.param_offset)) max = offset + (smb->hdr.smb1.param_length - smb->hdr.smb1.param_offset); - //printf("\n max=%04x \n", *(unsigned short*)(px+max)); /* Find the correct header */ for (c=0; params[c].command != smb->hdr.smb1.command && params[c].command != 0xFF; c++) @@ -419,7 +418,7 @@ smb1_parse_setup1(struct SMBSTUFF *smb, const unsigned char *px, size_t offset, max = offset + (smb->hdr.smb1.byte_count - smb->hdr.smb1.byte_offset); for (;offset<max; offset++) { - //printf("\\x%02x", px[offset]); + switch (state) { case D_PADDING: if (smb->hdr.smb1.flags2 & 0x8000) { @@ -596,11 +595,11 @@ smb1_parse_setup2(struct SMBSTUFF *smb, const unsigned char *px, size_t offset, max = offset + (smb->hdr.smb1.byte_count - smb->hdr.smb1.byte_offset); for (;offset<max; offset++) { - //printf("\\x%02x", px[offset]); + switch (state) { case D_BLOB: if (smb->parms.setup.BlobOffset == 0) { - spnego_decode_init(&smb->spnego, smb->hdr.smb2.blob_length); + spnego_decode_init(&smb->spnego, smb->parms.setup.BlobLength); } { size_t new_max = max; @@ -619,7 +618,7 @@ smb1_parse_setup2(struct SMBSTUFF *smb, const unsigned char *px, size_t offset, case D_PADDING: /* If the blog length is odd, then there is no padding. Otherwise, * there is one byte of padding */ - if (smb->parms.setup.BlobLength & 1) + //if (smb->parms.setup.BlobLength & 1) offset--; state = D_PADDING2; break; @@ -629,6 +628,7 @@ smb1_parse_setup2(struct SMBSTUFF *smb, const unsigned char *px, size_t offset, } else { state = D_OSA1; } + offset--; break; case D_OSA1: if (px[offset] == 0) diff --git a/src/proto-x509.c b/src/proto-x509.c index 6d991dbc911f08a58d2b602ac1d9f2f313a355c1..795f075e8a47ccd18090b78879e4cce5d1e42340 100644 --- a/src/proto-x509.c +++ b/src/proto-x509.c @@ -1357,6 +1357,7 @@ 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));