본문 바로가기

분류 전체보기

(78)
4. 로그인 접근 권한 오늘은 로그인 접근 권한에 대해 배워보려고 해 명령어로 usermod -L로 계정을 잠궈버리는 간단한 명령어 말고 로그인 계정을 관리하는 파일을 한번 확인하고 또 원격접속을 허용하거나 차단해주는 방법도 알아볼거야 자, 이제 바로 시작해보자! 1. 계정 관리 - /etc/login.defs 우리가 저번 시간에 useradd와 passwd를 통해 계정을 생성해봤을 거야 이번에는 계정을 생성할 때 서버가 참조하는 파일을 확인해볼 거야 그 파일은 /etc/login.defs 파일이야. 파일의 내용을 한 번 들여다보자 1. Mail_DIR /var/spool/mail 메일을 생성하는 디렉터리를 지정 home 디렉터리에 생성된 사용자 계정들에 대한 mail 파일 경로라고 볼 수 있어 2. pass_(max/min/..
3. 계정관리 이번에는 저번 2장에서 배웠던 계정에 대해 이어서 실습을 해보려고 해 오늘 배울 내용 중에서 가장 중요한 파일 다섯개를 미리 보여줄께 1. /etc/passwd 2. /etc/shadow 3. /etc/group 4. /var/spool/mail 5. /home 이 파일들은 계정이 생성될 때 고정적으로 계정의 정보를 추가하는 파일들이야 이렇게만 봐서는 복잡할 수 있으니, 오늘은 이 다섯가지 종류의 파일과 친해지는 시간을 가져보자! 1. 계정 관리 파일 - /etc/passwd 파일 구조와 /etc/shadow 파일 구조 1. /etc/passwd 구조 /etc/passwd 파일은 다음과 같은 형식으로 이루어져있어 jinwoo:x:1000:1000:jinwoo:/home/jnu:/bin/bash jinwo..
Bandit 원정대 4주차 Bandit Level 21 → Level 22 Level Goal A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in /etc/cron.d/ for the configuration and see what command is being executed. step1. /etc/cron.d/ 로 directory를 옮기고 directory 안에 파일들을 확인한다. cronjob_bandit22 파일을 열어서 파일내용을 확인한다. step2. cronjob_bandit22 파일 안에 다음과 같은 내용이 적혀있다. 1. /tmp/t7O6lds9S0RqQh9aMcz6ShpAoZK..
Bandit 원정대 3주차 Bandit Level 14 → Level 15 Level Goal The password for the next level can be retrieved by submitting the password of the current level to port 30000 on localhost. Commands you may need to solve this level ssh, telnet, nc, openssl, s_client, nmap step1. bandit14의 비밀번호가 저장되어 있는 /etc/bandit_pass/bandit14 파일을 열어 비밀번호를 확인하고, bandit14의 ip주소를 확인한다. step2. nmap 명령어로 해당 ip주소에서 open되어 있는 port를 찾아낸다. step3..
Bandit 원정대 2주차 Bandit Level 7 → Level 8 Level Goal The password for the next level is stored in the file data.txt next to the word millionth Commands you may need to solve this level grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd step1. ls-al로 파일 확인후 data.txt 파일 열기 step2. cat data.txt 결과 데이터가 계속해서 나오므로 ctrl+c로 실행을 멈추도록 한다. step3. millionth 단어가 포함되어 있는 문자열을 찾아야하므로, grep -w 'millionth' ./data.txt 로..
Bandit 원정대 1주차 Level 0 The goal of this level is for you to log into the game using SSH. The host to which you need to connect is bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Level 1. 여기서 첫번째로 할일은 ssh로 해당 사이트를 접속을 해야된다는 것을 알 수 있다. SSH는 secure shell 로 telnet의 단점인 보안을 강화한 프로토콜이다. 강력한 인증 방법 및 안전하지 못한 ..