Hi,
I've noticed that when using hping there is name inconsistency (ports
are referring to it as hping but hping is referring to itself as
hping2 in one case). This patch will correct this.

Cheers.

P.S.
Why there is no hping at openports.se ?


$OpenBSD: patch-main_c,v 1.1 2005/04/24 22:59:08 alek Exp $
--- main.c.orig Fri Aug  8 01:55:55 2003
+++ main.c      Tue Apr 14 12:06:41 2009
@@ -180,8 +180,8 @@ int main(int argc, char **argv)
        int c, hdr_size;
 
        if (parse_options(argc, argv) == -1) {
-               printf("hping2: missing host argument\n"
-                       "Try `hping2 --help' for more information.\n");
+               printf("hping: missing host argument\n"
+                       "Try `hping --help' for more information.\n");
                exit(1);
        }
 
@@ -315,24 +315,24 @@ int main(int argc, char **argv)
        }
 
        if (opt_rawipmode) {
-               strcat(setflags, "raw IP mode");
+               strlcat(setflags, "raw IP mode", sizeof(setflags));
                hdr_size = IPHDR_SIZE;
        } else if (opt_icmpmode) {
-               strcat(setflags, "icmp mode");
+               strlcat(setflags, "icmp mode", sizeof(setflags));
                hdr_size = IPHDR_SIZE + ICMPHDR_SIZE;
        } else if (opt_udpmode) {
-               strcat(setflags, "udp mode");
+               strlcat(setflags, "udp mode", sizeof(setflags));
                hdr_size = IPHDR_SIZE + UDPHDR_SIZE;
        } else {
-               if (tcp_th_flags & TH_RST)  strcat(setflags, "R");
-               if (tcp_th_flags & TH_SYN)  strcat(setflags, "S");
-               if (tcp_th_flags & TH_ACK)  strcat(setflags, "A");
-               if (tcp_th_flags & TH_FIN)  strcat(setflags, "F");
-               if (tcp_th_flags & TH_PUSH) strcat(setflags, "P");
-               if (tcp_th_flags & TH_URG)  strcat(setflags, "U");
-               if (tcp_th_flags & TH_X)    strcat(setflags, "X");
-               if (tcp_th_flags & TH_Y)    strcat(setflags, "Y");
-               if (setflags[0] == '\0')    strcat(setflags, "NO FLAGS
are");
+               if (tcp_th_flags & TH_RST)  strlcat(setflags, "R",
sizeof(setflags));
+               if (tcp_th_flags & TH_SYN)  strlcat(setflags, "S",
sizeof(setflags));
+               if (tcp_th_flags & TH_ACK)  strlcat(setflags, "A",
sizeof(setflags));
+               if (tcp_th_flags & TH_FIN)  strlcat(setflags, "F",
sizeof(setflags));
+               if (tcp_th_flags & TH_PUSH) strlcat(setflags, "P",
sizeof(setflags));
+               if (tcp_th_flags & TH_URG)  strlcat(setflags, "U",
sizeof(setflags));
+               if (tcp_th_flags & TH_X)    strlcat(setflags, "X",
sizeof(setflags));
+               if (tcp_th_flags & TH_Y)    strlcat(setflags, "Y",
sizeof(setflags));
+               if (setflags[0] == '\0')    strlcat(setflags, "NO
FLAGS are", sizeof(setflags)); hdr_size = IPHDR_SIZE + TCPHDR_SIZE;
        }
        

Attachment: patch-main_c
Description: Binary data

Reply via email to