본문 바로가기

리눅스/linux

Linux 6

bandit 5 문제 /해석

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

힌트에 있는 정보들로 find를 사용했다.

find / -user bandit7 -group bandit6 -size 33c

유저가 bandit6이고, 그룹이 bandit6이며 크기가 33c인것을 찾아줘

에러가 뜨니 에러부분은 버리는 명령어를 써보자.

find / -user bandit7 -group bandit6 -size 33c 2> /dev/null

쓸모 없는 부분은 다 날려버리고 필요한 부분만 골라냈다.

 /var/lib/dpkg/info/bandit7.password가 나왔고 열어보니 역시 플래그값이 나오게 되었다.

 

※ ※ ※ ※ ※ ※ ※ ※ ※

핸들 이름 설명
0 stdin 표준입력
1 stdout 표준출력
2 stderr 표준에러

2 > /dev/null   → 에러를 /dev/null에 넣어라 (버림)

1 > test  →  표준 출력을 test에 덮어씌워라

ls -al >> test →test안에 있는 내용 뒤에 추가로 ls -al내용을 더하라

'리눅스 > linux' 카테고리의 다른 글

Linux 8  (4) 2024.03.23
Linux 7  (0) 2024.03.20
Linux 5  (0) 2024.03.20
Linux 4  (0) 2024.03.20
Linux 1 ~ 3  (0) 2024.03.20