Re: Is a HTTP header a clear text?



On Oct 23, 11:11 pm, Sonny <smani...@xxxxxxxxx> wrote:

Here is a snippet of our code to get the http payload

ret = nfq_get_payload(tb, &data);
if (ret >= 0)
{
printf("payload_len=%d ", ret);

struct iphdr *iph = ((struct iphdr *) data);

if((iph->protocol) == 6)
{
printf("TCP!\n");
struct tcphdr *tcph = ((struct tcphdr *) (data +
sizeof(struct iphdr)));
httppayload = data + (sizeof(struct iphdr) + sizeof(struct
tcphdr));

HttpParser(httppayload);
....
}

Is it correct?

Umm, no. Not even close. The three biggest problems are:

1) How is HttpParser supposed to parse the payload without knowing how
many bytes long it is?!

2) What if the payload is split over two packets?

3) What if the payload is split over two packets and the first packet
is retransmitted?

DS

.



Relevant Pages

  • Re: "shadow" a user?
    ... INIT { ... if ($endian eq '0x78') { ... packets with data. ... -D Print all payload data, ...
    (AIX-L)
  • problem with NdisReturnPackets ( )
    ... If you queue the packets then you must alloc and copy the ... payload in the original packet descriptor. ... >If kernel debugger is available get stack backtrace. ...
    (microsoft.public.development.device.drivers)
  • Re: DMA operation to 64-bits PC platform
    ... On Aug 11, 5:50 pm, Frank van Eijkelenburg ... mistakes of others, here comes the cause of the problem: ... The packets which were transmitted to the pc were too large (more than ... payload size from the device control register in the PCI Express ...
    (comp.arch.fpga)
  • network mystery
    ... strange packets started showing up on my LAN. ... Network Browser (again the payload of the packet ... a malfunctioning file sharing tool (akin to Grokster, ...
    (Incidents)
  • searching for a string in the data contents of a socket buffer
    ... I'm trying to search for character stings in the payload of udp ... packets inside a socket buffer (in the kernel before the socket buffer ... The packets come across the network in big endian byte order. ...
    (comp.os.linux.questions)