From 6e7292699b419199cc5339241cafbd0c116459e1 Mon Sep 17 00:00:00 2001 From: Nicholas Adamou Date: Sun, 9 Apr 2017 22:00:00 -0400 Subject: [PATCH] Updated GitBunnyGit to work with Firmware v1.1 (#145) --- payloads/library/GitBunnyGit/README.md | 2 +- payloads/library/GitBunnyGit/payload.txt | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) mode change 100644 => 100755 payloads/library/GitBunnyGit/README.md mode change 100644 => 100755 payloads/library/GitBunnyGit/payload.txt diff --git a/payloads/library/GitBunnyGit/README.md b/payloads/library/GitBunnyGit/README.md old mode 100644 new mode 100755 index 6a1ee439..5917f94a --- a/payloads/library/GitBunnyGit/README.md +++ b/payloads/library/GitBunnyGit/README.md @@ -1,6 +1,6 @@ # Git-Bunny-Git -Author: Draxiom & audibleblink +Author: Draxiom & audibleblink & Nicholas Adamou Version: 1.0 ## Description diff --git a/payloads/library/GitBunnyGit/payload.txt b/payloads/library/GitBunnyGit/payload.txt old mode 100644 new mode 100755 index 7e7a9706..c39e7fe1 --- a/payloads/library/GitBunnyGit/payload.txt +++ b/payloads/library/GitBunnyGit/payload.txt @@ -1,9 +1,9 @@ #!/bin/bash # Title: Git Bunny Git -# Author: Draxiom && audibleblink +# Author: Draxiom && audibleblink && Nicholas Adamou # Target: any -# Version: 1.0 +# Version: 1.1 # # Update payloads from Github # @@ -14,9 +14,9 @@ # Green (blinking) | Git Pull Finished # Green | Git Clone Finished -LED R G B -ATTACKMODE RNDIS_ETHERNET -#ATTACKMODE ECM_ETHERNET +LED W +#ATTACKMODE RNDIS_ETHERNET +ATTACKMODE ECM_ETHERNET # 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" @@ -24,17 +24,21 @@ git_branch="master" payloads_dir="/root/udisk" log_file="/var/log/git.log" +if [ -f "$log_file" ]; then + rm -rf "$log_file" +fi + 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; } +[[ ! `mount | grep "nandf"` ]] && { LED R DOUBLE; echo "Could not mount filesystem" >> $log_file; exit 1; } # Test for internet connection wget -q --tries=15 --timeout=5 --spider http://example.com [[ "$?" -ne 0 ]] && { LED R; echo "Could not connect to the internet" >> $log_file; exit 1; } # Let's go -LED R G +LED Y cd $payloads_dir # Cannot verify ca certificate... skip it @@ -43,7 +47,7 @@ if [ -d ".git" ]; then # Get the newest payloads git pull origin $git_branch &>> $log_file echo "Git repository updated." >> $log_file - LED G 200 + LED G SLOW else # Move the existing payloads directory, in case hackers be hackin' mv payloads payloads-orig @@ -53,7 +57,7 @@ else # Let's pick the hak5 github repo 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 echo "Git configuration change: sparse-checkout=true." >> $log_file # isolate the payloads directory @@ -64,7 +68,7 @@ else echo "Git repository cloned." >> $log_file # Ignore any existing directories or files, so git status is pretty, and git pull will work after the "clone" - LED R B + LED M for file in $(ls -A); do [[ "${file}" =~ [^payloads$] ]] && { echo "${file}" >> .gitignore; echo ".gitignore add: ${file}" >> $log_file; } done