mirror of
https://github.com/hak5/bashbunny-payloads.git
synced 2025-10-29 16:58:25 +00:00
Merge pull request #65 from mathew-fleisch/master
Payload: Fixed a bug and updated the read-me doc.
This commit is contained in:
@@ -5,7 +5,7 @@ Version: 1.0
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
Clones the bashbunny-payloads repository and also will update an existing repository.
|
Clones the bashbunny-payloads repository and also will update an existing repository. Use this payload to get all the other payloads!
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ Configured for nix by default. Swap RNDIS_ETHERNET with ECM_ETHERNET on Windows
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
Target must be sharing internet.
|
Target must be sharing internet. BashBunny must have git installed.
|
||||||
|
|
||||||
1. Run bb.sh (pause at main menu)
|
1. Run bb.sh (pause at main menu)
|
||||||
2. Plug in da bunny
|
2. Plug in da bunny
|
||||||
|
|||||||
@@ -18,19 +18,20 @@ LED R G B
|
|||||||
ATTACKMODE RNDIS_ETHERNET
|
ATTACKMODE RNDIS_ETHERNET
|
||||||
#ATTACKMODE ECM_ETHERNET
|
#ATTACKMODE ECM_ETHERNET
|
||||||
|
|
||||||
source bunny_helpers.sh
|
|
||||||
|
|
||||||
# Set your desired repo url and branch if you're not looking to update from mainline
|
# Set your desired repo url and branch if you're not looking to update from mainline
|
||||||
git_repo="https://github.com/hak5/bashbunny-payloads.git"
|
git_repo="https://github.com/hak5/bashbunny-payloads.git"
|
||||||
git_branch="master"
|
git_branch="master"
|
||||||
payloads_dir="/root/udisk"
|
payloads_dir="/root/udisk"
|
||||||
log_file="/root/udisk/payloads/$SWITCH_POSITION/git.log"
|
log_file="/var/log/git.log"
|
||||||
|
|
||||||
echo "Git Bunny Git" > $log_file
|
echo " --------- Git Bunny Git [started] -----------" >> $log_file
|
||||||
|
|
||||||
|
# Sanity check on mounted drive
|
||||||
|
[[ ! `mount | grep "nandf"` ]] && { LED R 200; echo "Could not mount filesystem" >> $log_file; exit 1; }
|
||||||
|
|
||||||
# Test for internet connection
|
# Test for internet connection
|
||||||
wget -q --tries=15 --timeout=5 --spider http://example.com
|
wget -q --tries=15 --timeout=5 --spider http://example.com
|
||||||
[[ "$?" -ne 0 ]] && { LED R; exit 1; }
|
[[ "$?" -ne 0 ]] && { LED R; echo "Could not connect to the internet" >> $log_file; exit 1; }
|
||||||
|
|
||||||
# Let's go
|
# Let's go
|
||||||
LED R G
|
LED R G
|
||||||
@@ -41,27 +42,34 @@ export GIT_SSL_NO_VERIFY=1
|
|||||||
if [ -d ".git" ]; then
|
if [ -d ".git" ]; then
|
||||||
# Get the newest payloads
|
# Get the newest payloads
|
||||||
git pull origin $git_branch &>> $log_file
|
git pull origin $git_branch &>> $log_file
|
||||||
|
echo "Git repository updated." >> $log_file
|
||||||
LED G 200
|
LED G 200
|
||||||
exit 1
|
|
||||||
else
|
else
|
||||||
# Move the existing payloads directory, in case hackers be hackin'
|
# Move the existing payloads directory, in case hackers be hackin'
|
||||||
mv payloads payloads-orig
|
mv payloads payloads-orig
|
||||||
|
echo "Existing 'payloads' directory preserved as 'payloads-orig'" >> $log_file
|
||||||
# Initialize Repository
|
# Initialize Repository
|
||||||
git init &>> $log_file
|
git init &>> $log_file
|
||||||
# Let's pick the hak5 github repo
|
# Let's pick the hak5 github repo
|
||||||
git remote add origin $git_repo &>> $log_file
|
git remote add origin $git_repo &>> $log_file
|
||||||
|
echo "Git repository selected: $git_repo" >> $log_file
|
||||||
# Instead of cloning the whole repo,
|
# Instead of cloning the whole repo,
|
||||||
git config core.sparsecheckout true
|
git config core.sparsecheckout true
|
||||||
|
echo "Git configuration change: sparse-checkout=true." >> $log_file
|
||||||
# isolate the payloads directory
|
# isolate the payloads directory
|
||||||
echo "payloads" >> .git/info/sparse-checkout
|
echo "payloads" >> .git/info/sparse-checkout
|
||||||
|
echo "Sparse checkout: 'payloads' directory selected" >> $log_file
|
||||||
# "git clone"
|
# "git clone"
|
||||||
git pull origin $git_branch &>> $log_file
|
git pull origin $git_branch &>> $log_file
|
||||||
|
echo "Git repository cloned." >> $log_file
|
||||||
|
|
||||||
# Ignore any existing directories or files, so git status is pretty
|
# Ignore any existing directories or files, so git status is pretty, and git pull will work after the "clone"
|
||||||
LED R B
|
LED R B
|
||||||
for file in $(ls -A); do
|
for file in $(ls -A); do
|
||||||
[[ "${file}" =~ [^payloads$] ]] && echo "${file}" >> .gitignore
|
[[ "${file}" =~ [^payloads$] ]] && { echo "${file}" >> .gitignore; echo ".gitignore add: ${file}" >> $log_file; }
|
||||||
done
|
done
|
||||||
|
echo "payloads/switch*" >> .gitignore
|
||||||
|
echo ".gitignore add: payloads/switch*" >> $log_file;
|
||||||
|
|
||||||
# Put the existing switch directories back
|
# Put the existing switch directories back
|
||||||
cp -r payloads-orig/switch* payloads/.
|
cp -r payloads-orig/switch* payloads/.
|
||||||
@@ -69,3 +77,4 @@ else
|
|||||||
# Git 'er done
|
# Git 'er done
|
||||||
LED G
|
LED G
|
||||||
fi
|
fi
|
||||||
|
echo " --------- Git Bunny Git [finished] ----------" >> $log_file
|
||||||
|
|||||||
Reference in New Issue
Block a user