# 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 का समर्थन करें

यह संभव है कि आप CheckPoint Firewall-1 फ़ायरवॉल के साथ इंटरैक्ट करके ऐसी मूल्यवान जानकारी खोज सकें जैसे फ़ायरवॉल का नाम और management station का नाम। यह पोर्ट 264/TCP पर एक क्वेरी भेजकर किया जा सकता है।

Firewall और Management Station के नाम प्राप्त करना

एक pre-authentication request का उपयोग करके, आप CheckPoint Firewall-1 को लक्ष्य करने वाला एक module execute कर सकते हैं। इस ऑपरेशन के लिए आवश्यक commands नीचे दिए गए हैं:

use auxiliary/gather/checkpoint_hostname
set RHOST 10.10.10.10

जब मॉड्यूल चलाया जाता है, यह firewall के SecuRemote Topology service से संपर्क करने का प्रयास करता है। यदि सफल होता है, तो यह CheckPoint Firewall की उपस्थिति की पुष्टि करता है और firewall तथा SmartCenter management host दोनों के नाम प्राप्त करता है। यहाँ एक उदाहरण है कि आउटपुट कैसा दिख सकता है:

[*] 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 and ICA Name Discovery के लिए वैकल्पिक विधि

एक अन्य तकनीक में एक direct command शामिल है जो firewall को एक specific query भेजता है और response को parse करके firewall का hostname और ICA name निकालता है। Command और उसकी संरचना निम्नलिखित हैं:

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-

इस कमांड के आउटपुट में firewall के certificate name (CN) और organization (O) से संबंधित विस्तृत जानकारी मिलती है, जैसा कि नीचे दिखाया गया है:

CN=Panama,O=MGMTT.srv.rxfrmi

HTTP Security Server Format String Bug (CAN-2004-0039)

प्रभावित बिल्ड: NG FCS, NG FP1, NG FP2, NG FP3 HF2, and NG with Application Intelligence R54/R55.
आवश्यकता: The HTTP Security Server or AI HTTP proxy must be enabled and transparently inspecting the targeted port; if HTTP inspection is disabled the vulnerable code path is never reached.

त्रुटि हैंडलर ट्रिगर करना

प्रॉक्सी malformed HTTP messages को reject करता है और sprintf(errbuf, attacker_string); के साथ अपना खुद का error page बनाता है, जिससे attacker-controlled bytes format string के रूप में कार्य करते हैं। फ़ायरवॉल के माध्यम से एक invalid request भेजें और अपने payload को प्रतिबिंबित करने वाली किसी proxy-generated error की तलाश करें:

printf 'BOGUS%%08x%%08x%%08x%%n HTTP/1.0\r\nHost: internal.local\r\n\r\n' | nc -nv [FIREWALL_IP] 80

यदि HTTP inspection सक्रिय है, तो firewall (not the backend server) तुरंत उत्तर देता है, यह सिद्ध करता है कि middlebox ने request line को parsed और replayed किया।

शोषण

Format string primitive

  • parser को error routine में मजबूर करें (invalid method, URI, or headers).
  • attacker-controlled dwords को आगे रखें ताकि %x, %s, और %n directives उन्हें stack arguments के रूप में मानें।
  • %x/%s का उपयोग करके leak pointers, फिर %n/%hn से formatted byte count को चुनी हुई addresses में लिखें, return pointers, vtables, या heap metadata को overwrite करते हुए और फिर injected shellcode या ROP के साथ execution hijack करें।

Heap overflow primitive

वही unsafe sprintf() fixed-size heap buffer में लिखता है। एक लंबा request body को oversized directives (e.g., %99999x) के साथ मिलाएँ ताकि formatted output allocation को overrun कर दे और आस-पास के heap structures को corrupt कर दे, जिससे आप बाद में dereference होने वाले freelist pointers या function tables को forge कर सकें।

प्रभाव

Proxy compromise होने पर firewall process के अंदर code execution मिल जाता है (SYSTEM on Windows appliances, root on UNIX), जिससे rule manipulation, traffic interception, और management network में और गहराई तक pivoting संभव हो जाता है।

संदर्भ

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 का समर्थन करें