# 264/tcp - Pentesting Check Point Firewall
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
CheckPoint Firewall-1 firewalls์ ์ํธ์์ฉํ์ฌ firewall ์ด๋ฆ ๋ฐ Management Station ์ด๋ฆ๊ณผ ๊ฐ์ ์ ์ฉํ ์ ๋ณด๋ฅผ ์์๋ผ ์ ์์ต๋๋ค. ์ด๋ ํฌํธ 264/TCP๋ก ์ฟผ๋ฆฌ๋ฅผ ์ ์กํ์ฌ ์ํํ ์ ์์ต๋๋ค.
Firewall ๋ฐ Management Station ์ด๋ฆ ์ป๊ธฐ
์ฌ์ ์ธ์ฆ ์์ฒญ(pre-authentication request)์ ์ฌ์ฉํ๋ฉด CheckPoint Firewall-1์ ๋์์ผ๋ก ํ๋ ๋ชจ๋์ ์คํํ ์ ์์ต๋๋ค. ์ด ์์ ์ ํ์ํ ๋ช ๋ น์ ์๋์ ๋์ ์์ต๋๋ค:
use auxiliary/gather/checkpoint_hostname
set RHOST 10.10.10.10
์คํ ์, ๋ชจ๋์ firewall์ SecuRemote Topology service์ ์ ์์ ์๋ํฉ๋๋ค. ์ฑ๊ณตํ๋ฉด CheckPoint Firewall์ ์กด์ฌ๋ฅผ ํ์ธํ๊ณ firewall๊ณผ SmartCenter ๊ด๋ฆฌ ํธ์คํธ์ ์ด๋ฆ์ ๊ฐ์ ธ์ต๋๋ค. ์ถ๋ ฅ ์์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
[*] Attempting to contact Checkpoint FW1 SecuRemote Topology service...
[+] Appears to be a CheckPoint Firewall...
[+] Firewall Host: FIREFIGHTER-SEC
[+] SmartCenter Host: FIREFIGHTER-MGMT.example.com
[*] Auxiliary module execution completed
Hostname ๋ฐ ICA Name ๊ฒ์์ ์ํ ๋์ฒด ๋ฐฉ๋ฒ
๋ ๋ค๋ฅธ ๊ธฐ๋ฒ์ผ๋ก๋ firewall์ ํน์ ์ฟผ๋ฆฌ๋ฅผ ์ง์ ์ ์กํ๊ณ ์๋ต์ ํ์ฑํ์ฌ firewall์ hostname๊ณผ ICA name์ ์ถ์ถํ๋ ๋ช ๋ น์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ด ์๋ค. ๋ช ๋ น๊ณผ ๊ทธ ๊ตฌ์กฐ๋ ๋ค์๊ณผ ๊ฐ๋ค:
printf '\x51\x00\x00\x00\x00\x00\x00\x21\x00\x00\x00\x0bsecuremote\x00' | nc -q 1 10.10.10.10 264 | grep -a CN | cut -c 2-
์ด ๋ช ๋ น์ ์ถ๋ ฅ์ ์๋์ ์์๋ ๊ฒ์ฒ๋ผ ๋ฐฉํ๋ฒฝ์ ์ธ์ฆ์ ์ด๋ฆ(CN) ๋ฐ ์กฐ์ง(O)์ ๊ดํ ์์ธ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค:
CN=Panama,O=MGMTT.srv.rxfrmi
HTTP Security Server Format String Bug (CAN-2004-0039)
Affected builds: NG FCS, NG FP1, NG FP2, NG FP3 HF2, and NG with Application Intelligence R54/R55.
Requirement: HTTP Security Server ๋๋ AI HTTP proxy๊ฐ ํ์ฑํ๋์ด ๋์ ํฌํธ๋ฅผ ํฌ๋ช
ํ๊ฒ ๊ฒ์ฌํ๊ณ ์์ด์ผ ํฉ๋๋ค. HTTP inspection์ด ๋นํ์ฑํ๋์ด ์์ผ๋ฉด ์ทจ์ฝํ ์ฝ๋ ๊ฒฝ๋ก์ ์ ํ ๋๋ฌํ์ง ์์ต๋๋ค.
Triggering the error handler
ํ๋ก์๋ ์๋ชป๋ ํํ์ HTTP ๋ฉ์์ง๋ฅผ ๊ฑฐ๋ถํ๊ณ sprintf(errbuf, attacker_string);๋ก ์์ฒด ์๋ฌ ํ์ด์ง๋ฅผ ์์ฑํ์ฌ ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ ๋ฐ์ดํธ๊ฐ ํฌ๋งท ๋ฌธ์์ด๋ก ๋์ํ๋๋ก ํฉ๋๋ค. ๋ฐฉํ๋ฒฝ์ ํตํด ์๋ชป๋ ์์ฒญ์ ๋ณด๋ด๊ณ ํ์ด๋ก๋๊ฐ ๋ฐ์๋ ํ๋ก์ ์์ฑ ์๋ฌ๋ฅผ ์ฐพ์๋ณด์ธ์:
printf 'BOGUS%%08x%%08x%%08x%%n HTTP/1.0\r\nHost: internal.local\r\n\r\n' | nc -nv [FIREWALL_IP] 80
If HTTP inspection์ด activeํ๋ฉด, firewall(backend server๊ฐ ์๋๋ผ)๊ฐ ์ฆ์ ์๋ตํ์ฌ middlebox๊ฐ request line์ ํ์ฑํ๊ณ replayedํ์์ ์ฆ๋ช ํ๋ค.
Exploitation
Format string primitive
- parser๋ฅผ error routine์ผ๋ก ๊ฐ์ ์ง์ ์ํจ๋ค (invalid method, URI, or headers).
- ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ dwords๋ฅผ ์๋ถ๋ถ์ ๋ฐฐ์นํ์ฌ
%x,%s,%n์ง์์๊ฐ ์ด๋ฅผ stack arguments๋ก ์ทจ๊ธํ๊ฒ ํ๋ค. %x/%s๋ฅผ ์ฌ์ฉํด pointers๋ฅผ leakํ ๋ค์,%n/%hn์ผ๋ก ํฌ๋งคํ ๋ ๋ฐ์ดํธ ์๋ฅผ ์ ํํ ์ฃผ์์ ๊ธฐ๋กํด return pointers, vtables, ๋๋ heap metadata๋ฅผ ๋ฎ์ด์ด ๋ค injected shellcode๋ ROP๋ก ์คํ์ ํ์ทจํ๋ค.
Heap overflow primitive
๊ฐ์ unsafe sprintf()๊ฐ fixed-size heap buffer์ ์ฐ๊ธฐ๋ฅผ ์ํํ๋ค. ๊ธด request body์ oversized directives(์: %99999x)๋ฅผ ์์ด ํฌ๋งคํ
๋ ์ถ๋ ฅ์ด ํ ๋น์ ๋์น๊ฒ ํ๋ฉด ์ธ์ ํ heap ๊ตฌ์กฐ๋ค์ด ์์๋์ด ์ดํ ์ฐธ์กฐ๋๋ freelist pointers๋ function tables๋ฅผ ์์กฐํ ์ ์๋ค.
Impact
proxy๊ฐ ์์๋๋ฉด firewall process ๋ด์์ ์ฝ๋ ์คํ ๊ถํ์ ํ๋ํ๊ฒ ๋๋ค (SYSTEM on Windows appliances, root on UNIX). ์ด๋ฅผ ํตํด rule manipulation, traffic interception, ๋ฐ management network๋ก์ pivoting์ด ๊ฐ๋ฅํด์ง๋ค.
References
- https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk69360
- https://bitvijays.github.io/LFF-IPS-P2-VulnerabilityAnalysis.html#check-point-firewall-1-topology-port-264
- https://www.cisa.gov/news-events/alerts/2004/02/05/http-parsing-vulnerabilities-check-point-firewall-1
- http://xforce.iss.net/xforce/alerts/id/162
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


