So, a li’l break from OverTheWire wargames, I tried this platform to learn the basics. This one is way more interactive and interesting…
The first requirement is to deploy the machine.
[Task 6] [Section 2: Running Commands] — Manual Pages and Flags
- How would you output hello without a newline
echo -n hello
[Task 7] [Section 3: Basic File Operations] — ls
- What flag outputs all entries
-a
- What flag outputs things in a “long list” format
-l
[Task 8] [Section 3: Basic File Operations] — cat
- What flag numbers all output lines?
-n
[Task 10] [Section 3: Basic File Operations] — Running A Binary
- How would you run a binary called hello using the directory shortcut . ?
./hello
- How would you run a binary called hello in your home directory using the shortcut ~ ?
~/hello
- How would you run a binary called hello in the previous directory using the shortcut .. ?
../hello
[Task 11] Binary — Shiba1
- What’s the password for shiba2
pinguftw
[Task 12] su
- How do you specify which shell is used when you login?
su -s
[Task 13] [Section 4 — Linux Operators]: Intro
su shiba2
[Task 14] [Section 4: Linux Operators]: “>”
echo twenty > test
[Task 15] [Section 4: Linux Operators]: “»”
[Task 16] [Section 4: Linux Operators]: “&&”
[Task 18] [Section 4: Linux Operators]: “$”
- How would you set nootnoot equal to 1111?
export nootnoot=1111
- What is the value of the home environment variable?
/home/shiba2
[Task 21] Binary — shiba2
- What is shiba3’s password?
happynootnoises
[Task 24] [Section 5: Advanced File Operations]: chmod
- What permissions mean the user can read the file, the group can read and write to the file, and no one else can read, write or execute the file?
460
- What permissions mean the user can read, write, and execute the file, the group can read, write, and execute the file, and everyone else can read, write, and execute the file?
777
[Task 25] [Section 5: Advanced File Operations] — chown
- How would you change the owner of file to paradox
chown paradox file
- What about the owner and the group of file to paradox
chown paradox:paradoox file
- What flag allows you to operate on every file in the directory at once?
-r
[Task 26] [Section 5: Advanced File Operations] — rm
- What flag deletes every file in a directory
-r
- How do you suppress all warning prompts
-f
[Task 27] [Section 5: Advanced File Operations] — mv
- How would you move file to /tmp
mv file /tmp
[Task 29] [Section 5: Advanced file Operations] — cd && mkdir
- Using relative paths, how would you cd to your home directory.
cd ~
- Using absolute paths how would you make a directory called test in /tmp
mkdir /tmp/test/
[Task 30] [Section 5: Advanced File Operations] ln
- How would I link /home/test/testfile to /tmp/test
ln /home/test/testfile /tmp/test
[Task 31] [Section 5 — Advanced File Operations]: find
- How do you find files that have specific permissions?
-perm
- How would you find all the files in /home
find /home
- How would you find all the files owned by paradox on the whole system
find / -user paradox
[Task 32] [Section 5: Advanced File Operations] — grep
- What flag lists line numbers for every string found?
-n
- How would I search for the string boop in the file aaaa in the directory /tmp
grep boop /tmp/aaaa
[Task 33] Binary — Shiba3
- What is shiba4’s password
find / -name shiba4 | grep shiba4 | grep shiba4 cd /opt/secret ./shiba4 test1234
[Task 35] [Section 6: Miscellaneous]: sudo
- How do you specify which user you want to run a command as.
-u
- How would I run whoami as user jen?
sudo -u jen whoami
- How do you list your current sudo privileges(what commands you can run, who you can run them as etc.)
-l
[Task 36] [Section 6: Miscellaneous]: Adding users and groups
- How would I add the user test to the group test
sudo usermod -a -G test test
[Task 43] Bonus Challenge — The True Ending
Let’s search through each user’s files.
find / -user <username> -type f 2>>/dev/null
cat /var/log/test1234
Permission Denied!!!
ls -l /var/log/test1234
It’s belong to shiba2
su shiba2
cat /var/log/test1234
su nootnoot
Check if nootnoot can run sudo
sudo -l
nootnoot can run sudo command
sudo cat /root/root.txt
And yey! I got my first badge!