Giter Site home page Giter Site logo

koth-tricks's Introduction

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.

# 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.

#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.

#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

set +o noclobber /root/king.txt

or

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

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

sudo umount -l /root/king.txt
sudo umount -l /root

level - 1

koth-tricks's People

Contributors

miisterc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.