Jump to content

[PAYLOAD] Windows Persistent Reverse Shell


0dyss3us
 Share

Recommended Posts

Windows Persistent Reverse Shell for Bash Bunny

  • Author: 0dyss3us (KeenanV)
  • Version: 1.0

Description

Opens a persistent reverse shell through NetCat on victim's Windows machine and connects it back to host attacker.

  • Targets Windows 10 (working on support for older versions)
  • Connection can be closed and reconnected at any time
  • Deploys in roughly 15-20 sec
  • Works with NetCat

Requirements

Have a working Bash Bunny :)

STATUS

LED STATUS
Purple Setup
Amber (Single Blink) Installing and running scripts
Green Finished

Installation and Execution

  1. Plug in Bash Bunny in arming mode
  2. Move files from WindowsPersistentReverseShell to either switch folder
  3. Edit the persistence.vbs file and replace ATTACKER_IP with attacker's IP and PORT with whichever port you like to use (I use 1337 ?)
  4. Save the persistence.vbs file
  5. Unplug Bash Bunny and switch it to the position the payload is loaded on
  6. Plug the Bash Bunny into your victim's Windows machine and wait until the final light turns green (about 15-20 sec)
  7. Unplug the Bash Bunny and go to attacker's machine
  8. Listen on the port you chose in the persistence.vbs file on NetCat
    • Run the command nc -nlvp 1337 (replace the port with the port in persistence.vbs)
    • If using Windows as the attacker machine, you must install Ncat from: http://nmap.org/dist/ncat-portable-5.59BETA1.zip and use the command ncat instead of nc from the directory that you installed ncat.exe.
  9. Wait for connection (Should take no longer than 1 minute as the powershell command runs every minute)
  10. Once a Windows cmd prompt appears...YOU'RE DONE!! ? and you can disconnect and reconnect at any time as long as the user is logged in

Download

Click here to download

  • Like 1
Link to comment
Share on other sites

I just saw your project.  Some other advice with executables is you should not include programs from other programs..like netcat.exe is part of nmap licensed to them.  If you want your thing to be binary-less, look at Powercat.  Nishang also as a script or two in there for netcat compatible reverse shells.

 

Link to comment
Share on other sites

  • 1 year later...

Every time I try to run this on Win10 the ps script runs and once cmd.exe pops up there is an error message stating that Windows can not find the persistence.vbs file. I checked in the AppData directory referenced by the ps script and it is indeed not there. Even when I attempt to manually place it there it still doesn't work.

 

Any idea why?

Link to comment
Share on other sites

  • 2 weeks later...
On 1/3/2020 at 12:32 PM, InfoSecFresh said:

Every time I try to run this on Win10 the ps script runs and once cmd.exe pops up there is an error message stating that Windows can not find the persistence.vbs file. I checked in the AppData directory referenced by the ps script and it is indeed not there. Even when I attempt to manually place it there it still doesn't work.

 

Any idea why?

I too am having this problem. It worked the first time on my standard windows 10 PC, but the more recent version of windows 10 is not working. 

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
On 1/3/2020 at 7:32 PM, InfoSecFresh said:

Every time I try to run this on Win10 the ps script runs and once cmd.exe pops up there is an error message stating that Windows can not find the persistence.vbs file. I checked in the AppData directory referenced by the ps script and it is indeed not there. Even when I attempt to manually place it there it still doesn't work.

 

Any idea why?

Most likely Windows Defender. When I ran the bashbunny with this payload, it worked the first time, and then after that Windows defender did not like it.

But that is trivial to get around, just rename some fields and file names and it works fine. 

Link to comment
Share on other sites

  • 2 months later...

I would probably seek another way of doing this. The payload isn't limited to have a possible SPoF (Single Point of Failure), but several. First, using Netcat at all is a trick in the bag that is most likely going to be picked up by Defender. Then, using vbs files is a second way of getting noticed and/or blocked. Letting Netcat touch any storage device is a possible third. If I would do that operation I would most likely skip using vbs and Netcat. Running the target side entirely in PowerShell could be an alternative and live off the land instead. Persistence could be achieved by using scheduled tasks. Will require that the logged on user is a member of the local Administrators group, but it won't trigger any uac prompt that needs to be dealt with.

In the end, it all depends on the target and how hardened it is. Some use payloads that disable Defender (or any A-V), but that is not realistic in my opinion since it will create "noise" in any environment worth mentioning. It's possible of course for some targets in less managed and "not looked after" environments, but for a black box engagement, I would most likely not include it in my plan.

Link to comment
Share on other sites

  • 8 months later...

I tried this payload today, in my BB MKII and it doesnt work anymore.

The led turn purple and you can see how the cmd opens and close, but after 5 seconds the led turn green and the bashbunny folder appers like in arming mode.

Don't know why and how i can solve this

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...