From f3bf6627955aab25d3137d295575ff9b90f448b0 Mon Sep 17 00:00:00 2001 From: "Rick Farina (Zero_Chaos)" Date: Thu, 12 Dec 2019 10:27:59 -0500 Subject: [PATCH] wait_for_link don't blindly execute the payload, wait for a link first at least --- usr/bin/LED | 4 ++++ usr/bin/shark_framework | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/usr/bin/LED b/usr/bin/LED index b20a51a..0c54d21 100755 --- a/usr/bin/LED +++ b/usr/bin/LED @@ -88,6 +88,10 @@ function parse_state() { } case $1 in + "LINKSETUP") + parse_color "M" + parse_pattern "SLOW" + ;; "SETUP") parse_color "M" parse_pattern "SOLID" diff --git a/usr/bin/shark_framework b/usr/bin/shark_framework index 33ed895..9648f23 100755 --- a/usr/bin/shark_framework +++ b/usr/bin/shark_framework @@ -98,6 +98,14 @@ function execute_upgrade() { } } +function wait_for_link() { + LED LINKSETUP + while mii-tool eth0 | grep -q 'eth0: no link'; do + sleep 1 + done + LED SETUP +} + function execute_payload() { $LOG "Executing PAYLOAD" @@ -155,6 +163,7 @@ function enter_attack_mode() { stop_http stop_ssh + wait_for_link execute_payload enter_idle_mode