mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-06 04:51:40 -07:00
parse optional header string e.g. (h|H=My-Hdr\: foo) for non-form based http requests
This commit is contained in:
parent
689b20f60a
commit
a6db85b963
1 changed files with 12 additions and 0 deletions
12
hydra-http.c
12
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue