#20241230

프로젝트 008

[R1]
config t
hostname HACKER
interface fastethernet0/0
ip address 100.100.100.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.1 255.255.255.252
no shutdown
exit
router rip
version 2
network 100.100.100.0
network 1.1.1.0
exit
exit

[R2]
config t
hostname ST
interface fastethernet0/0
ip address 125.246.95.254 255.255.255.0
no shutdown
exit
interface serial1/0
ip address 1.1.1.2 255.255.255.252
no shutdown
exit
router rip
version 2
network 125.246.95.0
network 1.1.1.0
exit
exit

kali에서 서버(우분투)로 ssh 접속, dns 확인.
> ssh master@125.246.95.152
> nslookup st.kr
> su로 kali root 접속.

포트로 접속하기 위해서 서버와 방화벽에서 포드를 열어주어야 함. (두 번)

우분투 아파치 기본 페이지 (웹)
-Apache2 Default Page
-You should replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server.
-Conficuration
> /etc/apache2/
-apache2.conf
-mods-enabled
-conf-enabled
-sites-enabled

-----

3. 이메일 설정
이메일에는 계정@도메인으로 설정되어있음.
송신 > SMTP(25)
수신 > POP(110), IMAP(143)

---

evolution 메일 계정 설정
evolution > new 옆 메뉴 > mali account

---

우분투 서버에서 root로 이동 (kali에서 접속한 우분투, su)

---
서버 센드메일 송신 설정
> nano /etc/mail/sendmail.cf
#local info (98행)
Cwlocalhost 부분에 도메인 이름으로 수정 (Cwst.kr)


#SMTP daemon options (269 - 270행)
O DaemonPortOptions=Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1
O DaemonPortOptions=Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1

Addr=127.0.0.1 부분 두개 삭제.

> systemctl restart sendmail

> nano /etc/mail/access
st.kr RELAY
naver.com RELAY
kje.kr RELAY
192.168.0 RELAY
10.0.2 RELAY


> sudo makemap hash /etc/mail/access < /etc/mail/access
> systemctl restart sendmail

---

메일 수신 설정
> sudo nano /etc/dovecot/dovecot.conf
30행 수정(주석 해제, 수정): listen = *
33행 수정(주석 해제): base_dir = /var/run/dovecot
34행 추가: disable_plaintext_auth = no

> sudo nano /etc/dovecot/conf.d/10-mail.conf
121행 수정(주석 해제, 추가): mail_access_groups = mail
166행 수정(주석 해제): lock_method = fcntl
> systemctl restart sendmail
> systemctl restart dovecot

-----

> nano /etc/hostname
mail.st.kr
도메인 = st.kr
호스트 = mail
> reboot

그러면 ssh 접속을 했을 때 master@master로 떴던 것이 master@mail로 변경된다.

> cd /etc/mail
> nano local-host-names
mail.st.kr 추가
> systemctl start sendmail
> systemctl start dovecot
> systemctl enable sendmail
> systemctl enable dovecot