<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Missing something on 700/1400 (R77.20.8x) ? hping3 on a 730 box in Spark Firewall (SMB)</title>
    <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Missing-something-on-700-1400-R77-20-8x-hping3-on-a-730-box/m-p/80175#M3356</link>
    <description>&lt;P&gt;Please refer to the rationale, the disclaimer and the requirements from my &lt;A href="https://community.checkpoint.com/t5/SMB-Appliances-and-SMP/Missing-something-on-700-1400-R77-20-8x-strace-on-a-730/m-p/80067#M3353" target="_self"&gt;previous&lt;/A&gt; post. The objective is to have the powerful network tool &lt;CODE&gt;hping3&lt;/CODE&gt; available on the 730-750/1430-1450 boxes (730 tested).&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;hping3&lt;/CODE&gt; depends on &lt;CODE&gt;libpcap&lt;/CODE&gt;, let's build it first. The output will be stored in your homedir:&lt;/P&gt;
&lt;PRE&gt;git clone https://github.com/the-tcpdump-group/libpcap
cd libpcap
git checkout origin/libpcap-1.9
autoreconf -i
./configure --prefix=${HOME}/libpcap-1.9.1 --build x86_64-pc-linux-gnu --host arm-linux-gnueabihf
make install
&lt;/PRE&gt;
&lt;P&gt;Check the output:&lt;/P&gt;
&lt;PRE&gt;file ${HOME}/libpcap-1.9.1/lib/libpcap.so.1.9.1 
/home/ps-101-ro/libpcap-1.9.1/lib/libpcap.so.1.9.1: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=bfe088ad0727a0f5198ddcfe4cad407a65e10759, not stripped
&lt;/PRE&gt;
&lt;P&gt;Let's build (statically linked) hping3&lt;/P&gt;
&lt;PRE&gt;git clone https://github.com/antirez/hping.git
cd hping
git checkout master
&lt;/PRE&gt;
&lt;P&gt;Change &lt;CODE&gt;Makefile.in&lt;/CODE&gt; to read:&lt;/P&gt;
&lt;PRE&gt;CC=/usr/bin/arm-linux-gnueabihf-gcc
AR=/usr/bin/arm-linux-gnueabihf-ar
RANLIB=/usr/bin/arm-linux-gnueabihf-ranlib
CCOPT= -DBYTE_ORDER_LITTLE_ENDIAN -D__LITTLE_ENDIAN_BITFIELD -I${HOME}/libpcap-1.9.1/include -I${HOME}/libpcap-1.9.1/include/pcap -L${HOME}/libpcap-1.9.1/lib
LD=/usr/bin/arm-linux-gnueabihf-ld
DEBUG= -g
&lt;/PRE&gt;
&lt;P&gt;Run:&lt;/P&gt;
&lt;PRE&gt;./configure --prefix=/storage --build x86_64-pc-linux-gnu --host arm-linux-gnueabihf --no-tcl
&lt;/PRE&gt;
&lt;P&gt;In &lt;CODE&gt;libpcap_stuff.c&lt;/CODE&gt; replace&lt;/P&gt;
&lt;PRE&gt;#include &amp;lt;net/bpf.h&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;PRE&gt;#include &amp;lt;pcap/bpf.h&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;Run &lt;CODE&gt;make hping3-static&lt;/CODE&gt;. Check the output:&lt;/P&gt;
&lt;PRE&gt;file hping3-static 
hping3-static: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=bf7d209a3322f2ed2560854270fae398354b8fc5, not stripped
&lt;/PRE&gt;
&lt;P&gt;Shrink it:&lt;/P&gt;
&lt;PRE&gt;arm-linux-gnueabihf-strip hping3-static
&lt;/PRE&gt;
&lt;P&gt;Upload &lt;CODE&gt;hping3-static&lt;/CODE&gt; to &lt;CODE&gt;/storage/&lt;/CODE&gt; in your box and fire it up (I tried to find the open TCP ports on the two-hops upstream gateway):&lt;/P&gt;
&lt;PRE&gt;./hping3-static -V -n --scan 21-80 -S 203.0.xxx.yyy   
using WAN, addr: 172.17.xxx.yyy, MTU: 1500
Scanning 203.0.xxx.yyy (203.0.xxx.yyy), port 21-80
60 ports to scan, use -V to see all the replies
+----+-----------+---------+---+-----+-----+-----+
|port| serv name |  flags  |ttl| id  | win | len |
+----+-----------+---------+---+-----+-----+-----+
   53 domain     : ....A...  63  5917 14600    46
   80 www        : ....A...  63  6173 14600    46
All replies received. Done.
Not responding ports: (21 ftp) (22 ssh) (23 telnet) (24 ) (25 smtp) (26 ) (27 ) (28 ) (29 ) (30 ) (31 ) (32 ) (33 ) (34 ) (35 ) (36 ) (37 time) (38 ) (39 rlp) (40 ) (41 ) (42 nameserver) (43 whois) (44 ) (45 ) (46 ) (47 ) (48 ) (49 ) (50 re-mail-ck) (51 ) (52 ) (54 ) (55 ) (56 ) (57 mtp) (58 ) (59 ) (60 ) (61 ) (62 ) (63 ) (64 ) (65 ) (66 ) (67 bootps) (68 bootpc) (69 tftp) (70 gopher) (71 ) (72 ) (73 ) (74 ) (75 ) (76 ) (77 rje) (78 ) (79 finger) 
&lt;/PRE&gt;
&lt;P&gt;Using &lt;CODE&gt;hping3&lt;/CODE&gt; might refresh our memory regarding the order in which protections are applied in a Check Point gateway:&lt;/P&gt;
&lt;PRE&gt;fw unloadlocal &amp;amp; echo 1 &amp;gt;&amp;gt; /proc/sys/net/ipv4/ip_forward
./hping3-static -V -p 80 -S -d 1000 -f 203.0.xxx.yyy &amp;amp;
... there will be no answer...
fw ctl zdebug + drop
... output ommited ...
;[cpu_0];[fw4_0];fw_log_drop_ex: Packet proto=6 172.17.xxx.yyy:1859 -&amp;gt; 203.0.xxx.yyy:80 dropped by asm_stateless_verifier Reason: received SYN packet with data, packet dropped.;
&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Stay healthy, stay secured!&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2020 09:15:17 GMT</pubDate>
    <dc:creator>APopisteru</dc:creator>
    <dc:date>2020-03-30T09:15:17Z</dc:date>
    <item>
      <title>Missing something on 700/1400 (R77.20.8x) ? hping3 on a 730 box</title>
      <link>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Missing-something-on-700-1400-R77-20-8x-hping3-on-a-730-box/m-p/80175#M3356</link>
      <description>&lt;P&gt;Please refer to the rationale, the disclaimer and the requirements from my &lt;A href="https://community.checkpoint.com/t5/SMB-Appliances-and-SMP/Missing-something-on-700-1400-R77-20-8x-strace-on-a-730/m-p/80067#M3353" target="_self"&gt;previous&lt;/A&gt; post. The objective is to have the powerful network tool &lt;CODE&gt;hping3&lt;/CODE&gt; available on the 730-750/1430-1450 boxes (730 tested).&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;hping3&lt;/CODE&gt; depends on &lt;CODE&gt;libpcap&lt;/CODE&gt;, let's build it first. The output will be stored in your homedir:&lt;/P&gt;
&lt;PRE&gt;git clone https://github.com/the-tcpdump-group/libpcap
cd libpcap
git checkout origin/libpcap-1.9
autoreconf -i
./configure --prefix=${HOME}/libpcap-1.9.1 --build x86_64-pc-linux-gnu --host arm-linux-gnueabihf
make install
&lt;/PRE&gt;
&lt;P&gt;Check the output:&lt;/P&gt;
&lt;PRE&gt;file ${HOME}/libpcap-1.9.1/lib/libpcap.so.1.9.1 
/home/ps-101-ro/libpcap-1.9.1/lib/libpcap.so.1.9.1: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=bfe088ad0727a0f5198ddcfe4cad407a65e10759, not stripped
&lt;/PRE&gt;
&lt;P&gt;Let's build (statically linked) hping3&lt;/P&gt;
&lt;PRE&gt;git clone https://github.com/antirez/hping.git
cd hping
git checkout master
&lt;/PRE&gt;
&lt;P&gt;Change &lt;CODE&gt;Makefile.in&lt;/CODE&gt; to read:&lt;/P&gt;
&lt;PRE&gt;CC=/usr/bin/arm-linux-gnueabihf-gcc
AR=/usr/bin/arm-linux-gnueabihf-ar
RANLIB=/usr/bin/arm-linux-gnueabihf-ranlib
CCOPT= -DBYTE_ORDER_LITTLE_ENDIAN -D__LITTLE_ENDIAN_BITFIELD -I${HOME}/libpcap-1.9.1/include -I${HOME}/libpcap-1.9.1/include/pcap -L${HOME}/libpcap-1.9.1/lib
LD=/usr/bin/arm-linux-gnueabihf-ld
DEBUG= -g
&lt;/PRE&gt;
&lt;P&gt;Run:&lt;/P&gt;
&lt;PRE&gt;./configure --prefix=/storage --build x86_64-pc-linux-gnu --host arm-linux-gnueabihf --no-tcl
&lt;/PRE&gt;
&lt;P&gt;In &lt;CODE&gt;libpcap_stuff.c&lt;/CODE&gt; replace&lt;/P&gt;
&lt;PRE&gt;#include &amp;lt;net/bpf.h&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;PRE&gt;#include &amp;lt;pcap/bpf.h&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;Run &lt;CODE&gt;make hping3-static&lt;/CODE&gt;. Check the output:&lt;/P&gt;
&lt;PRE&gt;file hping3-static 
hping3-static: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=bf7d209a3322f2ed2560854270fae398354b8fc5, not stripped
&lt;/PRE&gt;
&lt;P&gt;Shrink it:&lt;/P&gt;
&lt;PRE&gt;arm-linux-gnueabihf-strip hping3-static
&lt;/PRE&gt;
&lt;P&gt;Upload &lt;CODE&gt;hping3-static&lt;/CODE&gt; to &lt;CODE&gt;/storage/&lt;/CODE&gt; in your box and fire it up (I tried to find the open TCP ports on the two-hops upstream gateway):&lt;/P&gt;
&lt;PRE&gt;./hping3-static -V -n --scan 21-80 -S 203.0.xxx.yyy   
using WAN, addr: 172.17.xxx.yyy, MTU: 1500
Scanning 203.0.xxx.yyy (203.0.xxx.yyy), port 21-80
60 ports to scan, use -V to see all the replies
+----+-----------+---------+---+-----+-----+-----+
|port| serv name |  flags  |ttl| id  | win | len |
+----+-----------+---------+---+-----+-----+-----+
   53 domain     : ....A...  63  5917 14600    46
   80 www        : ....A...  63  6173 14600    46
All replies received. Done.
Not responding ports: (21 ftp) (22 ssh) (23 telnet) (24 ) (25 smtp) (26 ) (27 ) (28 ) (29 ) (30 ) (31 ) (32 ) (33 ) (34 ) (35 ) (36 ) (37 time) (38 ) (39 rlp) (40 ) (41 ) (42 nameserver) (43 whois) (44 ) (45 ) (46 ) (47 ) (48 ) (49 ) (50 re-mail-ck) (51 ) (52 ) (54 ) (55 ) (56 ) (57 mtp) (58 ) (59 ) (60 ) (61 ) (62 ) (63 ) (64 ) (65 ) (66 ) (67 bootps) (68 bootpc) (69 tftp) (70 gopher) (71 ) (72 ) (73 ) (74 ) (75 ) (76 ) (77 rje) (78 ) (79 finger) 
&lt;/PRE&gt;
&lt;P&gt;Using &lt;CODE&gt;hping3&lt;/CODE&gt; might refresh our memory regarding the order in which protections are applied in a Check Point gateway:&lt;/P&gt;
&lt;PRE&gt;fw unloadlocal &amp;amp; echo 1 &amp;gt;&amp;gt; /proc/sys/net/ipv4/ip_forward
./hping3-static -V -p 80 -S -d 1000 -f 203.0.xxx.yyy &amp;amp;
... there will be no answer...
fw ctl zdebug + drop
... output ommited ...
;[cpu_0];[fw4_0];fw_log_drop_ex: Packet proto=6 172.17.xxx.yyy:1859 -&amp;gt; 203.0.xxx.yyy:80 dropped by asm_stateless_verifier Reason: received SYN packet with data, packet dropped.;
&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Stay healthy, stay secured!&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 09:15:17 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Spark-Firewall-SMB/Missing-something-on-700-1400-R77-20-8x-hping3-on-a-730-box/m-p/80175#M3356</guid>
      <dc:creator>APopisteru</dc:creator>
      <dc:date>2020-03-30T09:15:17Z</dc:date>
    </item>
  </channel>
</rss>

