From 8b2ae0d16c25f983307ff5637f9ddc1ea6b25f4c Mon Sep 17 00:00:00 2001 From: moliata Date: Wed, 4 Jul 2018 12:04:58 +0300 Subject: [PATCH] Uptime payload Uptime payload is based on LAN Turtle's Uptime module (find out more at: https://github.com/hak5/lanturtle-modules/blob/gh-pages/modules/uptime). Payload's lifecycle: check if USB is available and if it is, continue -> setup environment by choosing NETMODE to be transparent, making uptime directory at the loot folder and waiting for 5 seconds -> make an infinite loop waiting for button click -> on click, log uptime to uptime.log file. --- payloads/library/general/Uptime/payload.sh | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 payloads/library/general/Uptime/payload.sh diff --git a/payloads/library/general/Uptime/payload.sh b/payloads/library/general/Uptime/payload.sh new file mode 100644 index 0000000..9fe7c63 --- /dev/null +++ b/payloads/library/general/Uptime/payload.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Title: Uptime +# Description: The uptime payload displays the current time, the length of time the system has been up, the number of users, and the load average of the system over the last 1, 5, and 15 minutes. +# Author: Moliata +# Version: 1.0 +# Category: general +# Target: Packet Squirrel by Hak5 +# Net Mode: TRANSPARENT +function start() +{ + LED SETUP + NETMODE TRANSPARENT + mkdir -p /mnt/loot/uptime + sleep 5 +} +function run() { + LED ATTACK + while true + do + BUTTON && { + uptime >> /mnt/loot/uptime/uptime.log + LED FINISH + } + done +} +[[ ! -f /mnt/NO_MOUNT ]] && { + start && run +} || { + LED FAIL +}