Skip to content

Commit

Permalink
Skip delegated credentials (#46)
Browse files Browse the repository at this point in the history
* fix for issue #21, original order

* fix for issue #30 ALPN values

* fix for issue #16

* fix for issue #6

* update to check Cookie and Referer for all cases

* fixes #41
  • Loading branch information
noeltimothy authored Jan 4, 2024
1 parent 96a9e7a commit 747d870
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions python/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,19 @@ def scan_tls(layer):
for l in layer:
if 'tls_tls_handshake_type' in l:
return l

# Get the right signature algorithms
def get_signature_algorithms(packet):
if 'sig_alg_lengths' in packet and isinstance(packet['sig_alg_lengths'], list):
alg_lengths = [ int(int(x)/2) for x in packet['sig_alg_lengths'] ]

extensions = packet['extensions']
idx = 0
try:
if extensions.index('13') > extensions.index('35'):
idx = 1
except Exception as e:
pass
packet['signature_algorithms'] = packet['signature_algorithms'][alg_lengths[idx]:]
return packet['signature_algorithms']

3 changes: 2 additions & 1 deletion python/ja4.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def version_check(ver):
'supported_versions': 'handshake_extensions_supported_version',
'alpn': 'handshake_extensions_alps_alpn_str',
'alpn_list': 'handshake_extensions_alpn_str',
'sig_alg_lengths': 'handshake_sig_hash_alg_len',
'signature_algorithms': 'handshake_sig_hash_alg',
},
'x509af': {
Expand Down Expand Up @@ -211,7 +212,7 @@ def to_ja4(x, debug_stream):
ext_len = '{:02d}'.format(len([ x for x in x['extensions'] if x not in GREASE_TABLE]))
cache_update(x, 'client_ciphers', x['ciphers'], debug_stream)

x['signature_algorithms'] = [ y[2:] for y in x['signature_algorithms'] ]
x['signature_algorithms'] = [ y[2:] for y in get_signature_algorithms(x) ]

# ignore SNI and ALPN extensions
x['extensions'] = [ x for x in x['extensions'] if x not in ['0x0000', '0x0010'] ]
Expand Down

0 comments on commit 747d870

Please sign in to comment.