[Bandit]OverTheWire - Part 1
WriteUp
Level0-1
WriteUp
ํด๋น ๋ฌธ์ ๋ SSH ์ ๊ทผ์ ๋ช ์ํ๋ ๋ด์ฉ์ผ๋ก..
์ฌ์ค ์ค๋ช ํ ๋ถ๋ถ์ ๋ณ๋ก ์์ง๋ง ์ ๋ฆฌํ์๋ฉด
ssh UserID@Server|Remote ip -p Port
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค


์ Xshell๋ก ์ ์ํ ๊ฑฐ๋ผ์.. ์์ผ๋ก๋ ๋น๋ฒ์ผ๋ก๋ง ๋ช ์ํ๊ฒ ์ต๋๋ค.
[Next Level]
ID : bandit1
PW : NH2SXQwcBdpmTEzi3bvBHMM9H66vVXjL
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค SSH ํด๋ผ์ด์ธํธ - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com
ssh(1) - Linux manual page
ssh(1) — Linux manual page SSH(1) BSD General Commands Manual SSH(1) NAME top ssh — OpenSSH remote login client SYNOPSIS top ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address
man7.org
Level1
WriteUp
๋ค์ ์ ์ฅ๋ ๋น๋ฒ์ ์์น๋ฅผ ๋ช ์ํฉ๋๋ค.
๋จ, ํ์ผ๋ช ์ - ๋ก์จ, ๊ธฐ๋ณธ์ ์ผ๋ก ์ ์ถ๋ ฅ์ ๋ช ์๋๋ ๋ฌธ๊ตฌ์ด๊ธฐ์
์ผ๋ฐ์ ์ธ ๋ฐฉ์์ผ๋ก๋ ์ถ๋ ฅ์ด ์๋๊ธฐ์ ๋ช ํํ๊ฒ ๋ช ์ํด์ค์ผํฉ๋๋ค.
cat ./- or cat < -
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

[Next Level]
ID : bandit2
PW : rRGizSaX8Mk1RTb1CNQoXTcYZWU6lgzi
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค cat - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com
Usage of dash (-) in place of a filename
For a command, if using - as an argument in place of a file name will mean STDIN or STDOUT. But in this example, it creates a file with the name -: echo hello > - How can I make - in this exa...
unix.stackexchange.com
Level2
WriteUp
๋ค์ ๋จ๊ณ๋ก ๋์ด๊ฐ๋ ํ์ผ์ด ๊ณต๋ฐฑ์ด ์ ์ฉ๋์ด ์๋ค๋ค์
ls -al
...(์๋ต)
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

[Next Level]
ID : bandit3
PW : aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค ls - ์ ํ์ํค
zetawiki.com
Level3
WriteUp
inhereํด๋ ๋ด์ ์จ๊ฒจ์ ธ ์๋ค๊ณ ํฉ๋๋ค.
cat spaces\ in\ this\ filename
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

[Next Level]
ID : bandit4
PW : 2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค ls - ์ ํ์ํค
zetawiki.com
Level4
WriteUp
์ฌ๋์ด ์ฝ์ ์ ์๋ ๋ฌธ์๋ก inhere์ ํด๋๋ด์ ์กด์ฌํ๋ค๊ณ ํฉ๋๋ค.
๊ทธ๋ฆฌ๊ณ ํฐ๋ฏธ๋์ด ํฝ๊ฐ๋ฉด reset ํด๋ณด๋ผ๊ณ ์ถ์ฒํ๋ค
file ./-*
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

์์์ฒ๋ผ ํ๋ ๊ฒ์ ๋ช ์ํ๋ ๊ฒ์ธ๋ฐ
์ ์คํฌ๋ฆฝํธ๋ ํจํด์ ํผํฉํ ํ์์ ๋๋ค.
[Next Level]
ID : bandit5
PW : lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค file - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com
Bash Reference Manual
This chapter describes how to use the GNU History Library interactively, from a user’s standpoint. It should be considered a user’s guide. For information on using the GNU History Library in other programs, see the GNU Readline Library Manual. 9.1 Bash
www.gnu.org
Bash command to find files that match file[0-9]+.js
I'm trying to work out how I can match files app1.js, app2.js, but NOT app-foo-1.js in a directory. Currently I have this in my bash script: for d in /home/chambres/web/x.org/public_html/2018/js/a...
stackoverflow.com
Level5
WriteUp
๋ค์ ๋จ๊ณ๋ก ๋์ด๊ฐ๋ ํ์ผ์ด ํ์ผ๋ก ๋๋ฌ์์ฌ ํด๋น ์กฐ๊ฑด์ด์ฌ์ผํฉ๋๋ค..
์คํ ํ์ผ์ด ์๋๋ฉฐ ํฌ๊ธฐ๋ 1033byte ๊ทธ๋ฆฌ๊ณ ์ฐ๋ฆฌ๊ฐ ์ฝ์ ์ ์๋ ํ์ ..

๊ทธ๋ผ find ๋ช ๋ น์ด ์ต์ ์ ํ์ฉํด์ ํ์ด๋ด ์๋ค.



find -type f -size 1033c ! -executable
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

[Next Level]
ID : bandit6
PW : P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU
์ฐธ๊ณ ๋ก ์๋ฐ์ ์ก์ผ๋ก..

์์ ๊ฐ์ด ls์์ -R(ํ์๊น์ง) ์ต์
์ ํ์ฉํ๋ฉด ์์ ๊ฐ์ด ์ฐพ๊ธฐ ๊ฐ๋ฅ
๋จ ์ ํํ ์์น๋ ๋ช
์๋ฅผ ์ํ๊ธฐ์ ์ด๋ฐ๊ฒ๋ ์๊ตฌ๋๋ผ๊ณ ์์๋ง ๋
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค find - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com
Level6
WriteUp
๋ค์ ๋จ๊ณ๋ก ๋์ด๊ฐ๋ ํ์ผ์ด ํ์ผ๋ก ๋๋ฌ์์ฌ ํด๋น ์กฐ๊ฑด์ด์ฌ์ผํฉ๋๋ค..
ํ์ผ ๊ถํ์ด bandit7์ ์๊ณ group์ 6์ด๊ณ 33size..
๊ทธ๋ผ find ๋ช ๋ น์ด ์ต์ ์ ํ์ฉํด์ ํ์ด๋ด ์๋ค.
find / -user bandit7 -group bandit6 -size 33c 2>/dev/null
/ from root folder
-user the owner of the file.
-group the group owner of the file.
-size the size of the file.
2>/dev/null redirects error messages to null so that they do not show on stdout.
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

[Next Level]
ID : bandit7
PW : z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S
Level7
WriteUp
data.txt์ ์ ์ฅ๋์ด ์๋ค๊ณ ํ๋, ์์ ๋ฐ์ดํฐ ์ค
millionth๋ผ๋ ๋จ์ด ์์ ์๋ ๋ชจ์์ด๋ค

๊ทธ๋ผ find ๋ช ๋ น์ด ์ต์ ์ ํ์ฉํด์ ํ์ด๋ด ์๋ค.

cat data.txt | grep 'millionth'
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค
[Next Level]
ID : bandit8
PW : TESKZC0XvTetK0S9xNwm25STk5iWrBvP
grep ๋ช ๋ น์ด๋ ํด๋น ํจํด์ ํตํด ์ฐพ๋ ์ต์ ์ ๋๋ค.
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค ๋ฌธ์์ด ํจํด ๊ฒ์ grep - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com
Level8
WriteUp
data.txt์ ์๋๋ฐ.. ํ ๋ผ์ธ์ ์ค์ง ํ ๋จ์ด๋ก๋ง ์๋ค๋ค์..
๊ทธ๋งํผ ์ ๋ํฌ ํ๋ค๋ ๊ฑฐ๊ฒ ์ฃ ?
Learn Piping and Redirection - Linux Tutorial
Learn how easy it is to use piping and redirection to create powerful workflows that will automate your work, saving you time and effort. In the previous two sections we looked at a collection of filters that would manipulate data for us. In this section w
ryanstutorials.net
์์ ๋งํฌ๋ ํด๋น ํ์ผ ๋ฆฌ๋ค์ด๋ ์
๊ณผ ํ์ดํ ๋ผ์ธ ์ค๋ช
์ ๋๋ดํ๋๋ฐ..
๋ฑํ ์ค๋ช
ํ ๋ถ๋ถ์ ์์ด๋ณด์ด๋ค์(๊ทธ๋๋ ํ ๋ฒ ๋ด๋ณด์ธ์)
๊ทธ๋ผ uniq ๋ช
๋ น์ด ์ต์
์ ํ์ฉํด์ ํ์ด๋ด
์๋ค.
sort๋ฅผ ํตํด ์ ๋ฆฌ ํ ํ๋ฉด ๋ ์ข๊ฒ ์ฃ ?

sort data.txt | uniq -u
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค

[Next Level]
ID : bandit9
PW : EN632PlfYiZbn3PhVK3XOGSlNInNE00t
์ฐธ๊ณ ์๋ฃ
๋ฆฌ๋ ์ค ์ค๋ณตํ ์ ๊ฑฐ uniq - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com
ํจ์ sort() - ์ ํ์ํค
sort sorted 1 Bash[ | ] ARR=(11 1 2 12) echo ${ARR[@]} # 11 1 2 12 SORTED=`for VALUE in "${ARR[@]}"; do echo $VALUE; done | sort -n` echo ${SORTED[@]} # 1 2 11 12 2 C++[ | ] #include #include using namespace std; int main() { int nums[] = {3,4,2,1}; int le
zetawiki.com
Level9
WriteUp
์ฌ๋์ด ์ฝ์ ์ ์๋ ํ์ผ์ด๋ฉฐ(๋ฌธ์์ด), ์ฌ๋ฌ๊ฐ์ = ๋ค์ ์๋ค๋ค์
๊ทธ๋ผ find ๋ช ๋ น์ด ์ต์ ์ ํ์ฉํด์ ํ์ด๋ด ์๋ค.

[Next Level]
ID : bandit10
PW : G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s
์ด์ .. ์ค๋ช ์ด ๊ท์ฐฎ์์์.. ๊ทธ๋ฅ ๋ฌธ์ ํ์ด๋ง ๋ณด์ฌ์ค๊ป์
ํ์ํ๋ค๊ณ ์๊ฐํ๋ ์ต์
์ด๋ ์๋ฃ๋ ์ฐธ๊ณ ์๋ฃ์ ์ฌ๋ฆฌ๊ฒ ์ต๋๋ค.
์ฐธ๊ณ ๋ก ^๋ ์ ๊ท์์ผ๋ก ์์์ด๋ผ๋ ์๋ฏธ์
๋๋ค.
์ฐธ๊ณ ์๋ฃ
RegExr: Learn, Build, & Test RegEx
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).
regexr.com
Level10
WriteUp
base64๋ก ์ธ์ฝ๋ฉ ๋์ด ์๋ ํ์ผ์ ํด์ํด์ผ๊ฒ ๋ค์
Base64๋ ์ด์ง-ํ ์คํธ ์ธ์ฝ๋ฉ ์ฒด๊ณ๋๋๋ค.
encode-decode์ ์๋ฏธ๋ฅผ ์ํธํ๋ฅผ ํ๊ณ ํ๊ณ ๋ผ๊ณ ์๊ฐํ์๋ฉด ๋ฉ๋๋ค.

[Next Level]
ID : bandit11
PW : 6zPeziLdR2RKNdNYFNb6nVCKzphlXHBM
์ฐธ๊ณ ์๋ฃ
Base64 - Wikipedia
From Wikipedia, the free encyclopedia Group of binary-to-text encoding schemes using 64 symbols (plus padding) In computer programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit
en.wikipedia.org
Level11
WriteUp
Rot13์ด๋ผ๊ณ ์ผ์ข
์ ์นด์ด์ฌ๋ฅด ์ํธ์ธ ๊ฑฐ ๊ฐ์ต๋๋ค.
lowercase๋ uppercase ๋ ๋ค ํฌํจํด์ 13๋งํผ ๋ฐ๋ ค๋ฒ๋ฆฌ๋ฉด ๋ฉ๋๋ค.
ROT13 - Wikipedia
From Wikipedia, the free encyclopedia Simple encryption method ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it in the latin alphabet. ROT13 is a special
en.wikipedia.org
ํด๋น ๋งํฌ์ ๋ค์ด๊ฐ์๋ฉด ์ค๋ช ๋ฐ ์ฝ๋.. ๊น์ง ์๋ ค์ฃผ๋๋ผ๊ณ




[A-Za-z][N-ZA-Mn-za-m]
์์ ๊ฐ์ด ์ ์ผ์๋ฉด ๋ฉ๋๋ค
๋์๋ฌธ์๋ฅผ ์์๋ฅผ ์์ฑ ํ → ํด๋น Rot13์ ์นด์ด์ฌ๋ฅด ์ํธ์ ๋ง๊ฒ..
ํด๋น ๋ฌธ์์ ์์น๋ฅผ ์ง์ ํ๋ ๋ชจ์ต์
๋๋ค.

tr [old or pattern] [new or pattern]์ผ๋ก ์ ์ด์ฃผ๋ฉด ๋ฉ๋๋ค.
๋ฌผ๋ก ๋ค๋ฅธ ์ต์ ๋ ์์ง๋ง ๋๊ฒ ์ด๋ ๊ฒ ์ฌ์ฉํฉ๋๋ค.
[Next Level]
ID : bandit12
PW : JVNBBFSmZwKKOP0XbFXOoW8chDz5yVRv
์ฐธ๊ณ ์๋ฃ
ROT13 - Wikipedia
From Wikipedia, the free encyclopedia Simple encryption method ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it in the latin alphabet. ROT13 is a special
en.wikipedia.org
์นด์ด์ฌ๋ฅด ์ํธ - ์ํค๋ฐฑ๊ณผ, ์ฐ๋ฆฌ ๋ชจ๋์ ๋ฐฑ๊ณผ์ฌ์
์ํค๋ฐฑ๊ณผ, ์ฐ๋ฆฌ ๋ชจ๋์ ๋ฐฑ๊ณผ์ฌ์ . ์นด์ด์ฌ๋ฅด ์ํธ๋ ๊ฐ๊ฐ์ ์ํ๋ฒณ์ ์ผ์ ํ ๊ฑฐ๋ฆฌ๋งํผ ๋ฐ์ด ๊ธ์๋ฅผ ์นํํ๋ ๋ฐฉ์์ผ๋ก ์ํธํํ๋ค. ์ ์์ ์์๋ 3๊ธ์์ฉ ๋ฐ์ด์ ์ํธํํ๊ธฐ ๋๋ฌธ์ B๋ E๋ก ์น
ko.wikipedia.org
Level12
WriteUp
data.txt์ ์๋๋ฐ ๊ณ์ ์์ถํ๋ค๊ณ ํฉ๋๋ค.
๋ํ /tmp ๊ฒฝ๋ก์ ๊ฐ์ ํด๋น ํ์ผ์ ๋ณต์ ํ์ฌ ์์
์ ํ์๋ผ๊ณ ํฉ๋๋ค.

file๋ก ์์ฑ์ ํ์ธํ๋ฉด ASCII file๋ก 16์ง์ ๋คํ๋ฅผ ์ญ์ผ๋ก ๋ณํํด์ผ๊ฒ ๋ค์
๋ํ ์์ ๋ฉ๋ด์ผ์์ tmp์์ ๋ณต์ ํด์ ์์
ํ๋ผ๊ณ ํ์ผ๋๊น..

์์ ๊ฐ์ด ์์ ์ ํ์๋ฉด ๋ฉ๋๋ค
Hex dump - Wikipedia
From Wikipedia, the free encyclopedia Hexadecimal view of computer data In computing, a hex dump is a hexadecimal view (on screen or paper) of computer data, from memory or from a computer file or storage device. Looking at a hex dump of data is usually do
en.wikipedia.org
์ด์ OverTheWire์์ ์ ๊ณตํ ํํธ๋ก Hex Dump์ ๋ด์ฉ์ ์ฝ์ด๋ณด์๊ณ ..

์์ ๊ฐ์ด ์ญ๋คํ๋ฅผ ์คํํ๊ณ ํ์ธํด๋ณด๋ฉด
gzip์ด๋ผ๋ ์์ถํ์ผ๋ก ๋ฌถ์ฌ์๋ data2.bin๋ผ๊ณ ํ์ธ ํ ์ ์์ต๋๋ค.




[Next Level]
ID : bandit13
PW : wbWdlBxEir4CaE8LaPhauuOo6pwRmrDw
์ฐธ๊ณ ์๋ฃ
Hex dump - Wikipedia
From Wikipedia, the free encyclopedia Hexadecimal view of computer data In computing, a hex dump is a hexadecimal view (on screen or paper) of computer data, from memory or from a computer file or storage device. Looking at a hex dump of data is usually do
en.wikipedia.org
hexdump command in Linux with examples - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
๋ฆฌ๋ ์ค xxd - ์ ํ์ํค
๋ค์ ๋ฌธ์์ด ํฌํจ...
zetawiki.com