项目作者: CyborgSecurity

项目描述 :
macOS persistence tool
高级语言: Python
项目地址: git://github.com/CyborgSecurity/PoisonApple.git
创建时间: 2021-02-27T22:05:20Z
项目社区:https://github.com/CyborgSecurity/PoisonApple

开源协议:MIT License

下载


PoisonApple

This is a command-line tool to perform various persistence mechanism techniques on macOS. This tool was designed to be used by threat hunters for cyber threat emulation purposes.

Install

Do it up:

  1. $ pip3 install poisonapple --user

Note: PoisonApple was written & tested using Python 3.9, it should work using Python 3.6+

Important Notes!

  • PoisonApple will make modifications to your macOS system, it’s advised to only use PoisonApple on a virtual machine. Although any persistence mechanism technique added using this tool can also be easily removed (-r), please use with caution!
  • Be advised: This tool will likely cause common AV / EDR / other macOS security products to generate alerts.
  • To understand how any of these techniques work in-depth please see The Art of Mac Malware, Volume 1: Analysis - Chapter 0x2: Persistence by Patrick Wardle of Objective-See. It’s a fantastic resource.

Usage

See PoisonApple switch options (—help):

  1. $ poisonapple --help
  2. usage: poisonapple [-h] [-l] [-t TECHNIQUE] [-n NAME] [-c COMMAND] [-r]
  3. Command-line tool to perform various persistence mechanism techniques on macOS.
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. -l, --list list available persistence mechanism techniques
  7. -t TECHNIQUE, --technique TECHNIQUE
  8. persistence mechanism technique to use
  9. -n NAME, --name NAME name for the file or label used for persistence
  10. -c COMMAND, --command COMMAND
  11. command(s) to execute for persistence
  12. -r, --remove remove persistence mechanism

List of available techniques:

  1. $ poisonapple --list
  2. , _______ __
  3. .-.:|.-. | _ .-----|__|-----.-----.-----.
  4. .' '. |. | | | | |__ --| | | | |
  5. '-."~". .-' |. ____|_____|__|_____|_____|__|__|
  6. } ` } { |: | _______ __
  7. } } } { |::.| | _ .-----.-----| |-----.
  8. } ` } { `---' |. | | | | | | | -__|
  9. .-'"~" '-. |. _ | __| __|__|_____|
  10. '. .' |: | |__| |__|
  11. '-_.._-' |::.|:. |
  12. `--- ---' v0.2.3
  13. +--------------------+
  14. | AtJob |
  15. +--------------------+
  16. | Bashrc |
  17. +--------------------+
  18. | Cron |
  19. +--------------------+
  20. | CronRoot |
  21. +--------------------+
  22. | Emond |
  23. +--------------------+
  24. | Iterm2 |
  25. +--------------------+
  26. | LaunchAgent |
  27. +--------------------+
  28. | LaunchAgentUser |
  29. +--------------------+
  30. | LaunchDaemon |
  31. +--------------------+
  32. | LoginHook |
  33. +--------------------+
  34. | LoginHookUser |
  35. +--------------------+
  36. | LoginItem |
  37. +--------------------+
  38. | LogoutHook |
  39. +--------------------+
  40. | LogoutHookUser |
  41. +--------------------+
  42. | Periodic |
  43. +--------------------+
  44. | Reopen |
  45. +--------------------+
  46. | Zshrc |
  47. +--------------------+

Apply a persistence mechanism:

  1. $ poisonapple -t LaunchAgentUser -n testing
  2. , _______ __
  3. .-.:|.-. | _ .-----|__|-----.-----.-----.
  4. .' '. |. | | | | |__ --| | | | |
  5. '-."~". .-' |. ____|_____|__|_____|_____|__|__|
  6. } ` } { |: | _______ __
  7. } } } { |::.| | _ .-----.-----| |-----.
  8. } ` } { `---' |. | | | | | | | -__|
  9. .-'"~" '-. |. _ | __| __|__|_____|
  10. '. .' |: | |__| |__|
  11. '-_.._-' |::.|:. |
  12. `--- ---' v0.2.3
  13. [+] Success! The persistence mechanism action was successful: LaunchAgentUser

If no command is specified (-c) a default trigger command will be used which writes to a file on the Desktop every time the persistence mechanism is triggered:

  1. $ cat ~/Desktop/PoisonApple-LaunchAgentUser
  2. Triggered @ Tue Mar 23 17:46:02 CDT 2021
  3. Triggered @ Tue Mar 23 17:46:13 CDT 2021
  4. Triggered @ Tue Mar 23 17:46:23 CDT 2021
  5. Triggered @ Tue Mar 23 17:46:33 CDT 2021
  6. Triggered @ Tue Mar 23 17:46:43 CDT 2021
  7. Triggered @ Tue Mar 23 17:46:53 CDT 2021
  8. Triggered @ Tue Mar 23 17:47:03 CDT 2021
  9. Triggered @ Tue Mar 23 17:47:13 CDT 2021
  10. Triggered @ Tue Mar 23 17:48:05 CDT 2021
  11. Triggered @ Tue Mar 23 17:48:15 CDT 2021

Remove a persistence mechanism:

  1. $ poisonapple -t LaunchAgentUser -n testing -r
  2. ...

Use a custom command:

  1. $ poisonapple -t LaunchAgentUser -n foo -c "echo foo >> /Users/user/Desktop/foo"
  2. ...