shark-files/usr/bin/shark_framework

250 lines
5.9 KiB
Plaintext
Raw Permalink Normal View History

Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
#!/bin/sh
2019-12-11 21:11:53 +00:00
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
export LOG="logger -t Shark [*]"
export LOG_ERR="logger -t Shark -p 3 [!]"
2019-12-11 21:11:53 +00:00
MODE="OFF"
SWITCH_POSITION=$(/usr/bin/SWITCH)
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
upgrade_leds() {
2019-12-11 21:11:53 +00:00
/usr/bin/LED OFF
while true
do
echo 1 > /sys/class/leds/shark:red:system/brightness
sleep 0.2
echo 0 > /sys/class/leds/shark:red:system/brightness
echo 1 > /sys/class/leds/shark:blue:system/brightness
sleep 0.2
echo 0 > /sys/class/leds/shark:blue:system/brightness
done
}
# $1: Upgrade file
# $2: MD5 file
# $3: Upgrade file size in bytes
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
extract_md5() {
dd if="${1}" of="${2}" skip="${3}" bs=1 count=33
2019-12-11 21:11:53 +00:00
}
# $1: Upgrade file
# $2: MD5 file
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
verify_md5() {
expected=$(cat "${2}")
checksum=$(md5sum "${1}" | awk '{print $1}')
[ "${expected}" = "${checksum}" ] && {
2019-12-11 21:11:53 +00:00
return 0
}
return 1
}
# $1: Upgrade file
# $2: Upgrade file size in bytes
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
truncate_upgrade() {
dd if=/dev/null of="${1}" bs=1 seek="${2}"
2019-12-11 21:11:53 +00:00
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
execute_upgrade() {
2019-12-11 21:11:53 +00:00
# Check for upgrade file in default location
$LOG "Checking for firmware upgrade"
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
upgrade_file=$(find /root/upgrade-*.bin -type f 2>/dev/null | tail -n1)
2019-12-11 21:11:53 +00:00
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if [ -f "${upgrade_file}" ]; then
2019-12-11 21:11:53 +00:00
# Upgrade file found
$LOG "Firmware upgrade found"
$LOG "Verifying firmware upgrade"
2021-08-16 18:50:14 +00:00
upgrade_file_size=$(( $(wc -c "${upgrade_file}" | awk '{print $1}') - 33 ))
2019-12-11 21:11:53 +00:00
# Extract md5sum from upgrade file
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
extract_md5 "${upgrade_file}" /tmp/upgrade.md5 "${upgrade_file_size}"
2019-12-11 21:11:53 +00:00
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
cp "${upgrade_file}" /tmp/upgrade.bin
truncate_upgrade /tmp/upgrade.bin "${upgrade_file_size}"
2019-12-11 21:11:53 +00:00
# Verify upgrade file
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if ! verify_md5 /tmp/upgrade.bin /tmp/upgrade.md5; then
2019-12-11 21:11:53 +00:00
# Upgrade file not verified; exit
$LOG "Firmware upgrade not verified. File may be corrupt"
LED FAIL &
return 1
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
fi
2019-12-11 21:11:53 +00:00
$LOG "Firmware upgrade verified"
LED OFF && LED SUCCESS
# Check battery state first
$LOG "Checking device power state"
battery_state=$(/usr/bin/BATTERY)
if [ "${battery_state}" = "discharging" ] && [ ! -f "/etc/shark/cable" ]; then
2019-12-11 21:11:53 +00:00
# Device is not plugged in
$LOG "Device is not powered. Do not attempt firmware upgrade"
return 1
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
fi
2019-12-11 21:11:53 +00:00
$LOG "Device is powered"
# Remove upgrade file
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
rm -rf "${upgrade_file}"
2019-12-11 21:11:53 +00:00
sync
# Upgrade file verified; run upgrade
$LOG "Executing UPGRADE"
sleep 2 && upgrade_leds &
echo "sysupgrade -n /tmp/upgrade.bin" | at now
exit
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
else
2019-12-11 21:11:53 +00:00
# Upgrade file not found; enter arming mode
$LOG "Firmware upgrade not found"
return 1
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
fi
2019-12-11 21:11:53 +00:00
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
configure_network() {
2019-12-12 18:46:46 +00:00
cp "/usr/lib/hak5/shark/config/${SWITCH_POSITION}/network" /etc/config/network
2019-12-11 21:11:53 +00:00
/etc/init.d/network restart
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
start_http() {
2019-12-11 21:11:53 +00:00
/etc/init.d/uhttpd start
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
stop_http() {
2019-12-11 21:11:53 +00:00
/etc/init.d/uhttpd stop
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
start_ssh() {
2019-12-11 21:11:53 +00:00
/etc/init.d/sshd start
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
stop_ssh() {
2019-12-11 21:11:53 +00:00
/etc/init.d/sshd stop
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
start_dnsmasq() {
#remove old dhcp options before setting new
uci -q delete dhcp.lan.dhcp_option
#disables gateway, netmode re-enables it
uci add_list dhcp.lan.dhcp_option="3"
uci commit
/etc/init.d/dnsmasq start
}
stop_dnsmasq() {
/etc/init.d/dnsmasq stop
}
enter_attack_mode() {
2019-12-11 21:11:53 +00:00
$LOG "Entering ATTACK mode"
MODE="ATTACK"
/usr/bin/LED OFF
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
stop_dnsmasq
ip link set eth0 down
macchanger -r eth0
2019-12-11 21:11:53 +00:00
configure_network
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
#nothing starts this, but ensure it only runs with
pkill -9 udhcpc
2019-12-11 21:11:53 +00:00
stop_http
stop_ssh
echo "execute_payload" | at now
2019-12-11 21:11:53 +00:00
enter_idle_mode
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
enter_arming_mode() {
2019-12-11 21:11:53 +00:00
$LOG "Entering ARMING mode"
MODE="ARMING"
/usr/bin/LED OFF
configure_network
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
start_dnsmasq
2019-12-11 21:11:53 +00:00
start_http
start_ssh
enter_idle_mode
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
enter_off_mode() {
2019-12-11 21:11:53 +00:00
$LOG "Entering OFF mode"
MODE="OFF"
/usr/bin/LED OFF
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
/etc/init.d/network stop
stop_dnsmasq
2019-12-11 21:11:53 +00:00
stop_http
stop_ssh
enter_idle_mode
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
enter_idle_mode() {
2019-12-11 21:11:53 +00:00
$LOG "Entering IDLE mode"
while true
do
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if [ "${MODE}" = "ARMING" ] || [ "${MODE}" = "OFF" ]; then
#ARMING mode is basically always idle which means this overrides user LED
#status once per second. Don't override user status with idle status.
2019-12-11 21:11:53 +00:00
BATTERY_STATE=$(/usr/bin/BATTERY)
case $BATTERY_STATE in
"charging")
pgrep LED > /dev/null || /usr/bin/LED B SLOW
2019-12-11 21:11:53 +00:00
;;
"full")
pgrep LED > /dev/null || /usr/bin/LED B
2019-12-11 21:11:53 +00:00
;;
"cable")
# Do nothing with battery if we're a sharkjack cable platform
;;
2019-12-11 21:11:53 +00:00
*)
pgrep LED > /dev/null || /usr/bin/LED Y SLOW
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if [ "${MODE}" = "OFF" ]; then
#sleep 2
#halt
$LOG "battery state other ($BATTERY_STATE) would halt"
2019-12-11 21:11:53 +00:00
fi
;;
esac
fi
SWITCH_POSITION=$(/usr/bin/SWITCH)
case $SWITCH_POSITION in
"switch3")
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if [ "${MODE}" != "ATTACK" ]; then
2019-12-11 21:11:53 +00:00
enter_attack_mode
fi
;;
"switch2")
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if [ "${MODE}" != "ARMING" ]; then
2019-12-11 21:11:53 +00:00
execute_upgrade || enter_arming_mode
fi
;;
*)
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
if [ "${MODE}" != "OFF" ]; then
2019-12-11 21:11:53 +00:00
enter_off_mode
fi
;;
esac
sleep 1
done
}
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
run() {
2019-12-11 21:11:53 +00:00
case $SWITCH_POSITION in
"switch3")
enter_attack_mode
;;
"switch2")
execute_upgrade || enter_arming_mode
;;
*)
enter_off_mode
;;
esac
}
# Start framework after a short wait
sleep 2
Housekeeping (#7) * fix LED killing * do not autostart unneeded services ntp: we don't want to leak in attack mode and arming mode doesn't even have internet. user's who want this can start it themselves dnsmasq: we should start this when needed rather than killing it when not needed, speed boot by not starting then killing * NETMODE: use dnsmasq netmode was improperly calling odhcpd when we use dnsmasq, just call dnsmasq * start dnsmasq when needed have shark service start dnsmasq in arming mode and stop it in attack and off mode * randomize mac with macchanger currently mac is randomized because it is unable to read the actual mac. If there gets fixed then the mac won't be randomized. Let's intentionally randomize the mac to be sure we are random enough * ensure netmode dhcp_server provides default gateway * prototype out switching between gateway and no gateway * actually disable gateway in arming mode * disable openvpn I don't know why this is trying to start, but let's not * better LED anti-suicide * permissions count * execute_payload: fix shellcheck warnings * convert BATTERY to posix runtime cut from 0.051s to 0.021s on average * shellcheck cleanup simplify script while doing it, use faster sh instead of bash * DO_A_BARREL_ROOL: this was posix anyway, so use posix * execute_payload: mostly posix, consider refactor * cleanup LED a bit partially elminate bashisms when possible to do cleanly shellcheck fixes for anti-hari kari (and it's faster) * POSIX NETMODE this was already posix except for function definitions * POSIX shark_framework fix minor logic error and posixify * shark_framework: save an awk * SWITCH: posix * LED: fix logic for SC2015 warnings * move wait_for_link and add wait_for_no_link a few additional fixes based on testing * fix macchanger and wait_for_link * remove unneeded note * This is where you change the mac address * We do not need network in off mode, no services anyway * ensure no dhcp during attack mode until requested * bash or python, but not php * The function is simple enough to not need a comment --Foxtrot
2020-01-24 02:44:17 +00:00
run > /dev/null 2>&1 &