From a6db85b963b606f7b5cb371e7448dabc4efb529d Mon Sep 17 00:00:00 2001 From: mathewmarcus Date: Sat, 14 Jul 2018 16:14:40 -0500 Subject: [PATCH] parse optional header string e.g. (h|H=My-Hdr\: foo) for non-form based http requests --- hydra-http.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hydra-http.c b/hydra-http.c index ddbec4c..b61cbf8 100644 --- a/hydra-http.c +++ b/hydra-http.c @@ -1,4 +1,5 @@ #include "hydra-mod.h" +#include "hydra-http.h" #include "sasl.h" extern char *HYDRA_EXIT; @@ -244,6 +245,7 @@ void service_http(char *ip, int32_t sp, unsigned char options, char *miscptr, FI int32_t run = 1, next_run = 1, sock = -1; int32_t myport = PORT_HTTP, mysslport = PORT_HTTP_SSL; char *ptr, *ptr2; + ptr_header_node ptr_head; hydra_register_socket(sp); if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0) @@ -278,6 +280,16 @@ void service_http(char *ip, int32_t sp, unsigned char options, char *miscptr, FI else webport = mysslport; + /* Advance to options string */ + ptr = miscptr; + while (*ptr != 0 && (*ptr != ':' || *(ptr - 1) == '\\')) + ptr++; + if (*ptr != 0) + *ptr++ = 0; + optional1 = ptr; + + ptr_head = parse_options(optional1); + while (1) { next_run = 0; switch (run) {