프로젝트 012
kali > 100.100.100.1/24 100.100.100.254 125.246.95.152
[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 > 125.246.95.0까지 연결.
내부 (메인서버, 백업서버, 관리자(win7)) 연결
관리자(win7)에서 kali까지 연결.
방화벽이 내부를 보호하고 있으므로 해커에서는 방화벽 내부로 접속을 못한다.
그러므로 메인서버에 접속을 할 때에는 방화벽 ip 125.246.95.152로 접속이 가능하다.
관리자에서 서버 관리하고, 해커에서는 공격.
해커에서 관리자로 메일 보내기.
st@mail.st.kr > master@mail.st.kr
관리자(win7)에서는 master@mail2.st.kr로 수신.
해커의 ping 차단하기.
1. 방화벽에서 차단
관리자(Win7)에서 chrome으로 https://192.168.0.254:4444로 접속하면 UTM 접속 가능하다.
네트워크 보호 > 방화벽 > ICMP > Ping 설정 > 체크되어있는 두 항목 체크 해제 > 적용
2. 라우터(R2)에서 차단
ACL 설정
표준 ACL은 대역대 전체를 막기 때문에 다른 서비스도 접근이 불가능함.
그러므로 확장 ACL로 설정해주어야 함.
[확장]
conf t
access-list 100 deny icmp host 100.100.100.1 host 125.246.95.152 echo
access-list 100 permit ip any any
interface Serial1/0
ip access-group 100 in
exit
exit
ACL 해제:
conf t
no access-list 100
--
정보수집
kali > traceroute st.kr
traceroute to st.kr (125.246.95.152), 30 hops max, 60 byte packets
1 100.100.100.254 (100.100.100.254) 10.429 ms 10.348 ms 10.299 ms
2 1.1.1.2 (1.1.1.2) 21.013 ms 20.976 ms 85.360 ms
3 * * *
4 * 125.246.95.152 (125.246.95.152) 63.677 ms 63.465 ms
kali 메뉴 > 01 - Information Gathering - dns Analysis
> dnsenum st.kr
Brute forcing with /usr/share/dnsenum/dns.txt:
root > nano /usr/share/dnsenum/dns.txt
포트 탐색
> nmap -v -sT -O st.kr
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
465/tcp filtered smtps
587/tcp filtered submission
4444/tcp open krb524
4444포트를 확인하고 st.kr:4444로 접속하면 외부에서 접속이 가능하다.
그러므로 외부 접속을 차단하여야 한다.
관리 > WebAdmin 설정 > WebAdmin 엑세스 구성 > 허용된 네트워크 > Any -> Inside (Network) 변경 > 적용
칼리에서 https://st.kr:4444 접속이 차단된 것 확인 가능.
--
웹 정보수집
> nikto -host st.kr
/var/www/html 탐색 > /var/log/apache2/access.log 에 로그 저장
> nikto -host dvwa.st.kr
/home/dvwa/public_html 탐색 > /home/dvwa/public_html/logs/access.log에 로그 저장
로그 관리
메인 우분투 서버
> sudo apt -y install putty-tools
> sudo apt install mailutils
/var/log/apache2/access.log 서버로 가져오기
win7
C드라이브 밑에 log 폴더 생성
cmd > pscp -P 22 master@10.0.2.15:/var/log/apache2/access.log c:\log
c:\log에 access.log 생성됨.