From aeb017ad6115be394ba52c45d89356f1924c199b Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 16 Aug 2016 13:47:17 +0200 Subject: [PATCH] add probes with session ticket extension from RFC 4507 --- prober.py | 8 +++++++- probes.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/prober.py b/prober.py index 111d0c4..98ab309 100755 --- a/prober.py +++ b/prober.py @@ -302,7 +302,13 @@ CachedInfoNull12PFS(), CachedInfoOverflow(), CachedInfoOverflow12(), - CachedInfoOverflow12PFS() + CachedInfoOverflow12PFS(), + SessionTicketNull(), + SessionTicketNull12(), + SessionTicketNull12PFS(), + SessionTicketOverflow(), + SessionTicketOverflow12(), + SessionTicketOverflow12PFS(), ] def probe(ipaddress, port, starttls, specified_probe): diff --git a/probes.py b/probes.py index 8808ac0..384be65 100644 --- a/probes.py +++ b/probes.py @@ -2695,3 +2695,48 @@ class CachedInfoOverflow12(CachedInfoOverflow, NormalHandshake12): class CachedInfoOverflow12PFS(CachedInfoOverflow, NormalHandshake12PFS): '''Send cached info extension with invalid size in PFS TLSv1.2 hello''' pass + + +class SessionTicketNull(NormalHandshake): + '''Send empty session ticket extension in hello''' + + def make_session_ticket_hello(self, value): + session_ticket_ext = Extension.create( + extension_type=35, + data=value) + return self.make_hello([session_ticket_ext]) + + def test(self, sock): + logging.debug('Sending Client Hello...') + # first two bytes of the extension are the length, don't include any + sock.write(self.make_session_ticket_hello(b'')) + + +class SessionTicketNull12(SessionTicketNull, NormalHandshake12): + '''Send empty session ticket extension in TLSv1.2 hello''' + pass + + +class SessionTicketNull12PFS(SessionTicketNull, NormalHandshake12PFS): + '''Send empty session ticket extension in PFS TLSv1.2 hello''' + pass + + +class SessionTicketOverflow(SessionTicketNull): + '''Send session ticket extension with too large length in hello''' + + def test(self, sock): + logging.debug('Sending Client Hello...') + # first two bytes are the length, send too large one + sock.write(self.make_session_ticket_hello(b'\x02\x00' + + b'\xe7' * 0xff)) + + +class SessionTicketOverflow12(SessionTicketOverflow, NormalHandshake12): + '''Send session ticket extension with too large length in TLSv1.2 hello''' + pass + + +class SessionTicketOverflow12PFS(SessionTicketOverflow, NormalHandshake12PFS): + '''Send session ticket ext with too large length in PFS TLSv1.2 hello''' + pass