๐Ÿง Linux (Bandit)

[OverTheWire][Linux] Bandit Level6 -> Level7

์„ ๋‹ฌ 2024. 12. 23. 08:08
๋ฐ˜์‘ํ˜•

๋ฌธ์ œ

Level Goal

The password for the next level is stored somewhere on the server and has all of the following properties:

  • owned by user bandit7
  • owned by group bandit6
  • 33 bytes in size

Commands you may need to solve this level

ls , cd , cat , file , du , find , grep

 

ํ’€์ด

ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ls -al ํ•ด๋„ ์•„๋ฌด๊ฒƒ๋„ ์•ˆ๋œฌ๋‹ค (!!) 

๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ๋ถ€ํ„ฐ ์ฐพ์•„์•ผํ•˜๋Š” ๋ฌธ์ œ๋‹ค

 

bandit6@bandit:~$ find / -user bandit7 -group bandit6 -size 33c 2>/dev/null

 

  • find / : ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ(/)๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด์„œ ๋ชจ๋“  ํŒŒ์ผ๊ณผ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์žฌ๊ท€์ ์œผ๋กœ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค.
  • -user bandit7 : bandit7 ์‚ฌ์šฉ์ž๊ฐ€ ์†Œ์œ ํ•œ ํŒŒ์ผ๋งŒ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค.
  • -group bandit6 : bandit6 ๊ทธ๋ฃน์— ์†ํ•œ ํŒŒ์ผ๋งŒ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค.
  • -size 33c : ํฌ๊ธฐ๊ฐ€ ์ •ํ™•ํžˆ 33 ๋ฐ”์ดํŠธ์ธ ํŒŒ์ผ๋งŒ ์ฐพ์Šต๋‹ˆ๋‹ค. c๋Š” ํฌ๊ธฐ๋ฅผ ๋ฐ”์ดํŠธ ๋‹จ์œ„๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
  • 2>/dev/null :๊ถŒํ•œ์ด ์—†์–ด์„œ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅํ•˜์ง€ ์•Š๋„๋ก ์ˆจ๊น๋‹ˆ๋‹ค.

๋งˆ์ง€๋ง‰ ์š”์†Œ๋งŒ ์ž˜ ๊ธฐ์–ตํ•˜๋ฉด ๋  ๋“ฏ ํ•˜๋‹ค

 

  1. 2>
    • 2๋Š” ํ‘œ์ค€ ์—๋Ÿฌ(standard error, stderr)๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
    • >๋Š” ๋ฆฌ๋””๋ ‰์…˜ ์—ฐ์‚ฐ์ž๋กœ, ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ๋‹ค๋ฅธ ๊ณณ์œผ๋กœ ๋ณด๋‚ด๊ฒ ๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค.
  2. /dev/null
    • /dev/null์€ ์œ ๋‹‰์Šค ๊ณ„์—ด ์šด์˜์ฒด์ œ์—์„œ **"์—†์Œ"**์„ ์˜๋ฏธํ•˜๋Š” ํŠน์ˆ˜ ํŒŒ์ผ์ž…๋‹ˆ๋‹ค.
    • ์—ฌ๊ธฐ์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‚ด๋ฉด ๋ฐ์ดํ„ฐ๋Š” ์ฆ‰์‹œ ์‚ฌ๋ผ์ง€๋ฉฐ, ์•„๋ฌด ์ถœ๋ ฅ๋„ ํ‘œ์‹œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

 

 

๋”๋ณด๊ธฐ

morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj

๋ฐ˜์‘ํ˜•

'๐Ÿง Linux (Bandit)' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[OverTheWire][Linux] Bandit Level7 -> Level8  (0) 2024.12.23
[OverTheWire][Linux] Bandit Level5 -> Level6  (0) 2024.12.23
[OverTheWire][Linux] Bandit Level4 -> Level5  (0) 2024.12.20
[OverTheWire][Linux] Bandit Level3 -> Level4  (0) 2024.12.20
[OverTheWire][Linux] Bandit Level2 -> Level3  (1) 2024.12.20