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

Add apt/brew package info for binwalk and {mk,un}squashfs #418

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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: 2 additions & 0 deletions ofrak_core/ofrak/core/binwalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self):
"binwalk",
"https://github.com/ReFirmLabs/binwalk",
install_check_arg="",
apt_package="binwalk",
brew_package="binwalk",
Comment on lines +34 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding from before was that these packages (at least the brew one) were known to be {inaccurate, non-working, or unmaintained}. @rbs-jacob, does this sound familiar?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, see #482.

Have you validated that the apt and brew packages are the same as what is installed from source?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whyitfor have not rechecked just now, but:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • And per the same comment, apt one is recent enough for at least Ubuntu 22.04

)

async def is_tool_installed(self) -> bool:
Expand Down
14 changes: 12 additions & 2 deletions ofrak_core/ofrak/core/squashfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@
LOGGER = logging.getLogger(__name__)

MKSQUASHFS = ComponentExternalTool(
"mksquashfs", "https://github.com/plougher/squashfs-tools", "-help"
"mksquashfs",
"https://github.com/plougher/squashfs-tools",
"-help",
apt_package="squashfs-tools",
brew_package="squashfs",
)


class _UnsquashfsV45Tool(ComponentExternalTool):
def __init__(self):
super().__init__("unsquashfs", "https://github.com/plougher/squashfs-tools", "")
super().__init__(
"unsquashfs",
"https://github.com/plougher/squashfs-tools",
"",
apt_package="squashfs-tools",
brew_package="squashfs",
)
Comment on lines +35 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar situation here. In the ofrak Docker image, we build squashfs-tools from a specific tag: https://github.com/redballoonsecurity/ofrak/blob/master/ofrak_core/Dockerstub#L50.

Are the apt and brew packages the same version, and built from the github repo?

I think the general thinking here is:

  • If an apt, brew package exist, and are generally known to work (and match what is in the Docker), we list them here. So it would be helpful if you validated this.
  • If those packages have known deficiencies, or if they don't match what is in the Docker image, we don't list them; here the goal is the link provided will give the user enough information to decide how to fulfill this dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whyitfor not rechecked just now, but per #418 (comment) :

  • The brew one is new enough
  • Apt one is recent enough for at least Ubuntu 22.04


async def is_tool_installed(self) -> bool:
try:
Expand Down
Loading