Find who executes a target binary inside your MacOS.

Overview

whoexec

Whoexec is a tool that will monitor every exec call inside MacOS by using the latest Endpoint Security Framework, with this it's able to detect any execution of a target file.

Use cases

There are many cases for you to use this, you can use this to trace which process call a unknown binary, trace if a malware will attempt to execute some system command or even to check if your cronjob is running properly.

Disclaimer

I'm not a professional Apple developer (not even close), so I don't have the necessary entitlements to run this project in machines with SIP enabled, so if you want to use this for research porpuse you must disable SIP (you probably already did this), then you are ready to go, that's also the reason I will not publish any non signed/notorized binary in this repository.

Building

First, clone this project:

git clone https://github.com/AandersonL/whoexec.git

Make sure to have Xcode installed in your machine, after this you can:

  • Open the project in Xcode and build it inside
  • Or run the following
    • xcodebuild -configuration Debug
    • The executable will be at ./build/Debug/whoexec

Using & example

For the sake of simpliticy, you just have 1 argument to pass to this tiny tracer, the binary to be monitored:

sudo ./whoexec ps

Then, after the endpoint security engine start and setup ours handlers, any kind of exec call will be logged in the terminal:

$ sudo ./whoexec ps
2021-12-15 18:11:57.518 whoexec[7889:145988] Monitoring exec calls...
2021-12-15 18:11:58.570 whoexec[7889:146065] ps was executed by /bin/bash PID: 7902
2021-12-15 18:12:02.683 whoexec[7889:146065] ps was executed by /bin/zsh PID: 7922

That's it, very simple and useful!

Thanks and feel free to contribute and open issues :)

You might also like...
Helps you define secure storages for your properties using Swift property wrappers.

🔐 Secure Property Storage Helps you define secure storages for your properties using Swift property wrappers. 🌟 Features All keys are hashed using S

TouchID used easy on one line in your ViewController.

TouchIDExtension TouchID used easy on one line in your ViewController. ##Installation At this moment, You can install only a way, manually. For instal

Automatically audit your Mac for basic security hygiene.
Automatically audit your Mac for basic security hygiene.

Automatically audit your Mac for basic security hygiene The simplest security is the most important. 80% of hacks are caused by 20% of common preventa

Obfuscate your strings in Swift easily

TPObfuscatedString TPObfuscatedString is a simple extension for String in Swift. It allows you to obfuscate hardcoded Strings in your compiled binary.

Framework for biometric authentication (via TouchID) in your application
Framework for biometric authentication (via TouchID) in your application

Features Requirements Communication Installation Usage Intro Biometric authentication availability Feature enabled/disabled for biometric authenticati

Use Apple FaceID or TouchID authentication in your app using BiometricAuthentication.
Use Apple FaceID or TouchID authentication in your app using BiometricAuthentication.

BiometricAuthentication Use Apple FaceID or TouchID authentication in your app using BiometricAuthentication. It's very simple and easy to use that ha

UIKit a-là SwiftUI.framework [min deployment target iOS10]
UIKit a-là SwiftUI.framework [min deployment target iOS10]

Render CoreRender is a SwiftUI inspired API for UIKit (that is compatible with iOS 10+ and ObjC). Introduction Declarative: CoreRender uses a declarat

Extensions which helps to convert objc-style target/action to swifty closures

ActionClosurable Usage ActionClosurable extends UIControl, UIButton, UIRefreshControl, UIGestureRecognizer and UIBarButtonItem. It helps writing swift

This to learn such as : Add Target , NSNotification Center Send/Get Data , Observer Override , resize Data By Byte , UIImagePicker Delegate , UIAlert Handle , Top ViewController , Get pickerController

Technicalisto How to Create UIButton Class to Pick Data Image Purpose Learn this topics With exact Task Add Target NSNotification Center Send/Get Data

Rosetta Enforcer is a macOS utility designed to help developers convert Universal Binary application to Single Architecture, vice versa.
Rosetta Enforcer is a macOS utility designed to help developers convert Universal Binary application to Single Architecture, vice versa.

Rosetta Enforcer Rosetta Enforcer is a macOS utility designed to help developers convert Universal Binary application to Single Architecture, vice ver

A framework that provides CurtainController. CurtainController is a container view controller that implements a content-curtain interface. You can find a similar implementation in applications like Apple Maps, Find My, Stocks, etc. Someone calls it
Swift code to programmatically execute local or hosted JXA payloads without using the on-disk osascript binary

Swift code to programmatically execute local or hosted JXA payloads without using the on-disk osascript binary. This is helpful when you have Terminal access to a macOS host and want to launch a JXA .js payload without using on-disk osascript commands.

Finds the .dSYM for a given binary image name and replaces its internal UUID with the given UUID.
Finds the .dSYM for a given binary image name and replaces its internal UUID with the given UUID.

dsymrename Given a directory with several .dSYMs, finds the .dSYM for a given binary image name and replaces its internal UUID with the given UUID. Us

Azure Maps iOS SDK binary distribution for Swift Package Manager
Azure Maps iOS SDK binary distribution for Swift Package Manager

Azure Maps Control for iOS Installation In your Xcode iOS Project settings, under Project setting’s Package Dependencies, click on + button to add pac

The Binary Search Algorithm in Swift 🤯 👨🏻‍💻
The Binary Search Algorithm in Swift 🤯 👨🏻‍💻

Binary Search in Swift Binary search is a simple algorithm that lets you search an array for a specific value. It’s trivial to implement in Swift, whi

Create xcframework zip archive for Swift binary package.

xczip xczip - create xcframework zip archive for swift binary package. Creates an xcframework archive with a stable checksum that does not change when

Qiling Advanced Binary Emulation Framework
Qiling Advanced Binary Emulation Framework

Qiling's usecase, blog and related work Qiling is an advanced binary emulation framework, with the following features: Emulate multi-platforms: Window

INTUZ is presenting an interesting a Multilevel Expand/Collapse UITableView App Control to integrate inside your native iOS-based application
INTUZ is presenting an interesting a Multilevel Expand/Collapse UITableView App Control to integrate inside your native iOS-based application

INTUZ is presenting an interesting a Multilevel Expand/Collapse UITableView App Control to integrate inside your native iOS-based application. MultilevelTableView is a simple component, which lets you use the tableview with multilevel tree view in your project.

Crop faces, inside of your image, with iOS 11 Vision api.
Crop faces, inside of your image, with iOS 11 Vision api.

FaceCropper Requirements Xcode 9.0 (beta) or higher. iOS 11.0 (beta) or higher. (It is possible to import this library under the iOS 11. But it won't

Owner
Anderson
Anderson
PGPro can encrypt and decrypt messages as well as manage all your OpenPGP keys. It is free, simple and lightweight. Everything stays on your device. PGPro is made in Switzerland.

PGPro can encrypt and decrypt messages as well as manage all your OpenPGP keys. It is free, simple and lightweight. Everything stays on your device. P

Luca Näf 250 Jan 4, 2023
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
Safe and easy to use crypto for iOS and macOS

Swift-Sodium Swift-Sodium provides a safe and easy to use interface to perform common cryptographic operations on macOS, iOS, tvOS and watchOS. It lev

Frank Denis 483 Jan 5, 2023
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.

KeychainAccess KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much mor

Kishikawa Katsumi 7.2k Dec 30, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

Square 3.8k Jan 4, 2023
Native and encrypted password manager for iOS and macOS.

Open Sesame Native and encrypted password manager for iOS and macOS. What is it? OpenSesame is a free and powerful password manager that lets you mana

OpenSesame 432 Jan 7, 2023
Partial rewrite of the `plutil` utility on macOS

SwiftPlist Description This tool is a partial rewrite of the plutil utility on macOS. It allows you to view property list (plist) files in any format

Justin Bui 6 Sep 16, 2022
A super simple tool for macOS Swift developers to check validity of a Gumroad-issued software license keys

Gumroad License Validator Overview A super simple tool for macOS Swift developers to check validity of a Gumroad-issued software license keys Requirem

Daniel Kašaj 13 Sep 2, 2022
Send key events to any running macOS application.

KeySender An extremely simple micro package that enables you to send key events to any running application. Install Add the following to your Package.

Jordan Baird 5 Jul 31, 2022