Skip to content

Commit 858b144

Browse files
committed
Version: 1.2.0 -> add ssl key logging feature
1 parent 38a240a commit 858b144

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# <img src="https://github.com/nxenon/h2spacex/assets/61124903/fd6387bf-15e8-4a5d-816b-cf5e079e07cc" width="20%" valign="middle" alt="H2SpaceX" />&nbsp;&nbsp; H2SpaceX
22

3-
[![pypi: 1.1.2](https://img.shields.io/badge/pypi-1.1.2-8c34eb.svg)](https://pypi.org/project/h2spacex/)
4-
[![Python: 3.10](https://img.shields.io/badge/Python->=3.10-blue.svg)](https://www.python.org)
3+
[![pypi: 1.2.0](https://img.shields.io/badge/pypi-1.2.0-8c34eb.svg)](https://pypi.org/project/h2spacex/)
4+
[![Python: 3.8.8](https://img.shields.io/badge/Python->=3.10-blue.svg)](https://www.python.org)
55
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-006112.svg)](https://github.com/nxenon/h2spacex/blob/main/LICENSE)
66

77
HTTP/2 low level library based on Scapy which can be used for Single Packet Attack (Race Condition on H2)
@@ -63,7 +63,8 @@ from h2spacex import H2OnTlsConnection
6363

6464
h2_conn = H2OnTlsConnection(
6565
hostname='http2.github.io',
66-
port_number=443
66+
port_number=443,
67+
ssl_log_file_path="PATH_TO_SSL_KEYS.log" # optional (if you want to log ssl keys to read the http/2 traffic in wireshark)
6768
)
6869

6970
h2_conn.setup_connection()

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "h2spacex"
7-
version = "1.1.2"
7+
version = "1.2.0"
88
authors = [
99
{ name="nxenon", email="[email protected]" },
1010
]
1111
license = { text="GPL-3.0" }
1212
description = "HTTP/2 Single Packet Attack low level library based on Scapy"
1313
readme = "README.md"
1414
keywords = ["race-condition", "http2", "single-packet-attack"]
15-
requires-python = ">=3.10"
15+
requires-python = ">=3.8.8"
1616
dependencies = [
1717
"scapy==2.5.0",
1818
"brotlipy==0.7.0",

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='h2spacex',
8-
version='1.1.2',
8+
version='1.2.0',
99
description='HTTP/2 Single Packet Attack low level library based on Scapy',
1010
package_dir={"": "src"},
1111
packages=find_packages(where="src"),
@@ -21,7 +21,7 @@
2121
"Operating System :: OS Independent",
2222
],
2323
install_requires=['scapy==2.5.0', 'brotlipy==0.7.0', 'PySocks==1.7.1'],
24-
python_requires='>=3.10',
24+
python_requires='>=3.8.8',
2525
extras_requires={
2626
'dev': 'twine==4.0.2'
2727
},

src/h2spacex/h2_tls_connection.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111

1212
class H2OnTlsConnection(H2Connection):
13-
def __init__(self, hostname, port_number, read_timeout=3, proxy_hostname=None, proxy_port_number=None):
13+
def __init__(self, hostname, port_number, read_timeout=3,
14+
proxy_hostname=None, proxy_port_number=None, ssl_log_file_path=None):
1415
super().__init__(hostname, port_number, read_timeout=read_timeout, proxy_hostname=proxy_hostname, proxy_port_number=proxy_port_number)
1516
self.tls_socket = None # TLS Socket Context
17+
self.ssl_log_file_path = ssl_log_file_path
1618

1719
def setup_connection(self):
1820
try:
@@ -45,6 +47,8 @@ def close_connection(self):
4547
def __create_tls_context_on_raw_socket(self):
4648
# Create SSL context
4749
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
50+
if self.ssl_log_file_path is not None:
51+
ssl_context.keylog_filename = self.ssl_log_file_path
4852
ssl_context.check_hostname = False
4953
ssl_context.verify_mode = ssl.CERT_NONE
5054
ssl_context.set_alpn_protocols(['h2'])

0 commit comments

Comments
 (0)