Skip to content

Instantly share code, notes, and snippets.

@rhovelz
Created August 27, 2020 09:43
Show Gist options
  • Save rhovelz/e2f80d3b2cdeecb81e210684a6a16d46 to your computer and use it in GitHub Desktop.
Save rhovelz/e2f80d3b2cdeecb81e210684a6a16d46 to your computer and use it in GitHub Desktop.

Trick to stay as king on KOTH from Tryhackme.

Method 1

#!/bin/bash
while :
do
        eval "echo [usernameHere] >> /root/king.txt"
        eval " > /root/king.txt"
done

Method 2

while [[ $(cat /root/king.txt) != "[usernameHere]" ]]; do echo "[usernamehere]" >> /root/king.txt; done

Method 3 with crontab

* * * * * echo "[usernameHere]" >> /root/king.txt >/dev/null 2>&1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment