From ab7ea536d808712f08a9f921e43275f1d10d11e0 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 16 Jul 2020 12:33:22 +0200 Subject: [PATCH] ec_fingerprint: fix POST URI to work with new HTTP1.1 --- src/ec_fingerprint.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ec_fingerprint.c b/src/ec_fingerprint.c index 29689bee5..30a7304aa 100644 --- a/src/ec_fingerprint.c +++ b/src/ec_fingerprint.c @@ -293,6 +293,15 @@ u_int8 TTL_PREDICTOR(u_int8 x) /* * submit a fingerprint to the ettercap website + * Example of php code to intercept the post + + */ int fingerprint_submit(const char *finger, char *os) { @@ -337,11 +346,14 @@ int fingerprint_submit(const char *finger, char *os) os_encoded[i] = '+'; /* prepare the HTTP request */ - snprintf(getmsg, sizeof(getmsg), "POST %s?finger=%s&os=%s HTTP/1.1\r\n" + snprintf(getmsg, sizeof(getmsg), "POST %s HTTP/1.1\r\n" "Host: %s\r\n" "Accept: */*\r\n" "User-Agent: %s (%s)\r\n" - "\r\n", page, finger, os_encoded, host, EC_GBL_PROGRAM, EC_GBL_VERSION ); + "Content-Length: %d\r\n" + "Content-Type: application/x-www-form-urlencoded \r\n\r\n" + "finger=%s&os=%s\r\n" + "\r\n", page, host, EC_GBL_PROGRAM, EC_GBL_VERSION, 7 + strlen(finger) + 4 + strlen(os_encoded), finger, os_encoded ); SAFE_FREE(os_encoded);