Created
November 12, 2019 07:35
-
-
Save s0lst1c3/51cc7ac5e2bcce1dae03e267ad33a5df to your computer and use it in GitHub Desktop.
Automates the build process for Wireshark 3.1.X (dev) on Kali
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Name: build-wireshark-dev.py | |
# Author: @s0lst1c3 | |
# Email: gabriel@specterops.io | |
# Description: Automates the build process for Wireshark 3.1.X (dev) on Kali | |
# Last tested: Nov 12 2019 | |
import os | |
import shutil | |
deps = [ | |
'bison', | |
'build-essential', | |
'cmake', | |
'freeglut3-dev', | |
'g++', | |
'gcc', | |
'gcrypt-dev', | |
'git', | |
'glib2.0-dev', | |
'libasound2', | |
'libbluetooth-dev', 'pkg-config', 'libpcap-dev', | |
'libqt5svg5-dev', | |
'libqt5webkit5-dev', | |
'libsdl2-dev', | |
'libssl-dev', | |
'libusb-1.0-0-dev', | |
'libxi-dev', | |
'libxmu-dev', | |
'make', | |
'python-numpy', | |
'python-qt4', | |
'qt5-default', | |
'qtmultimedia5-dev', | |
'qtscript5-dev', | |
'qttools5-dev', | |
'qttools5-dev-tools', | |
] | |
wireshark_version = '3.1.0' | |
wireshark_tar = 'wireshark-{}.tar.xz'.format(wireshark_version) | |
wireshark_url = 'https://1.na.dl.wireshark.org/src/{}'.format(wireshark_tar) | |
wireshark_dir = 'wireshark-{}'.format(wireshark_version) | |
wireshark_build_dir = 'build' | |
cmake_options_file = '{}/CMakeOptions.txt'.format(wireshark_dir) | |
cmake_options_file_bak = '{}.bak'.format(cmake_options_file) | |
# install deps | |
os.system('apt -y install {}'.format(' '.join(deps))) | |
os.system('wget {}'.format(wireshark_url)) | |
os.system('tar xJf {}'.format(wireshark_tar)) | |
try: | |
os.makedirs(wireshark_build_dir) | |
except OSError as e: | |
pass | |
shutil.copyfile(cmake_options_file, cmake_options_file_bak) | |
with open(cmake_options_file_bak) as input_handle: | |
with open(cmake_options_file, 'w') as output_handle: | |
for line in input_handle: | |
if line.startswith('option(DISABLE_WERROR'): | |
output_handle.write('option(DISABLE_WERROR ' | |
'"Do not treat warnings as errors" ON)\n') | |
else: | |
output_handle.write(line) | |
os.system('cd {} && cmake ../{} && make'.format(wireshark_build_dir, | |
wireshark_dir)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment