forked from WestpointLtd/tls_prober
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prober_utils.py
43 lines (34 loc) · 1.56 KB
/
prober_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/python
from tls import *
DEFAULT_CIPHERS = [TLS_RSA_WITH_RC4_128_MD5,
TLS_RSA_WITH_RC4_128_SHA,
TLS_RSA_WITH_3DES_EDE_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_256_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA256]
# TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
# TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
# TLS_DH_RSA_WITH_AES_128_CBC_SHA,
# TLS_ECDH_RSA_WITH_RC4_128_SHA,
# TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
# TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
# TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
# TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
# TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
# TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256]
def make_hello():
hello = ClientHelloMessage.create(TLSRecord.TLS1_0,
'01234567890123456789012345678901',
DEFAULT_CIPHERS)
record = TLSRecord.create(content_type=TLSRecord.Handshake,
version=TLSRecord.TLS1_0,
message=hello.bytes)
#hexdump(record.bytes)
return record.bytes
def make_ccs():
ccs = '\1'
record = TLSRecord.create(content_type=TLSRecord.ChangeCipherSpec,
version=TLSRecord.TLS1_0,
message=ccs)
return record.bytes