Jump to content

[PAYLOAD] Windows Persistent Reverse Shell


0dyss3us

Recommended Posts

Posted

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

Posted

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.

 

  • 1 year later...
Posted

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?

  • 2 weeks later...
Posted
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. 

  • 1 year later...
  • 4 months later...
Posted
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. 

Posted
On 7/24/2021 at 2:19 AM, EKwOrld said:

Any ideas on how to stop the automatic connection once it has started? 

Go to : AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\

Delete the vbs script.

Delete c:\temp\ncat.exe 

Kill the ncat process if it is still running. 

  • 2 months later...
Posted

Windows defender is blocking the persistence file from being placed in the roaming startup folder. What should I do about this?

Posted

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.

  • 8 months later...
Posted

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

  • 7 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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