Skip to content
New issue

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

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

Already on GitHub? # to your account

Fresh install of macOS lacks dev tools, thus no strings #171

Closed
jsdjjsd opened this issue Sep 18, 2023 · 5 comments
Closed

Fresh install of macOS lacks dev tools, thus no strings #171

jsdjjsd opened this issue Sep 18, 2023 · 5 comments
Assignees
Labels

Comments

@jsdjjsd
Copy link

jsdjjsd commented Sep 18, 2023

Annoyingly, Apple doesn't ship the Command Line Developer tools with macOS, thus there is no strings binary to use. When running in a terminal window locally it pops up a message box about this, luckily it does not when using for example EDR.

Screenshot 2023-09-18 at 14 52 07

As a workaround we've taken tbostrings and compiled one for x86_64 and one for arm64 and ship them together with UAC, use a oneliner in the strings_running_processes YAML file with some logic for the artefact to check for the com.apple.quarantine extended attribute, disable it when necessary using xattr, and chmod the executable flag, check CPU architecture, and finally run the appropriate binary with tbostrings %line%. Not perfect, but it works.

@tclahr tclahr self-assigned this Sep 19, 2023
@tclahr tclahr added the status: confirmed Confirmed label Sep 19, 2023
@tclahr
Copy link
Owner

tclahr commented Sep 19, 2023

Yeah, I agree that's annoying.
I am currently working on UAC version 3 that will provide a property called "condition" in the YAML files. So in order to run the whole YAML file, the condition needs to be true (or false). The idea is to only run strings in macos if strings command is available.

Have you tried to put a copy of the strings command from a macos that has XCode installed into UAC bin directory?

@jsdjjsd
Copy link
Author

jsdjjsd commented Sep 19, 2023

Yeah, I agree that's annoying. I am currently working on UAC version 3 that will provide a property called "condition" in the YAML files. So in order to run the whole YAML file, the condition needs to be true (or false). The idea is to only run strings in macos if strings command is available.

Have you tried to put a copy of the strings command from a macos that has XCode installed into UAC bin directory?

Yes, this we've also tried, but it's calling a dynamic library that is provided by the Command Line Developer tools, so putting the strings binary from a system that has it, onto a fresh system, it will still generate the same error. You would probably be able to compile it statically, but we went for tbostrings so that we can get all ASCII and UNICODE strings in the same pass, which is nice.

@tclahr
Copy link
Owner

tclahr commented Sep 20, 2023

I will take a look on tbostrings.
I will also try to statically compile GNU strings on an Intel and Silicon macs for testing.

@tclahr
Copy link
Owner

tclahr commented Jul 4, 2024

I have pushed a new code to develop that solves this. First, UAC will check if xcode tools is installed in the target system. If not, UAC will use astrings tool (built-in shell function that extracts strings from binary files for any operating system).

Can you download the develop branch and test it, please? Thanks!

@tclahr tclahr added the status: testing Testing phase label Jul 4, 2024
@tclahr
Copy link
Owner

tclahr commented Jul 24, 2024

Code has been merged into uac v3.0.0-rc1.

@tclahr tclahr closed this as completed Jul 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants