Hi,
Given the current economical crisis, I decided to learn Linux to get new opportunities. After some research, I've noticed that "Over the wire" is an great site to start explore Ubuntu and understand promt from it perspective.
Moreover, I don't have portifolium and I definitely need to improve my STAR explianing. So, paralell to my learning, I will share my experience here and GitHub.
Here, I won't decribe the challenges, but I would like to share links, terminal command and steps that help me understand how to archive the level. So, los geht's!
Level 1 to 12:
- Level 0: In this level you just need to connect to the server. Is important to understand how the logic to connect to the server:
ssh @ -p
- Level 1:
Relevant commands:
cat: Open file
copy: ctrl + shift + C
paste: ctrl + shift + v
** Important: if the file is called "-" to open it we must use: "cat <-" or "cat ./-"
- Level 2:
To read files with spaces in the name we must type the name of the file between apostrophe. Example: 'file name'
*- Level 3: *
Open all the files of a directory: ls -a
- Level 4:
du: returns the size of every subdirectory inside of a directory.
du -h: shows all the human readable format files.
** To open a file inside a directory, that is inside another directory you must define the "directory/filename".
- Level 5:
ls -lh: detail information and humam executable from files in a directory.
find .-maxdepth x -type f !executable -ls
find is to find
.-maxdepth x : how deep you would like to look up into the directories
-type f: restrict only to regular files
! : not
-executable : type of the files
-ls: where to find
- Level 6:
It's possible to find a file by the size, user and group in the server. The command below makes this possible:
find / -type f -size 33c -user bandit7 -group bandit6
find: to find something
/: look from the root
-type f: restrict only to regular files
-size 33c: define the size and add the c after the number to restrict to that size.
-user: define the user after it
-group: define the group after group
- Level 7:
pwd: show the currently directory path
to find a string in files inside a directory:
grep -rnw 'directory path' -e '<string>'
grep: command plaintext data set for lines that match a regular expression
-rnw: recursive, line number, whole world
-e: pattern used to search
*- Level 8: *
In order to find a string that repeats in a file we must use the command "sort".
sort <file.txt> | uniq -u (this case shows only the unique strings)
sort <file.txt> | uniq -c (this case shows the strings and how many times they repeat)
- Level 9:
To find a string inside a document:
strings {document name.type} | grep -A1 '{string}'
strings = extracts printable strings from the file
grep = a expression to helps search for a specific text within files
A1 = number the lines after it you would line to show
- Level 10:
Base64 = binary-to-text encoding scheme that represents binary data in ASCII string format by translating into a radix-64 representation. AKA, Some systems (like email or web URLs) don't work well with raw binary data (like images or files). Base64 converts that data into plain text that can safely be sent or stored.
cat {document} | base64 --decode
cat = read document
| = action after it
base64 = code to be decoded
--decode = to decode the code
- Level 11:
ROT13 = is a simple letter substitution cipher used to obsure text.
tr 'A-Za-z' 'N-ZA-Mn-za-m'
tr = translating or deleting character in linux the following sequence is the translation from ROT13.
- Leve 12:
Hexdump = hexdump is a command that show the contet of a file in hexadecimal format (base 16). When a file does not contain a text data, like images and compiled programs, so you can see the raw bytes.
Steps to decode: https://mayadevbe.me/posts/overthewire/bandit/level13/
I hope this help you like it helped me. :)
Top comments (0)