forked from osmocom/wireshark
Add a "No Reassembly" profile.
Add a script that disables all of our desegmentation and reassembly preferences and use it to create a "No Reassembly" profile. Change-Id: Icd0b72e9e271a511e637acde9018f3aae018e589 Reviewed-on: https://code.wireshark.org/review/30799 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
fc1e2ac66d
commit
0b9810ab97
|
@ -61,6 +61,7 @@ since version 2.6.0:
|
|||
calls the specific dissector directly without lower protocols.
|
||||
* sshdump and ciscodump can now use a proxy for the ssh connection.
|
||||
* Dumpcap now supports the `-a packets:NUM` and `-b packets:NUM` options.
|
||||
* Wireshark now includes a “No Reassembly” configuration profile.
|
||||
|
||||
=== Removed Features and Support
|
||||
|
||||
|
|
|
@ -1026,6 +1026,8 @@ SetOutPath '$INSTDIR\profiles\Bluetooth'
|
|||
File "${STAGING_DIR}\profiles\Bluetooth\colorfilters"
|
||||
SetOutPath '$INSTDIR\profiles\Classic'
|
||||
File "${STAGING_DIR}\profiles\Classic\colorfilters"
|
||||
SetOutPath '$INSTDIR\profiles\No Reassembly'
|
||||
File "${STAGING_DIR}\profiles\No Reassembly\preferences"
|
||||
SectionEnd
|
||||
|
||||
!ifdef SMI_DIR
|
||||
|
|
|
@ -290,12 +290,18 @@
|
|||
<File Id="filClassic_colorfilters" KeyPath="yes" Source="$(var.Profiles.Dir)\Classic\colorfilters" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dirNoReassembly" Name="No Reassembly">
|
||||
<Component Id="cmpNoReassembly_preferences" Guid="*">
|
||||
<File Id="filNoReassembly_preferences" KeyPath="yes" Source="$(var.Profiles.Dir)\No Reassembly\preferences" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
<Fragment>
|
||||
<ComponentGroup Id="CG.Plugins.ConfigurationProfiles">
|
||||
<ComponentRef Id="cmpBluetooth_colorfilters" />
|
||||
<ComponentRef Id="cmpClassic_colorfilters" />
|
||||
<ComponentRef Id="cmpNoReassembly_preferences" />
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,63 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Generate preferences for a "No Reassembly" profile.
|
||||
# By Gerald Combs <gerald@wireshark.org>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
'''Generate preferences for a "No Reassembly" profile.'''
|
||||
|
||||
import argparse
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def main():
|
||||
if sys.version_info[0] < 3:
|
||||
print("This requires Python 3")
|
||||
sys.exit(2)
|
||||
|
||||
parser = argparse.ArgumentParser(description='No reassembly profile generator')
|
||||
parser.add_argument('-p', '--program-path', default=os.path.curdir, help='Path to TShark.')
|
||||
parser.add_argument('-v', '--verbose', action='store_const', const=True, default=False, help='Verbose output.')
|
||||
args = parser.parse_args()
|
||||
|
||||
this_dir = os.path.dirname(__file__)
|
||||
profile_path = os.path.join(this_dir, '..', 'profiles', 'No Reassembly', 'preferences')
|
||||
|
||||
tshark_path = os.path.join(args.program_path, 'tshark')
|
||||
if not os.path.isfile(tshark_path):
|
||||
print('tshark not found at {}\n'.format(tshark_path))
|
||||
parser.print_usage()
|
||||
sys.exit(1)
|
||||
|
||||
rd_pref_re = re.compile('^#\s*(.*(reassembl|desegment)):')
|
||||
nr_prefs = []
|
||||
prefs_changed = 0
|
||||
cp = subprocess.run([tshark_path, '-G', 'defaultprefs'], stdout=subprocess.PIPE, check=True, encoding='utf-8')
|
||||
for pref_line in cp.stdout.split('\n'):
|
||||
nr_prefs.append(pref_line)
|
||||
m = rd_pref_re.search(pref_line)
|
||||
if m:
|
||||
pref = m.group(1) + ': FALSE'
|
||||
if args.verbose is True:
|
||||
print(pref_line + '\n' + pref)
|
||||
nr_prefs.append(pref)
|
||||
prefs_changed += 1
|
||||
|
||||
if len(nr_prefs) < 5000:
|
||||
print("Too few preference lines.")
|
||||
sys.exit(1)
|
||||
|
||||
if len(nr_prefs) < 50:
|
||||
print("Too few changed preferences.")
|
||||
sys.exit(1)
|
||||
|
||||
with open(profile_path, 'w') as profile_f:
|
||||
for pref_line in nr_prefs:
|
||||
profile_f.write(pref_line + '\n')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in New Issue