Example Project
Overthewire
Over The Wire Challenges
- Published
- Reading time
- 2 min read
- Detail
- Active
- Detail
- Handwritten
On this page
Why this exists
This is the levelling up of ssh and Linux
Full Picture Projects— screenshots of results for the matching exercise.
Level 0: Connecting To The Network
ssh bandit0@bandit.labs.overthewire.org -p 2220The Breakdown:
sshSecure Shell - Remote Access
-pPort
Level 1: Find The Read Me File
ls
cat readme
exitThe Breakdown:
lsList: Lists all files and directories
catConcatenate Files - Reads one or more files and copies them to standard output.
exitExit - Leaves the secure shell.
Level 2: Dashed Files
ls
cat ./-cat ./-For this command to work we need to specify that we are looking at the file - inside of the directory otherwise cat - will produce a different outcome.
Level 3: –spaces file–
ls
cat "./--in this file--"
exitcat "./--in this file--"Files that have spaces in them need to be in quotation mark so the shell knows it is a file.
Level 4: Outhere Directory (Hidden File)**
ls -a
cd ./outhere
cat :/Hiding_From_You
exitls -aLists are folders and files that are marked private as well as all that are not.
Level 5: Outhere Directory (Find Inside Multiple Files)
ls
cd ./outhere
file ./*
cat ./-correctfile07
exitfile ./*This checks each type of the files in the directory
Level 6: Outhere Directory (File With Specific Metrics)
ls
cd ./outhere
find . type-f -size 1033c ! -executable
cat ./couldbe06/.file01
exitfind . type-f -size 1033c ! -executablefind - searches the entire file system from the top to the bottom
-type f will find files only. -size 1033c exactly 1033 bytes. ! -executable excludes executable files
Level 7: Finding Somewhere On The Server
ls -la
find size -33c
find type -f user bandit7 -group bandit6 -size 33c
find type -f user bandit7 -group bandit6 -size 33c 2>/dev/null
cat /var/lib/abcd/info/bandit7.password
exitfind type -f user bandit7 -group bandit6 -size 33ctype -f: only regular files -user bandit7: Owned by that user. - group bandit6: Owned by that group.
2>/dev/nullMeans “send error output to the discard bin.”
Level 8: Thousands Of Lines In a File
ls -l data.txt
grep millionth data.txt
exitgrep millionth data.txtgrep: search for lines that match a pattern. - millionth: the text to look for. - data.txt: the file to search in.
Level 9: Unique Line
sort data.txt
sort data.txt | uniq -u
exitsort data.txtsort: orders the lines so identical ones sit together
sort data.txt | uniq -u|: feeds sorts output into the next command. - uniq -u prints only the lines that appear exactly once.
Level 10: Unique Character
strings data.txt
strings data.txt | grep =
exitstrings data.txtstrings: pulls out only printable text from a binary file