ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๊ฐœ์š”

Simple Network Management Protocol์˜ ์•ฝ์ž๋กœ ์‰ฝ๊ฒŒ ๋งํ•ด ํ•˜๋‚˜ ์ด์ƒ์˜ ๋„คํŠธ์›Œํฌ๋ฅผ ๊ฐœ๋ณ„์ ์œผ๋กœ ๋ฒˆ๊ฑฐ๋กญ๊ฒŒ ๊ด€๋ฆฌํ•˜์ง€ ์•Š๊ณ  ์ค‘์•™์ง‘์ค‘ ๋ฐฉ์‹์œผ๋กœ ํŽธํ•˜๊ฒŒ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ๊ฐœ๋ฐœ๋œ ํ”„๋กœํ† ์ฝœ์ž…๋‹ˆ๋‹ค.

 

SNMP๋Š” UDP ๋ฐฉ์‹์œผ๋กœ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•  ๋Œ€์ƒ์ธ ํ˜ธ์ŠคํŠธ(Agent)๋Š” 161๋ฒˆ PORT๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ๊ทธ๋Ÿฌํ•œ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•ด ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๊ด€๋ฆฌ๋ฅผ ํ•˜๋Š” ๊ด€๋ฆฌ์ž๋Š” 162๋ฒˆ PORT ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

 

๋ฒ„์ „ ํŠน์ง•
SNMP v1 : ์•”ํ˜ธํ™” ๊ธฐ๋Šฅ์ด ์ „ํ˜€ ์—†์–ด ๋ณด์•ˆ์— ์ทจ์•ฝ, Community String์ด๋ผ๋Š” ์ธ์ฆ์—๋งŒ ์˜์กด
SNMP v2 : ๋ณด์•ˆ์ธก๋ฉด์„ ๊ณ ๋ คํ–ˆ์ง€๋งŒ ๋ณด์•ˆ ์‹œ์Šคํ…œ์ด ๋„ˆ๋ฌด ๋ณต์žกํ•˜๋‹ค ํ‰๊ฐ€๋˜์–ด ์ƒ์šฉํ™”๊ฐ€ ๋˜์ง€ ๋ชปํ•จ
SNMP v2c : ๋ณด์•ˆ ๊ธฐ๋Šฅ์ด ์ œ๊ฑฐ๋˜์—ˆ์œผ๋ฉฐ v2 ๋ณด๋‹จ v2c ๊ฐ€ ๋” ์‚ฌ์šฉํ™”, Community String ๋ฐฉ์‹์„ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ
SNMP v3 : (DES)๋ผ๋Š” ๋Œ€์นญํ‚ค ์•”ํ˜ธํ™” ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ง€์›ํ•˜์—ฌ ๋ณด์•ˆ์„ฑ์€ ๋†’์˜€์ง€๋งŒ ํ˜ธํ™˜์„ฑ์˜ ๋ฌธ์ œ
Community String ์ด๋ž€

SNMP์—์„œ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ์ธ์ฆํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋ฉฐ ๋ฏธ๋ฆฌ ์„ค์ •๋œ ๋ฌธ์ž์—ด์„ ๊ฐ€์ง€๊ณ  ์ž์‹ ์˜ ํŒจ์Šค์›Œ๋“œ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๊ณผ ์œ ์‚ฌ

public : read-only๋กœ ๋™์ž‘, ์ •๋ณด๋ฅผ ์ฝ๊ธฐ๋งŒ ๊ฐ€๋Šฅ(default)

private : read-write๋กœ ๋™์ž‘, ์ฝ๊ธฐ/์“ฐ๊ธฐ ์ฆ‰ config ํŒŒ์ผ์„ ์ˆ˜์ •๋„ ํ•  ์ˆ˜ ์žˆ์Œ

 

์–ด๋–ค ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ• ์ˆ˜ ์žˆ๋‚˜
(1) UDP ํ†ต์‹ ์œผ๋กœ ์ธํ•œ ๋‚ฎ์€ ์‹ ๋ขฐ์„ฑ๊ณผ ํ‰๋ฌธ ์ •์†ก์œผ๋กœ ์ •๋ณด ๋…ธ์ถœ
(2) Community String์˜ default ๊ฐ’์œผ๋กœ ์ธํ•ด ์‹œ์Šคํ…œ์˜ ์ฃผ์š” ์ •๋ณด ๋ฐ ์„ค์ •์„ ํŒŒ์•…
(3) ์ทจ์•ฝํ•œ snmp ํ”„๋กœํ† ์ฝœ์„ ๋Œ€์ƒ์œผ๋กœ DOS attack

nmap ์Šค์บ๋‹์„ ํ†ตํ•ด snmp ๊ตฌ๋™ ์ค‘์ธ ๊ฒƒ์„ ํ™•์ธํ•˜์˜€์œผ๋‹ˆ metasploit์˜ msfconsole์„ ํ†ตํ•ด Community String ๊ฐ’์ด default ๊ฐ’์ธ์ง€ ๊ฒ€์ฆ์„ ํ™•์ธํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 <!-- Command ์ž…๋ ฅ -->
 msfconsole
 msf5 > use auxiliary/scanner/snmp/snmp_login 
 msf5 auxiliary(scanner/snmp/snmp_login) > set RHOSTS 192.168.0.0-192.168.0.255
 RHOSTS => 192.168.0.0-192.168.0.255 --> ์ „์ฒด๋Œ€์—ญ ์Šค์บ”
 msf5 auxiliary(scanner/snmp/snmp_login) > exploit

์ „์ฒด ๋Œ€์—ญ์„ ์Šค์บ”ํ•˜์—ฌ ์—ฌ๋Ÿฌ ๋Œ€์ƒ์„ ์Šค์บ”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ์ ์œผ๋กœ 192.168.0.131์— public์™€ private ๋กœ๊ทธ์ธ์ด ๋ชจ๋‘ ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.

 

 msfconsole
 msf5 > use auxiliary/scanner/snmp/snmp_enum
 msf5 auxiliary(scanner/snmp/snmp_enum) > set RHOSTS 192.168.0.131
 RHOSTS => 192.168.0.131
 msf5 auxiliary(scanner/snmp/snmp_enum) > run
 [*] System information
 [*] Network information:
 [*] Network interfaces:
 [*] Network IP:
 [*] Routing information:
 [*] TCP connections and listening ports:
 [*] Listening UDP ports:
 [*] Storage information:
 [*] Device information:
 [*] Processes:
 ๋“ฑ ํ™•์ธ ๊ฐ€๋Šฅ

snmp_enum ๋ชจ๋“ˆ์„ ํ†ตํ•ด snmp๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์„œ๋น„์Šค์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์ •๋ณด๋ฅผ ์—ด๊ฑฐํ•˜๋„๋ก ์‹œ๋„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

ํ˜ธ์ŠคํŠธ ์ด๋ฆ„, ๋„คํŠธ์›Œํฌ ์ •๋ณด, ๊ฐ€๋™ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค, ๋ผ์šฐํŒ… ์ •๋ณด ๋“ฑ ๋‹ค์–‘ํ•œ ๊ณ ๊ธ‰ ์ •๋ณด๊ฐ€ ์ถœ๋ ฅ๋˜๋ฉฐ ์ด์ค‘์—์„œ ๋…ธ์ถœ๋˜์ง€ ๋ง์•„์•ผ ํ•  ๋ฏผ๊ฐ์ •๋ณด๊ฐ€ ํฌํ•จ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค.

 

๊ณต๊ฒฉ ํ›„ ๋ฐœ์ƒ๋œ ํŒจํ‚ท์„ ํ™•์ธํ•˜์—ฌ ๋‚ด๋ถ€๋ฅผ ํ™•์ธํ•ด ๋ณด๋ฉด

 

get-request๋ฅผ ํ†ตํ•ด ๋ฌด์ž‘์œ„๋กœ ์ ‘์† ์‹œ๋„๋ฅผ ํ•˜๊ณ  ์žˆ์œผ๋ฉฐ get-response์˜ ์‘๋‹ต ํŒจํ‚ท์„ ํ™•์ธํ•ด๋ณด๋ฉด ๋Œ€์ƒ ์‹œ์Šคํ…œ์—์„œ SNMP์˜ Commnunity String ๊ฐ’์„ ๊ธฐ๋ณธ private / privacy๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

snmp ์„œ๋น„์Šค๋ฅผ ๋Œ€์ƒ์œผ๋กœ DOS ๊ณต๊ฒฉ์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•œ๋Œ€์˜ ์„œ๋ฒ„๋กœ ๋Œ€์ƒ์˜ ์„œ๋น„์Šค๋ฅผ ๋ฌด๋ ฅํ™”์‹œํ‚ค๊ธฐ์—๋Š” ์‰ฝ์ง€ ์•Š์ง€๋งŒ ์—ฌ๋Ÿฌ ์ข€๋น„ PC๋ฅผ ํ•จ๊ป˜ ๋ฌถ์–ด ์ „์†กํ•œ๋‹ค๋ฉด ์‹œ์Šคํ…œ์— ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ๊ฐ€๋Šฅ์„ฑ์€ ๋”์šฑ ๋†’์•„์ง‘๋‹ˆ๋‹ค.

 

ํฐ ํƒ€๊ฒฉ์€ ์ค„์ˆ˜ ์—†์ง€๋งŒ ๋Œ€์ƒ์˜ ๋„คํŠธ์›Œํฌ ํŠธ๋ž˜ํ”ฝ ์ƒํƒœ๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด ๊ธ‰๊ฒฉํ•˜๊ฒŒ ์ƒ์Šนํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 


๋Œ€์‘ ๋ฐฉ์•ˆ

SNMP ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋‹ค๋ฉด ๋น„ํ™œ์„ฑํ™”์‹œ์ผœ๋‘๋Š” ๊ฒƒ์ด ์ œ์ผ ์ข‹์œผ๋ฉฐ ๋ถˆ๊ฐ€ํ”ผํ•˜๊ฒŒ ์‚ฌ์šฉํ•ด์•ผ ๋œ๋‹ค๋ฉด Community String ๊ฐ’์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ณ€๊ฒฝํ•ด์„œ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

๋ณ€๊ฒฝํ•˜์˜€๋‹ค ํ•˜๋”๋ผ๋„ Community String ๊ฐ’์„ ์ฐพ์•„๋‚ด๊ธฐ ์œ„ํ•ด Brute Force ๋‚˜ Dictionary Attack ๊ฐ™์€ ๋ฌด์ฐจ๋ณ„ ๋Œ€์ž… ๊ณต๊ฒฉ์„ ์‹œ๋„ํ•  ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ๊ธฐ์— ์‚ฌ์ „์— ์ ‘๊ทผ์ œ์–ด๋ฅผ ๊ฑธ์–ด๋‘์–ด ํ•„์š”ํ•œ ์‚ฌ์šฉ์ž๋งŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

Community String ๊ฐ’ ๋ณ€๊ฒฝ

 <!--Community String ๊ฐ’ ๋ณ€๊ฒฝ --> /etc/snmp/snmpd.conf-->
 #sec.name source community
 #com2sec paranoid  default     public
 com2sec readonly  default      public  --> ์ž„์˜ ๊ฐ’ ์œผ๋กœ ๋ณ€๊ฒฝ
 com2sec readwrite default      private  --> ์ž„์˜ ๊ฐ’ ์œผ๋กœ ๋ณ€๊ฒฝ

์ ‘๊ทผ์ œ์–ด ์ •์ฑ… ์„ค์ •

 <!--๋ผ์šฐํ„ฐ ๋‚˜ ์Šค์œ„์น˜๋ฅผ ํ†ตํ•ด ์ ‘๊ทผ์ œ์–ด ์ •์ฑ…์„ ์„ค์ •-->
 router# conf t
 router# access-list 88 permit 100.183.121.0 0.0.0.255
 router# access-list 88 permit 100.183.235.0 0.0.0.255
 router# access-list 88 deny any
๊ณต์œ ํ•˜๊ธฐ ๋งํฌ
Comment