Jump to content

General Debugging and "Loot" Folder Permissions


bg-wa

Recommended Posts

So after a week of clean testing I managed to break my bash bunny, somehow messing up the mount point /root/udisk/ (It would not auto-mount and was read-only when manually mounted)...

Thanks to @Foxtrot I was able to regain access by re-mounting and changing the permissions:

mount -o sync /dev/nandf /root/udisk
chown root:root /root/udisk -R
chmod 777 /root/udisk -R

I still can't write to my individual payload switch folders like I previously could, so I've updated my debug helper to reflect a more accessible directory (/root/udisk/debug):

https://github.com/bg-wa/bashbunny-payloads/blob/bunny_debug_helpers/payloads/library/bunny_debug_helpers.sh

Again, to use this script:

1.) Include the helper at the top of your script:

source bunny_debug_helpers.sh

2.) Pepper your script with log entries to see where events succeed.

debug_log "Attack Mode Set" #ln. 41
debug_log "IP Address : ${TARGET_IP}" #ln 92

3.) Plug in Bunny... bash bash bash...

4)  When finished, set the Bunny to arming mode and view your debug logs in the newly created "Debug" folder (/root/udisk/debug).

Edited by bg-wa
Link to comment
Share on other sites

1 hour ago, Dave-ee Jones said:

I'm confused. Is it fixed or no?

Yes.  When I took the time to write a test, it makes more sense...

Basically I had locked myself out of the BashBunny partition where the loot and payload folders live.  I couldn't sudo chmod them from the machines I tried, so I had to reset them on the Bunny itself...  Somewhere along the lines of the hundreds of times I plugged and unplugged this device, into everything in my house that has a USB port, permissions got changed. 

Here is a script I wrote after the fact in case it happens again:

# At this point I could not write to /root/udisk/loot
# or /root/udisk/debug as I could before

LED G

mkdir /root/udisk/debug

touch /test # File 'test' written
touch /root/test # File 'test' written
touch /root/udisk/test # File NOT written
touch /root/udisk/loot/test # File NOT written
touch /root/udisk/debug/test # File NOT written
touch /root/udisk/payloads/test # File NOT written
touch /root/udisk/payloads/switch1/test # File NOT written

# Then I ran:
# mount -o sync /dev/nandf /root/udisk
# chown root:root /root/udisk -R
# chmod 777 /root/udisk -R



touch /test # File 'test' written
touch /root/test # File 'test' written
touch /root/udisk/test # File 'test' written
touch /root/udisk/loot/test # File 'test' written
touch /root/udisk/debug/test # File 'test' written
touch /root/udisk/payloads/test # File 'test' written
touch /root/udisk/payloads/switch1/test # File 'test' written


# Here I could write to my Bunny again

LED R G B

https://github.com/bg-wa/bashbunny-payloads/blob/bunny_permissions_checker/payloads/library/bunny_permissions_checker/payload.txt

Hope that helps someone else along the line.

 

 

Edited by bg-wa
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.

  • Recently Browsing   0 members

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