# 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을 제출하여 해킹 트릭을 공유하세요.


