Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ubuntu 24.04 noble #165

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-ci:
runs-on: [ self-hosted, linux, x64, jammy ]
runs-on: [ self-hosted, linux, x64, noble ]
timeout-minutes: 45
steps:
- name: Add Masks
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM phusion/baseimage:jammy-1.0.3
FROM phusion/baseimage:noble-1.0.0

RUN --mount=type=cache,target=/var/cache/apt \
apt update && apt install -y \
python3.11 \
python3.11-dev \
python3.11-venv \
python3.12 \
python3.12-dev \
python3.12-venv \
gcc

RUN python3.11 -m venv /venv
RUN python3.12 -m venv /venv

ENV PATH=/venv/bin:$PATH \
VIRTUAL_ENV=/venv \
PYTHONPATH=/app/fact_extractor
Expand Down
19 changes: 10 additions & 9 deletions fact_extractor/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
PROGRAM_DESCRIPTION = 'Firmware Analysis and Comparison Tool (FACT) Extractor installation script'

# Compatible Ubuntu releases
BIONIC_CODE_NAMES = ['bionic', 'tara', 'tessa', 'tina', 'disco']
FOCAL_CODE_NAMES = ['focal', 'ulyana', 'uma', 'una']
JAMMY_CODE_NAMES = ['jammy', 'vanessa']
JAMMY_CODE_NAMES = ['jammy', 'vanessa', 'vera', 'victoria', 'virginia']
NOBLE_CODE_NAMES = ['noble', 'wilma']

# Compatible Debian/Kali releases
BUSTER_CODE_NAMES = ['buster', 'stretch']
Expand All @@ -67,31 +67,32 @@ def _setup_logging(debug_flag=False):


def check_python_version():
if sys.version_info.major != 3 or sys.version_info.minor < 7: # noqa: PLR2004
sys.exit(f'Error: Incompatible Python version! You need at least version 3.7! Your Version: {sys.version}')
if sys.version_info.major != 3 or sys.version_info.minor < 8: # noqa: PLR2004
sys.exit(f'Error: Incompatible Python version! You need at least version 3.8! Your Version: {sys.version}')


def check_distribution():
codename = distro.codename().lower()
if codename in BIONIC_CODE_NAMES:
logging.debug('Ubuntu 18.04 detected')
return 'bionic'
if codename in FOCAL_CODE_NAMES:
logging.debug('Ubuntu 20.04 detected')
return 'focal'
if codename in JAMMY_CODE_NAMES:
logging.debug('Ubuntu 22.04 detected')
return 'jammy'
if codename in NOBLE_CODE_NAMES:
logging.debug('Ubuntu 24.04 detected')
return 'noble'
if codename in BUSTER_CODE_NAMES:
logging.debug('Debian 10 detected')
return 'buster'
if codename in BULLSEYE_CODE_NAMES:
logging.debug('Debian 11/Kali detected')
return 'bullseye'
sys.exit(
msg: str = (
f'Your Distribution ({distro.id()} {distro.version()}) is not supported. '
f'FACT Extractor Installer requires Ubuntu 18.04/20.04/22.04, Debian 9/10, Kali or compatible!'
'FACT Extractor Installer requires Ubuntu 20.04/22.04/24.04, Debian 11/12 or compatible!'
)
logging.error(msg)


def main():
Expand Down
1 change: 1 addition & 0 deletions fact_extractor/install/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'bionic': [],
'focal': [],
'jammy': [],
'noble': [],
# Debian
'buster': [],
'bullseye': [],
Expand Down
13 changes: 12 additions & 1 deletion fact_extractor/install/unpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
'openjdk-19-jdk',
]
},
'noble': {
'apt': [
# binwalk
'libqt5opengl5',
'python3-pyqt5',
'python3-pyqt5.qtopengl',
'libcapstone4',
# patool and unpacking backends
'openjdk-21-jdk',
]
},
# Debian
'buster': {
'apt': [
Expand Down Expand Up @@ -152,7 +163,7 @@
'unzip',
'wget',
# android sparse image
'simg2img',
'android-sdk-libsparse-utils',
# 7z
'yasm',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def unpack_function(file_path, tmp_dir):
"""

logging.debug(f'File Type unknown: execute binwalk on {file_path}')
output = execute_shell_command(f'binwalk --extract --carve --signature --directory {tmp_dir} {file_path}')
output = execute_shell_command(f'binwalk --run-as=root --extract --carve --signature --directory {tmp_dir} {file_path}')

drop_underscore_directory(tmp_dir)
return {'output': output, 'filter_log': ArchivesFilter(tmp_dir).remove_false_positive_archives()}
Expand Down
3 changes: 1 addition & 2 deletions requirements-unpackers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ git+https://github.com/sviehb/[email protected]
cstruct==2.1
python-lzo==1.14
# generic_carver: binwalk
# ToDo: pin to fork (?)
git+https://github.com/ReFirmLabs/[email protected]
git+https://github.com/OSPG/[email protected]
pyqtgraph~=0.13.4
capstone~=5.0.1
numpy~=1.26.4
Expand Down