8일차
서버는 안전한가?
cd /var/log
tail -f auth.log -> 로그를 통하여 공격이 들어오는지 알 수 있음
hydra -L user.txt -P passwd.txt 10.0.2.101 --> 히드라를 이용하여 무작위 대입 공격; user.txt 파일과 passwd.txt 파일에 id와 비밀번호가 있어야한다
로그인이 가능한 서비스: ftp, ssh, telnet, imap, mysql등은 아이디와 암호를 알고 있으면 접속이 가능(항상 가능한 것은 아님)
미션) ping 스캔을 차단하라
>
미션) www를 외부 접속 가능하도록 설정하라
>
/var/www/html (웹 기본페이지의 위치) 주인: root
index.html -> 먼저 반응함(우선 순위가 높음)
index.php -> .html이 없으면 반응
밑에는 생성한 일반 계정
st.kr > /home/st/public_html
st
kgr.kr > /home/kgr/public_html
kgr
naver.com > /home/naver/public_html
naver
일반 계정 홈페이지 작동시키기
a2enmod userdir
htttp://192.168.0.204/~st으로 확인 가능
root : root > chown st:st index.html
chown st:st public_html
su st
cd ~ : 너의 방으로 이동해~
chmod 711 $HOME
chmod 755 ~/public_html
FTP에 연결하라~~
apt -y install vsftpd
nano /etc/vsftpd.conf
mysql
create database st;
create user st@localhost identified by '123456';
grant all on st.* to st@localhost;
flush privileges;
create database kgr;
create user kgr@localhost identified by '123456';
grant all on kgr.* to kgr@localhost;
flush privileges;
create database naver;
create user naver@localhost identified by '123456';
grant all on naver.* to naver@localhost;
flush privileges;