https://github.com/miisterc/koth-tricks
Tricks i use while playing king of the hill in tryhackme
https://github.com/miisterc/koth-tricks
king-of-the-hill koth tryhackme tryhackme-koth
Last synced: 21 days ago
JSON representation
Tricks i use while playing king of the hill in tryhackme
- Host: GitHub
- URL: https://github.com/miisterc/koth-tricks
- Owner: MIISTERC
- Created: 2024-06-03T11:42:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-26T05:07:29.000Z (almost 2 years ago)
- Last Synced: 2025-06-04T12:16:33.846Z (10 months ago)
- Topics: king-of-the-hill, koth, tryhackme, tryhackme-koth
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Protect your king.txt
Level - 0:-
## If you are first to to root the machine follow the below steps to protect the king.
1.To prevent overwriting the `king.txt` file, you can set the `noclobber` option in your shell.
```sh
# Set the noclobber option to prevent overwriting files
set -o noclobber /root/king.txt
```
2.Make King.txt unwritable using `chattr` chattr makes king.txt unwritable even for root.
```sh
#add the immutable bit to king.txt and /root
chattr +ia /root/king.txt
chattr +ia /root
```
3.Make `king.txt` a read-only system file, make sure you are `root` before running the below command.
```sh
#the 'ro' makes king.txt a read-only system file.
sudo mount --bind -o ro /root/king.txt /root/king.txt 2>/dev/null
```
## Snatch Other's king and make it yours 😂
1.If you cant overwrite king.txt then someone already set noclobber on `king.txt` you can unset it by
```sh
set +o noclobber /root/king.txt
```
or
```sh
echo "USERNAME" >| /root/king.txt
```
2.When you write your username to `king.txt` and `operation not permitted` occurs then probably someone used `chattr` on king.txt or /root, you can easily remove the immutable bit from king.txt by
```sh
chattr -ia /root/king.txt
chattr -ia /root
```
3.If `read-only system file` appears when you write your name in it , then someone mounted it to make `king.txt` unwritable, some players also mount whole /root,to unmount it
```sh
sudo umount -l /root/king.txt
sudo umount -l /root
```
level - 1