반응형
Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 객체 상속 속성 인스턴스 메소드 오퍼레이션
- bandit21
- 팬인과 팬아웃
- status diagram
- 리버스쉘
- 상태다이어그램
- 모듈구조도
- UseCase
- 클래스 관계
- Bandit
- base64
- 구조적 설계
- gof design pattern
- prototypepattern 예시 example
- cron
- 생성패턴 행위패턴 구조패턴
- strucuture charat
- 매크로를 바라보는 시각
- sofrware architeture
- usecase description
- 암표거래
- ssh
- madia designer ui design
- ui 디자인 기본원칙
- fan-in fan-out
- 소프트웨어공학 디자인패턴
- 디자인패턴
- telnet
- nc reverse shell
- factory metohd pattern
Archives
- Today
- Total
2.log
install 명령어로 파일 권한 변경 하는 법 본문
728x90
반응형
sudo, su, chmod ...
이 모든 명령어가 먹히지 않아 파일 권한변경을 할 수 없을 때 install 명령을 통해 권한변경을 시도해 볼 수 있음
install 명령어
파일 복사, 파일 소유자, 그룹 및 권한 변경에 사용되는 명령어로, install 명령어 사용하여 파일 복사하면, 복사된 파일이 기존 파일과 동일한 권한을 상속함. 즉, 복사된 파일은 복사를 수행한 사용자 및 그룹에 대한 권한을 가지게 됨
사용법
-m 옵션을 사용하여 권한 지정하고 파일과 경로 지정
$ install -m 4755(권한설정) file.txt /path/to/destination


예를들어 기존 bandit20-do 파일은 소유자가 bandit20 이지만 install 명령으로 복사를 수행한 /tmp/bandit20-do 파일의 경우 복사를 수행한 bandit19가 파일 소유자 및 그룹 권한을 가지게 됨
실행해보면 아래와 같이 소유권과 실행주체의 일치 여부에 따른 출력 결과에 차이가 존재함을 확인 할 수 있음


(물론 이건 해당 문제의 솔루션과는 무관함, 그냥 삽질하다 알게된 것 기록용으로..)
728x90
반응형
'HACKING > Bandit+' 카테고리의 다른 글
sshd_config 파일 수정하여 포트 변경하기 (0) | 2023.04.07 |
---|---|
Bash 취약점에 대하여 (0) | 2023.04.07 |
setuid 에 대하여 (0) | 2023.04.06 |
Shell 과 bashrc (0) | 2023.04.01 |
SSH 키 이용 시 bad permissions: ignore key: 에러가 발생할 경우 (0) | 2023.04.01 |
Comments