728x90
반응형
주의!!
다음의 툴을 사용하여 공공기관, 민간업체 등을 공격할 시에는 범죄행위로 간주됩니다.
아래의 글은 ICMP 및 Port Scanning 기법 등을 교육하기 위해 작성된 글으므로, 교육의 목적에만 활용하시기 바랍니다.


읽기 전에 블로그장의 한 마디
아마 처음보시는 분들은 이게 뭐야?? 라고 하실 수 있습니다. (워낙 글 주변이 없어서..) 
본 문서는 back track5 버전대에서 테스트에 사용하였고, 요즘엔 칼리 리눅스로 이름이 변경되었습니다.
해킹 및 보안에 관심있는 분들은 다운 받아서 "교육 목적" 으로 사용하시면 좋을것 같습니다.

그리고 테스트 환경에 대해서 말씀드리면,
back track5, CentOS5, wire shark(네트워크 스누핑용) 사용하여 테스트 하였습니다.

kali linux download : https://www.kali.org/downloads/
centos download : https://www.centos.org/download/
nmap download : https://nmap.org/download.html
wireshark download : https://www.wireshark.org/download.html

nmap 툴을 이용한 TCP Port Scanning
Ⓐ Port Scanning 기법 종류
Scanning 기법
의미
Open Scan
3Way handshake를 이용하여 완전히 연결을 수립한 상태에서 Scan하는 기법으로 종류에는 TCP Scan이 있다. 이는 호스트가 보내오는 신호에 따라 열린포트, 닫힌포트를 구분하는 방법, 단점으로 연결이 수립되어서 타겟 호스트에 로그가 남을 수 있다.
Half Scan
3Way handshake를 수립하지 않는 방법으로 종류에는 SYN Scan이 있다.
Stealth Scan
SYN 신호 자체를 전달하지 않는 방법으로 종류에는 FIN Scan, NULL Scan, Xmas Scan, ACK Scan이 있다.


Ⓑ nmap 툴을 이용하여 target IP에 열려있는 port와 실행 중인 서비스를 파악할 수 있다.
# nmap -option tagetIP 
옵션
의미
-s
T
Signal을 TCP Scan으로 보낸다.
S
Signal을 SYN Scan으로 보낸다.
F
Signal을 FIN Scan으로 보낸다.
N
Signal을 NULL Scan으로 보낸다.
X
Signal을 XMAS Scan으로 보낸다.
A
Signal을 ACK Scan으로 보낸다.
-P0
Scan 하기 전 ping test를 보내 해당 호스트와 연결이 되는지 확인하는데,
0으로 되어있으면 해당 작업을 하지 않는다.
-p port num
port number로 명시한 특정 포트만 Scanning 한다.
-T num
number가 0~5번까지 정의 가능한다. Scanning 속도를 조정한다.


Victim : CentOS 5.9 /   IP : 172.20.10.4
 Attacker : BTR3 /   IP : 172.20.10.6
Ⓐ TCP Scanning
graphic

closed된 21번 FTP port에 대해서 victim 측에서 RST, ACK 신호를 보낸다.
graphic

반면 open 되어 있는 23번 telnet port에 대해서는 attacker와 victim이 3 Way Handshake를 한다.
graphic



Ⓑ SYN Scanning
graphic

closed 된 20번 포트는 victim에서 RST 신호를 attacker로 보낸다.
graphic

open 된 22번 포트는 victim에서 SYN, ACK로 응답을 보내오면 attacker에서 RST 신호를 보내 3 Way handshake 연결을 수립하지 않는다.
graphic



Ⓒ FIN Scanning
graphic

FIN Scanning의 특징으로 Flags를 살펴보면 처음부터 FIN신호를 보내게된다.
graphic

open 되어있는 23번 telnet 포트는 attacker가 FIN 신호를 보내면 victim은 어떠한 반응도 보이지 않는다.
하지만, closed되어 있는 53번 domain 포트는 attacker가 FIN 신호를 보내자 victim은 RST, ACK 신호를 돌려주었다. 이를 통해 닫힌 포트와 열린 포트를 구분할 수 있다.
graphic


Ⓓ NULL Scanning
graphic

NULL Scanning의 특징은 Flags 부분이 모두 0으로 되어 있다는 것이다.
graphic

open 되어 있는 23번 telnet 포트에 대해서는 victim은 attacker에게 아무런 응답을 하지 않는다.
이를 보고 open되어 있다는 것을 판단할 수 있다.
graphic

close 되어 있는 21번 ftp 포트에 대해서는 victim은 RST, ACK 신호를 attacker에게 보낸다.
graphic





Ⓔ XMAS Scanning
graphic

XMAS Scanning의 특징으로 URG, PSH, FIN Flags를 같이 보낸다.
graphic

open되어 있는 25번 SMTP 포트는 attacker가 URG, PSH, FIN 신호를 보내면 victim은 아무런 반응을 하지 않는다.
graphic

close 되어 있는 110번 POP3 포트는 attacker로부터 URG, PSH, FIN 신호를 받으면 victim은 RST, ACK 신호를 보내 포트가 닫혀있다는 것을 알려준다.
graphic




Ⓕ ACK Scanning
1. 방화벽 미설정 시
graphic

2. 방화벽 설정시
graphic

ACK Scanning의 특징은 attacker에서 ACK 신호를 해당 포트로 날려 방화벽의 유무를 확인한다는 점이다.
graphic



1. 방화벽 미설정시에는 attacker가 보내온 신호에 대해 RST 신호로 응답을 해주었다.
graphic

2. 방화벽 설정시에는 attacker가 보내온 신호에 대해 ICMP 프로토콜을 이용해서 Destination unreachable로 응답하고 있다.
graphic

ACK Scanning 을 통해 방화벽 유무를 확인할 수 있다.


728x90
반응형
728x90
반응형


리눅스 시스템의 로그 데몬은 syslogd 가 생성하고, syslogd에 대한 설정파일은 /etc/syslog.conf 에 기록되어 있다.



graphic

/etc/syslog.conf 의 기본 설정 내용이다.
‘#’으로 되어 있는 것들은 주석 처리가 되어있는 것들이고, 그 외에 설정된 것 중에
13번째 라인에 mail.* -/var/logmaillog를 보면 .(dot)을 기준으로 왼쪽은 로그기록 대상,
오른쪽은 위험도를 뜻하게 되고, -/var/logmaillog 는 로그파일이 기록되는 디렉토리를 의미한다.
  
위험도
위험번호
의미
emerg
0
예를 들어 cron.err로 정의되어 있으면 위험도인 err는 3번이므로 3번보다 위험도가 높은 0~2번까지의 모든 행위에 대해 로그를 남기겠다는 의미가 되겠다.
alert
1
crit
2
err
3
warning
4
notice
5
info
6
debug
7
none
8
로그를 남기지 않겠다.


※ 리눅스 6.x ver 부터는 syslog가 없고 rsyslog를 지원한다. r 은 remote를 의미하고 네트워크를 타고 다른 호스트에도 로그를 남기는 기능을 지원한다.


로그 정리툴
/etc/logrotate.conf
logrotate 툴의 설정파일임


728x90
반응형
728x90
반응형


유닉스 dump backup 명령

백업의 종류
Full Backup : 풀 백업
Incremental Backup : 증분 백업

유닉스, 리눅스 dump backup 레벨에는 0~9번까지 있고, 0번은 full backup을 뜻하고, 1~9번까지는 증분 백업으로 쓴다. 
각각의 dump에 백업번호를 부여하고, 백업 시에 참고하여 이전 백업 레벨부터 백업할 것인지, 전체를 백업할 것인지를 결정하게 된다.

예를 들어
요일
레벨
0
3
4
5
6
7
2

일요일에 풀백업을 하고, 월요일부터 증분백업을 한 다음, 토요일날 일요일 백업 시점부터 주간 백업을 실시한다. 
이 처럼 백업레벨에 따라 다양한 백업내용을 정의할 수 있다.


백업 명령
# ufsdump 백업레벨(0~9)uf 덤프이름 백업대상 ⤶

u 옵션 : /etc/dumpdates 파일에 해당 덤프파일을 생성한 작업에 대한 내용을 기록하는 명령 /etc/dumpdates 파일에는 백업했던 대상, 백업레벨, 백업시간이 명시되어 있다.
f 옵션 : file 이름을 정의한다는 옵션


복구 명령
# 복구 전 해당 복구할 위치로 이동
#ufsrestore rvf 덤프파일경로               : 지금위치에 전부 restore
#ufsrestore xvf 덤프파일경로 파일명       : 지금위치에 파일명 file 만 뽑아서 restore
#ufsrestore tvf 덤프파일경로                : 내용 보기
#ufsrestore ivf 덤프파일경로                : interactive방식으로 확인하고 복구

※ Tip : 백업 복구 시에는 전체 복구(레벨0)부터 한 다음에 증분 백업을 실시하여야 한다.







리눅스 dump backup 명령

백업의 종류
Full Backup : 풀 백업
Incremental Backup : 증분 백업

유닉스, 리눅스 dump backup 레벨에는 0~9번까지 있고, 0번은 full backup을 뜻하고, 1~9번까지는 증분 백업으로 쓴다. 
각각의 dump에 백업번호를 부여하고, 백업 시에 참고하여 이전 백업 레벨부터 백업할 것인지, 전체를 백업할 것인지를 결정하게 된다.

예를 들어
요일
레벨
0
3
4
5
6
7
2

일요일에 풀 백업을 하고, 월요일부터 증분백업을 한 다음, 토요일날 일요일 백업 시점부터 주간 백업을 실시한다. 
이 처럼 백업레벨에 따라 다양한 백업내용을 정의할 수 있다.


백업 명령
# dump 백업레벨(0~9)uf 덤프이름 백업대상 ⤶

u 옵션 : /etc/dumpdates 파일에 해당 덤프파일을 생성한 작업에 대한 내용을 기록하는 명령 /etc/dumpdates 파일에는 백업했던 대상, 백업레벨, 백업시간이 명시되어 있다.
f 옵션 : file 이름을 정의한다는 옵션


복구 명령
# 복구전 해당 복구할 위치로 이동
#restore rvf 덤프파일경로                  : 지금위치에 전부 restore
#restore xvf 덤프파일경로 파일명          : 지금위치에 파일명 file 만 뽑아서 restore
#restore tvf 덤프파일경로                   : 내용 보기
#restore ivf 덤프파일경로                   : interactive방식으로 확인하고 복구


※ Tip : 백업 복구 시에는 전체 복구(레벨0)부터 한 다음에 증분 백업을 실시하여야 한다.


728x90
반응형
728x90
반응형

설정모드에서exec 명령어사용하기

 

exec 명령어: 이용자모드나관리자모드에서사용하는명령어

show, ping, debug 등동작확인또는장애처리용명령어가대부분임

설정모드에서exec 명령어를사용하려면do로시작함

도움말기능이나명령어완성기능동작하지않음

 

Router(config)#do show version

 

현단계사용가능명령어보기

 

물음표(?)를입력하면현재단계에서사용가능한모든명령어예시

물음표다음에엔터키를누르지않음

 

Router#?

Exec commands:

access-enable Create a temporary Access-List entry

access-profile Apply user-profile to interface

access-template Create a temporary Access-List entry

alps ALPS exec commands

 

 

 

특정글자로시작하는명령어보기

 

특정글자에연속하여물음표를치면해당글자로시작하는명령어예시

 

Router#e?

enable ephone-hunt erase event

Exit

Router#e

 

명령어옵션보기

 

명령어입력후스페이스다음물음표를치면사용가능한옵션예시

 

Router#erase ?

/all Erase all files(in NVRAM)

/no-squeeze-reserve-space Do not reserve space for squeeze operation

flash: Filesystem to be erased

nvram: Filesystem to be erased

pram: Filesystem to be erased

slot0: Filesystem to be erased

slot1: Filesystem to be erased

startup-config Erase contents of configuration memory

Router#erase

 

(Tab) 키를이용한명령어완성

 

명령어에연속하여탭(Tab) 키를치면명령어를완성시킨다

 

Router#en[Tab]

 

모호한명령어입력시의에러메시지

 

모호한명령어입력시‘Ambiguous command’메시지표시

현설정단계에서해당철자로시작하는명령어가2개이상있다는의미

 

Router(config)#i

% Ambiguous command: "i

미완성명령어입력시의에러메시지

 

명령어에필요한옵션미입력시‘Incomplete command’메시지표시

현재의명령어다음에필요한옵션을입력해야한다는의미

 

Router(config)#interface

% Incomplete command.

Router(config)#

 

잘못된명령어입력시의에러메시지

 

잘못된명령어입력시잘못된철자에^ 표시

‘^ 표시부분에Invalid (잘못된) 입력이발견되었다라는메시지표시

 

Router(config)#intreface

^

% Invalid input detected at '^' marker.

728x90
반응형
728x90
반응형

시스코 장비 접속방법

윈도우7사용자

1. 설치시디, 인터넷으로 RS232 Draver 다운받아서 설치                                      

2.  RS232케이블 연결 후 내컴퓨터-> 속성(마우스오른쪽버튼)-> 장치관리자(클릭)

 3.RS232드라이버가정상적으로인식되었는지확인

                                        

                 4. Secure CRT 실행 후 장치관리자에서 인식되어있는

해당 시리얼 포트넘버선택 후 확인(참고 시스코 기본 Baud rate : 9600)

              

5. 초기장비접속시 user모드(>)이므로 장비 설정상태를 변경하거나 확인하기위해선 명령어 : enable 입력한 후 프리빌리지 모드로 엑세스                                          <시스코(cisco2960)장비 접속화면>

 



스위치(CISCO) 장비점검에 필요한 명령어 리스트

명령어 

내용 

 show process cpu

CPU 상태 확인 

show process memory 

메모리 상태 확인 

 show environment all

H/W 상태 확인 

show log 

로그 확인 

show version 

IOS 버전 확인 

show interface status 

Interface 상태 확인 

show vlan 

VLAN 상태 확인 



1. CPU 상태 확인

   명령어 : show process cpu 

설명 

%는 스위치의 프로세스들이 처리하는데 소요되는 CPU 소요량

/이후에 나오는%는 인터럽트 발생으로 소비되는 CPU 소요량입니다.

switch#show process cpu

CPU utilization for five seconds: 6%/0%; one minute: 5%; five minutes: 6%

 

 

 



2. 메모리 상태 확인

   명령어 : show process memory

설명

Processor POOL Total : 보유한 메모리의 전체용량

I/O POOL Total : 보유한 메모리의 전체용량

Used : 사용한 메모리의 전체용량

Free : 사용가능한 메모리의 전체용량   

switch#show process memory

Processor Pool Total:  388645840  Used:   90185760  Free:  298460080

I/O Pool Total: 67108864          Used:   16487640  Free:   50621224

 

3. Fan상태, LED상태 및 파워모듈의 입출력 전압, 장비내부별 온도 및 전압 등 확인 

   명령어: show environment / show environment all

                 



4. 로그 상태 확인

   명령어 : show log



5. IOS 버전상태확인

   명령어 : show version




6. 인터페이스 상태확인 (명령어 : show interface status)

  설명

각 포트별 링크상태, 소속된 vlan 그룹 및 속도상태 표시

 

 

Cisco#show interface status

Port    Name               Status       Vlan       Duplex  Speed Type

Gi5/1                      connected    trunk         full   1000 1000BaseSX

Gi5/2                      connected    trunk         full   1000 1000BaseSX

Gi7/1                        disabled      1           full   1000 1000BaseSX

Gi7/2                      connected      1           full   1000 1000BaseSX

Gi7/3                      connected      1           full   1000 1000BaseSX

Gi7/4                      connected      1           full   1000 1000BaseSX

Gi7/5                      connected      1           full   1000 1000BaseSX

Gi7/6                      connected      1           full   1000 1000BaseSX

Gi7/7                      connected      1           full   1000 1000BaseSX

Gi7/8                      connected      1           full   1000 1000BaseSX

Gi7/9                      connected      1           full   1000 1000BaseSX

Gi7/10                     connected      1           full   1000 1000BaseSX

Gi7/11                     connected      1           full   1000 1000BaseSX

Gi7/12                     connected      1           full   1000 1000BaseSX

Gi7/13                     notconnect     1           full   1000 1000BaseSX

Gi7/14                     connected      1           full   1000 1000BaseSX

Gi7/15                     connected      1           full   1000 1000BaseSX

Gi7/16                     connected      1           full   1000 1000BaseSX

Gi7/17                     connected      1           full   1000 1000BaseSX

Gi7/18                     connected      1           full   1000 1000BaseSX

Gi7/19                     connected      1           full   1000 1000BaseSX

Gi7/20                     connected      1           full   1000 1000BaseSX

Gi7/21                     connected      1           full   1000 1000BaseSX

Gi7/22                     connected      1           full   1000 1000BaseSX

Gi7/23                     connected      1           full   1000 1000BaseSX

Gi7/24                     connected      1           full   1000 1000BaseSX

 

7. VLAN 설정상태확인 (명령어: show vlan)

※ 설명

각 포트별 소속되어있는 vlan 그룹 및 활성화상태확인

 -------- -------


728x90
반응형
728x90
반응형

서브넷팅(subnetting)

 

서브넷팅이란?

 

하나의네트워크주소를여러개로분할하는것

라우터인터페이스별로다른네트워크주소를사용해야함

사용인터페이스수보다네트워크수가부족할때서브넷팅을해야함

 

 

서브넷마스크(subnet mask)

 

이진수로표기한IP 주소중네트워크를나타내는숫자위에는1, 호스트를나타내는숫자위에는0을적은것

 

11111111.11111111.00000000.00000000(서브넷마스크)

10101100.00010000.00000110.00001010 (2진표기IP 주소)

172. 16. 6. 10 (10진표기IP 주소)

IP 주소중에서어디까지가네트워크주소인지를표시할때사용

 

 

 

서브넷마스크표현법

 

•IP 주소다음점으로구분된10진수사용172.16.6.10 255.255.0.0

서브넷마스크로사용된1의개수로표시172.16.6.10/16

 

 

서브넷팅

추가적으로네트워크로사용하려는비트위에1을표시

11111111.11111111.11111111.00000000 (서브넷마스크)

10101100.00010000.00000110.00001010 (2진표기IP 주소)

172.16.6.10 (10진표기IP 주소)

네트워크수: 추가마스크수(256) 만큼증가

네트워크당호스트수: 추가마스크수(256) 만큼감소

 

 

서브넷계산방법(1)

기존마스크에n을더하면2n개의서브넷이만들어짐

서브넷당호스트수는256/2n

192.168.1.0/242(21)로분할

1)서브넷마스크:25 (24+1)

2)서브넷당호스트수:128(256/2)

3)서브넷: 0, 128

4)192.168.1.0/25, 192.168.1.128/25

 

 

서브넷계산방법(2)

 

192.168.1.0/244(22)로분할

1)서브넷마스크:26 (24+2)

2)서브넷당호스트수:64(256/4)

3)서브넷: 0, 64, 128, 192

4)192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 , 192.168.1.192/26

 

 

서브넷계산방법(3)

192.168.1.0/248(23)로분할

1)서브넷마스크:27 (24+3)

2)서브넷당호스트수:32(256/8)

3)서브넷: 0, 32, 64, 96, 128, 160, 192, 224

4)192.168.1.0/27, 192.168.1.32/27, 192.168.1.64/27, 192.168.1.96/27, 192.168.1.128/26, 192.168.1.160/27, 192.168.1.192/26, 192.168.1.224/27

 

IP 주소가소속된서브넷계산방법

 

192.168.1.50/27이속한네트워크주소

 

1)추가된서브넷마스크:27 (24+3)

2)서브넷당호스트수:32(256/8)

3)서브넷: 0, 32, 64, 96, 128, 160, 192, 224

4)192.168.1.0/27, 192.168.1.32/27, 192.168.1.64/27, 192.168.1.96/27, 192.168.1.128/26, 192.168.1.160/27, 192.168.1.192/26, 192.168.1.224/27

5)192.168.1.32 -192.168.1.63

서브넷마스크 10진수 표기

마스크 수

서브넷마스크

//IN 표기

 10진 표기

24+1

1000 0000

/25

255.255.255.128

24+2

1100 0000

/26

255.255.255.192

24+3

1110 0000

/27

255.255.255.224

24+4

11110000

/28

255.255.255.240

24+5

1111 1000

/29

255.255.255.248

24+6

1111 1100

/30

255.255.255.252

24+7

1111 1110

/31

255.255.255.254

24+8

1111 1111

/32

255.255.255.255

 

 

수퍼넷팅(supernetting)

 

수퍼넷팅이란?

 

여러개의네트워크를하나로표시하는것

네트워크축약(summary)

네트워크안정화

네트워크자원(메모리, CPU,대역폭) 절약

장애처리용이

루트서머라이제이션(route summarization), 수퍼넷팅(supernetting), CIDR (Classless Inter-Domain Routing)

 

서머리네트워크계산방법

 

서브넷마스크–n = 현재의마스크를가진네트워크2n

서머리시작수가2n의배수이면2n개까지동시서머리가능

 

192.168.0.0/24, 192.168.1.0/24 = 192.168.0.0/23 :2 (21)

192.168.0.0/24 -192.168.127.0/24 = 192.168.0.0/17 :128 (27)

        


728x90
반응형
728x90
반응형
  topology


AP <-> Clinet 구간 vlan설정
AccessPoint#configure terminal
AccessPoint(config)#interface dot11radio 0 <-인터페이스 무선 설정 device
AccessPoint(config if)#ssid Admin <- ssid name 생성
AccessPoint(config if ssid)#vlan 20
AccessPoint(config if ssid)#authentication open .
AccessPoint(config if ssid)#end
AccessPoint(config)#interface fastethernet 0.20
AccessPoint(config subif)#encapsulation dot1Q 20 <- IEEE 802.1q 방식으로 캡슐화시켜서전송
AccessPoint(config subif)#bridge group 20
AccessPoint(config subif)#exit
AccessPoint(config)#interface dot11radio 0.20
AccessPoint(config subif)#encapsulation dot1Q 20 .
AccessPoint(config subif)#bridge group 20
AccessPoint#configure terminal
AccessPoint(config)#interface dot11radio 0
AccessPoint(config if)#ssid Guest <- SSID 활성화
AccessPoint(config if ssid)#vlan 30
AccessPoint(config if ssid)#authentication open
AccessPoint(config if ssid)#end
AccessPoint(config) # interface fastethernet 0.30
AccessPoint(config subif)# encapsulation dot1Q 30
AccessPoint(config subif)# bridge group 30
AccessPoint(config subif)# exit
AccessPoint(config) # interface dot11radio 0.30
AccessPoint(config subif)# encapsulation dot1Q 30
AccessPoint(config subif)# bridge group 30
AccessPoint(config subif)# exit




AP <-> Switch 구간 Trunk 설정
Switch#configure terminal
Switch<config>#interface fastethernet 0/5 .
Switch<config if>#switchport mode trunk
Switch<config if>#switchport trunk encapsulation dot1q
Switch<config if>#switchport trunk native vlan 2
Switch<config if>#switchport trunk allowed vlan add 2,20,30 .
Switch<config if>#switchport nonegotiate
Switch#configure terminal
Switch<config>#interface fastethernet 0/10
Switch<config if>#switchport mode trunk .
Switch<config if>#switchport trunk encapsulation dot1q .
Switch<config if>#switchport trunk native vlan 2
Switch<config if>#switchport trunk allowed vlan add 2,20,30


라우터 <-> 스위치 구간 Trunk 설정
Router#configure terminal
Router<config>#interface fastethernet 0/0.2
Router<config subif>#encapsulation dot1q 2 native
Router<config subif>#ip address 172.16.1.1 255.255.255.0
Router<config subif>#exit
Router<config>#interface fastethernet 0/0.20
Router<config subif>#encapsulation dot1q 20
Router<config subif>#ip address 172.16.2.1 255.255.255.0
Router<config subif>#exit
Router<config>#interface fastethernet 0/0.30
Router<config subif>#encapsulation dot1q 30
Router<config subif>#ip address 172.16.3.1 255.255.255.0
Router<config subif>#exit
DHCP Configuration starts here
Router<config>#ip dhcp excluded address 172.16.2.1
Router<config>#ip dhcp excluded address 172.16.3.1
Router<config>#ip dhcp pool pool1
router<dhcp config>#network 172.16.2.0 /24
router<dhcp config>#default router 172.16.2.1
Router<config>#ip dhcp pool pool2
router<dhcp config>#network 172.16.3.0 /24
router<dhcp config>#default router 172.16.3.1
Router#configure terminal
Router<config>#interface fastethernet 0/0.2
Router<config subif>#encapsulation dot1q 2 native <-태깅을하지않은 untag
Router<config subif>#ip address 172.16.1.1 255.255.255.0
Router<config subif>#exit
Router<config>#interface fastethernet 0/0.20
Router<config subif>#encapsulation dot1q 20
Router<config subif>#ip address 172.16.2.1 255.255.255.0
Router<config subif>#exit
Router<config>#interface fastethernet 0/0.30
Router<config subif>#encapsulation dot1q 30
Router<config subif>#ip address 172.16.3.1 255.255.255.0
Router<config subif>#exit
DHCP Configuration starts here
Router<config># ip dhcp excluded address 172.16.2.1 <-해당네트워크에서 제외되주소
Router<config># ip dhcp excluded address 172.16.3.1 .
Router<config># ip dhcp pool pool1  <-사용할주소 목록이름 
router<dhcp config>#network 172.16.2.0 /24  <-할당될 ip주소범위
router<dhcp config>#default router 172.16.2.1 <-게이트웨이 주소
Router<config>#ip dhcp pool pool2
router<dhcp config>#network 172.16.3.0 /24
router<dhcp config>#default router 172.16.3.1


AP접속된 클라이언트들 보기
AccessPoint#show dot11 associations <-AP접속된 클라이언트들 보기
802.11 Client Stations on Dot11Radio0:
SSID [Admin] :
MAC Address IP address Device Name Parent State
0040.96ac.e657 172.16.2.50 CB21AG/PI21AG Admin User self Assoc


VLAN 설정확인
AccessPoint#show vlan <- vlan 설정확인
Virtual LAN ID: 2 (IEEE 802.1Q Encapsulation)
vLAN Trunk Interfaces: Dot11Radio0.2
FastEthernet0.2
This is configured as native Vlan for the following interface(s) :
Dot11Radio0
FastEthernet0
Protocols Configured: Address: Received: Transmitted:
Bridging Bridge Group 1 1380 712
Other 0 63
0 packets, 0 bytes input
733 packets, 50641 bytes output
Bridging Bridge Group 1 1380 712
Other 0 63
1381 packets, 98016 bytes input
42 packets, 12517 bytes output
Virtual LAN ID: 20 (IEEE 802.1Q Encapsulation)
vLAN Trunk Interfaces: Dot11Radio0.20
FastEthernet0.20
Protocols Configured: Address: Received: Transmitted:
Bridging Bridge Group 20 798 622
Other 0 19
247 packets, 25608 bytes input
495 packets, 43585 bytes output
Bridging Bridge Group 20 798 622
Other 0 19
552 packets, 37536 bytes input
148 packets, 21660 bytes output
Virtual LAN ID: 30 (IEEE 802.1Q Encapsulation)
vLAN Trunk Interfaces: Dot11Radio0.30
FastEthernet0.30
Protocols Configured: Address: Received: Transmitted:
Bridging Bridge Group 30 693 609
Other 0 19
106 packets, 13373 bytes input
517 packets, 48029 bytes output
Bridging Bridge Group 30 693 609
Other 0 19
605 packets, 47531 bytes input
112 packets, 15749 bytes output
 

HOST에서 핑 테스트
D:\>ping 172.16.2.60
Pinging 172.16.2.60 with 32 bytes of data:
Reply from 172.16.2.60: bytes=32 time<10ms TTL=255
Reply from 172.16.2.60: bytes=32 time<10ms TTL=255
Reply from 172.16.2.60: bytes=32 time<10ms TTL=255
Reply from 172.16.2.60: bytes=32 time<10ms TTL=255
Ping statistics for 172.16.2.60:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

D:\>ping 172.16.3.60
Pinging 172.16.3.60 with 32 bytes of data:
Reply from 172.16.3.60: bytes=32 time<10ms TTL=255
Reply from 172.16.3.60: bytes=32 time<10ms TTL=255
Reply from 172.16.3.60: bytes=32 time<10ms TTL=255
Reply from 172.16.3.60: bytes=32 time<10ms TTL=255
Ping statistics for 172.16.3.60:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms




 

728x90
반응형
728x90
반응형
  Port-Security란?

Switch의 MAC 주소공간제약으로인해 장비의스펙에따라 MAC 주소가제한이된다. MAC
Flooding은 이러한점을이용하여 Switch의 MAC Address Table의 공간을 한계에도 달하게하여
Switch를마치 Hub처럼 동작을 시켜버린다. 보통 Switch의 Mac Address Table이 가득차게되면,
Hub와 동일하게들어온 포트를 제외한 다른모든포트로 Flooding한다. 이러한공격방법들이 증가함
에따라서나오게된 Solution이 Port-Security이다.
Port-Security는 각port마다 Mac-address를 제한시켜 MAC Flooding등의 공격을 방지할수있습니다.
이러한경우가 아니더라도 사내에서 User 임의대로 Hub를 사용하는것에대해 제한하기 위해서도

쓰인다.


Port-Security의3가지방식

1. Static Secure MAC-Address : 해당port에사용할User의MAC-Address를관리자가직접입력하여
설정하는방식으로관리자가지정한MAC-Address 이외에다른

MAC-Address를가진Device는해당포트를사용할수없다

Switch(config)# interface gigabitEthernet1/0/1
Switch(config-if)# switchportport-security mac-address 001F.1629.E6F8

->해당Interface에Static으로Mac-address를지정하여, Port-Security 적용


2. Dynamic Secure MAC-Address : 해당port에사용할User의MAC-Address를동적으로학습하여
Port-Security가적용이된다. Switch가Reboot이되면
Port-Security에등록된MAC-Address는삭제된다.

3. Stick Secure MAC-Address : 해당port에사용할User의MAC-Address를동적으로학습하여
Port-Security가적용이된다. Dynamic 방식과동일하지만, 다른점은
Dynamic은Switch가Reboot 될경우Port-Security에등록된
MAC-Address가삭제되지만, Sticky는NVRAM에저장하여Reboot된

후에도그대로해당MAC이Port-Security에저장된다.

Switch(config)# interface gigabitEthernet1/0/1
Switch(config-if)# switchportport-security mac-address sticky

->해당Interface를Port-Security Sticky 방식으로지정


Port-SecurityViolation


1. Violation Shutdown : Port-Security Default Violation이며, Port-Security가동작하는Interface에서

위반했을경우“Shutdown”되며, Err-Disable 상태로넘어간다.

Switch(Config)# interface gigabitethernet1/0/1
Switch(Config-if)#switchportport-securit ymac-address001F.1629.E6F7
Switch(Config-if)# switchportport-security violation shutdown
->해당Interface를Port-Security Static으로지정하여001F.1629.E6F7 이외의다른Mac이학습되면, 해당포트를 Shutdown 상태로만든다.

 

%PM-4-ERR_DISABLE: psecure-violation error detected on Gi1/0/1, putting Gi1/0/1 in err-disable state%PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 001f.1629.e6f8 on port GigabitEthernet1/0/1.

->Port-Security 정책을위반하여발생하는Event Log


2. Violation restrict : Port-Security에서정책을위반한MAC-Address가연결되었을때, 위반한
MAC-address를가진Device의모든Frame은Drop된다. Drop됨과동시에

위반한MAC-Address에대해서Event log를발생한다.

Switch(Config)# interface gigabitethernet1/0/1
Switch(Config-if)# switchportport-security maximum 1
Switch(Config-if)# switchportport-security violation restrict

->해당Interface를Port-Security maximum-macaddress를지정하여1로지정하여이외의다른MAC이올라왔을경우위반한MAC-Address에대해서만모든Frame을폐기하며, Violation Event log를발생한다

%PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 001f.1629.e6f8 on port GigabitEthernet1/0/1.

->Port-Security Violation이발생하여,001f.1629.e6f8의MAC-Address를제한되었다는log


3. Violation Protect : restrict와동일하게동작하지만, Violation Event log를발생하지않는다.

Switch(Config)# interface gigabitethernet1/0/1
Switch(Config-if)# switchportport-security maximum 1
Switch(Config-if)# switchportport-security violation protect

->해당Interface를Port-Security maximum-macaddress를지정하여1로지정하여이외의다른MAC이올라왔을경우위반한MAC-Address에대해서만모든Frame을폐기하며, Violation Event log를발생하지않는다.


Port-Security Aging Time ?

Port-Security에는Port-Security에등록된MAC-Address에대한Aging Time이존재하는데Default로
Infinity 이다. Aging Time은Port-Security가Static or Dynamic으로적용된port에서만적용가능하다.
Aging Time은0-1440 Minute까지설정가능하며, 0=infinity로동작한다.

Port-Security Aging Time에는2가지방식이있다.


-Absolute :Port-Security에등록된MAC-Address가무조건해당

Aging Time이만료되어야Port-Security에등록된MAC-Address가삭제된다.

Switch(config)# interface gigabitEthernet1/0/1
Switch(config-if)# switchportport-security aging time 1
Switch(config-if)# switchportport-security aging type absolute


-Inactivity : Port-Security에등록된MAC-Address의Data Traffic이없는경우에무조건해당

Port-Security에등록된MAC-Address가삭제된다.

Switch(config)# interface gigabitEthernet1/0/1
Switch(config-if)# switchportport-security aging type inactivity
Switch(config-if)# switchportport-security aging time 1
Sample Configuration
ConfigurationSwitch(Config)# interface gigabitethernet1/0/1
Switch(Config-if)# switchportport-security ßPort-security enable
Switch(Config-if)# switchportport-security maximum 2 ß
->해당interface로학습될MAC-address 제한
Switch(Config-if)#switchportport-security mac-address[sticky,static]
->port-security type,default dynamic
Switch(Config-if)# switchportport-security violation [shutdown / restrict / protect]
Switch(Config-if)# switchportport-security aging static ß
->static으로지정한mac-address에대한aging time
Switch(Config-if)# switchportport-security aging time [0-1440 min] ß
->default 0sec, 0sec->infinity
Switch(Config-if)# switchportport-security aging type [absolute / inactivity] ß
->aging time type 결정


Show port-security interface [type_num]
Switch# show port-security interface gigabitethernet1/0/1
Port Security : Enabled
Port Status : Secure-up
Violation Mode : Shutdown
Aging Time : 1 mins
Aging Type : Absolute
SecureStaticAddress Aging : Enabled
Maximum MAC Addresses : 1
Total MAC Addresses : 1
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address:Vlan: 001f.1629.e6f8:1
Security Violation Count : 0








Port-Security Configuration

Show port-security address
Switch# show port-security address
Switch# showport-security address
Secure Mac Address Table
------------------------------------------------------------------------
Vlan  Mac Address      Type           Ports Remaining Age(mins)
------------------------------------------------------------------------
1   001f.1629.e6f8  SecureDynamic        Gi1/0/1 < 1
------------------------------------------------------------------------
Total Addresses in System (excluding one macper port) : 0Max Addresses limit in System (excluding one macper port) : 6144

 


->해당Interface에Static으로Mac-address를지정하여, Port-Security 적용

728x90
반응형
728x90
반응형

CLI기반의 초기 설정 모드

 

Pre-configure Firewall now through interactive prompts [yes]? Firewall Mode [Routed]:

->Routed Mode(Layer3) 또는Bridge(Transparent-Layer2) Mode 지정Routed Mode 시반드시NAT 구성을해야하며, Network 변경이필요하지만, Transparent 모드는네트워크구성이없음

 

Enable password [<use current password>]: cisco

->패스워드구성

Allow password recovery [yes]?

->패스워드복구기능을활성화시킬것인지정의

 

Clock (UTC):

Year [2005]:

Month [Nov]:

Day [2]:

Time [01:14:54]:17:48:00

->System Clock 정의

Inside IP address: 192.168.1.1

Inside network mask: 255.255.255.0

Host name: ASA

->Inside IP Address 정의및Host 이름정의

Use this configuration and write to flash? Yes

->Setup모드에서 구성한Config 저장여부

 

 

 

 

 

 

 

초기설치시에는Setup Setup 모드지정후Inside(Gigabit0/1) Inside 를통해ASDM으로바로접속가능

 

기본 환경 설정

Inside Interface or Management Interface 설정

 

ManagementInterface 설정하기

Interface Management0/0

no shutdown

description Interface for Management

nameifMgmt-Interface

management-only

->Management 용으로만사용할경우설정

ipaddress 1.1.1.1 255.255.255.0

->Mgmt IP Address 정의

 

외부접속용Interface(Outside) 정의

Interface GigabitEthernet0/0

no shutdown

nameifoutside

->Internet 접속용Interface 정의

security-level 0

->외부에서들어오는Interface 이므로보안등급이가장낮게정의0

ipaddress 10.10.10.1 255.255.255.0

->외부접속용IP Address 정의

 

내부접속용Interface(Inside) 정의

interface GigabitEthernet0/1

nameifinside

->내부Network을위한interface 정의

 

security-level 100

->내부Network 이므로가장높은보안등급정의100

ipaddress 192.168.1.1 255.255.255.0

interface GigabitEthernet0/2

description interface for LAN

nameifinside-2

->내부Network 가운데다른네트워크추가정의가능(보안등급0~100)

security-level 100

ipaddress 20.20.20.1 255.255.255.0

 

Same-Security-Level 정의

same-security-traffic permit inter-interface

->두개이상의서로다른nameif를가진물리적인터페이스가동일한보안등급

(Security-level)을가질경우Same-Security-level 정의를통한구성가능

 

ASA Firmware Upload 하기

ASA# copy ftp://anonymous@192.168.1.10/asa704-k8.bin disk0:   

  ->기본적으로장비에이미내장되어있음

 

ASA 운영을위한ASDM Upload 하기

ASA# copy ftp://anonymous@192.168.1.10/asdm504.bin disk0:   

->기본적으로장비에이미내장되어있음

 

다중Firmware 구성시Boot 환경설정

ASA(config)# boot system disk0:asa704-k8.bin

ASA# shbootvar

Current BOOT variable = disk0:/asa704-k8.bin

 

Disk0: 의정보확인

ASA# dirDirectory of disk0:/

2706 -rw-1589 00:06:14 Oct 10 2005 old_running.cfg

2707 -rw-1009 00:06:14 Oct 10 2005 admin.cfg

2709 -rw-1318 15:17:08 Jul 25 2005 c-a.cfg

2711 -rw-2167 00:30:14 Oct 16 2005 logo.gif

2712 -rw-5437440 19:07:04 Nov 02 2005 asa704-k8.bin

4040 -rw-5958324 19:08:22 Nov 02 2005 asdm504.bin

 

ASDM 접속을위한기본구성

ASA(config)# http server enable

->Web Service Enable

ASA(config)# http 192.168.0.0 255.255.0.0 inside

->웹서비스를접속할수있는Network 정의

 

ASA(config)# asdmimage disk0:/asdm504.bin

->ASDM image가있는디스크URL 정의

 

Telnet 접속을위한 기본구성

ASA(config)#telnet 0.0.0.0 0.0.0.0 inside

->Telnet 이가능한Network 정의

 

Inside Network 접속유무 Check를위한 ICMP허용

ASA(config)#icmp permit any inside

->inside Interface Ping Test 허용

 

 

 

 

 

 

728x90
반응형

+ Recent posts