18일차
문제 21 계정 추가 competitions 호스팅 추가 (bind) 호스팅 추가 (hosting) http://competitions.st.kr index.html > index.php index.html삭제 index.php삭제 rm -rf index.html rm -rf index.phpOptions Indexes Oder Allow,Deny Allow from all shop.st.kr > 워드프레스 기반 쇼핑몰 디렉토리 777 - 022 = 755 파일 666 - 022 = 644 부팅시 마운트지점 etc/fstab 마운트 지점 /etc/passwd 패스워드 /etc/login.defs 로그인 강도 /etc/mail/access > X -> sendmail 설치시 확인 가능 show.st.kr cd chown shop:shop cp unzip word.zip http://shop.st.kr /wordpress 공격의 시작 ping shop.st.kr(icmp) 100.100.100.1 쉽게 노출 hping3 shop.st.kr -S -i u50 -c 5 hping3 shop.st.kr -a shop.st.kr -S -c 100 -u 5 hping3 125.246.95.254 -a 125.246.95.254 -S -c 10 hping3 --flood --rand-source st.kr 미션2 해커가 실행했던 명령어가 무엇인지 알수 있는가 php.st.kr/monitor.php에서 확인가능하도록 할려면? shop의 로그에서 확인 가능함 nikto -host shop.st.kr > wordpress wpscan --url shop.st.kr -U user.txt -P passwd.txt 공격을 성공시키기 공격후에 대한 로그 확보 shop에 대한 웹 파일과 데이터베이스 백업후 관리자 pc에 저장 backup서버 복구작업 복구 순서 일단 웹에 필요한 서버들 다운로드 apt -y install php8.3-fpm a2enmod proxy_fcgi setenvif a2enconf php8.3-fpm systemctl restart php8.3-fpm apache2 apt -y install lamp-server^ a2enmod userdir 일반사용자 홈페이지 확인 가능함 도메인 세팅 nano /etc/resolv.conf 호스팅 세팅 nano /etc/apache2/site-available/hosting.confDocumentRoot /home/shop/public_html ServerName shop.st.kr ServerAdmin shop@shopst.kr ErrorLog /home/shop/public_html/logs/error.log CustomLog /home/shop/public_html/logs/access.log combined a2ensite hosting step4 백업 받은 파일은 백업서버로 이전 cd /home/shop/public_html XXX.sql 파일은 복원 create database shop; create user shop@localhost identified by '123456'; grant all on shop.* to shop@localhost; flush privileges; mysql -u shop -p < XXX.sql