Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Content length less than File byte-size, did it fully download?

Trying to determine if a user actually downloaded an executable file from a website. I examined the pcap and I see that the Content-Length field = 784,536 but the Server->User is 430,380 bytes. This tells me that the user did not fully download the file. I also downloaded the file myself and see that it is 766 KB. Is it possible that the content-length value based on the HTTP header will not be EQUAL TO the file size of that EXE file if it is downloaded (the local file size)? Is this correct?

Packet Capture Data (I can't post screenshots)

GET /ChromasLite211Setup.exe HTTP/1.1
Host: www.technelysium.com.au
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Firefox/17.0
Accept: text/html, application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us
Accept-Enconding: gzip, deflate
Connection: keep-alive
Referrer: http://technelysium.com.au/

HTTP/1.1 200 OK
Date: Thu, 01 Aug 2013 17:28:17 GMT
Server: Apache
Last-Modified: Mon, 15 Apr 2013 08:29:57 GMT
Accept-Ranges: bytes
Content-Length: 784536
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/x-msdownload

MZP........................@.............................!..L..This program must be run under Win32


Entire Conversation (430722 bytes)
Users IP -> Server IP (342 bytes)
Server IP -> Users IP (430380)

When I download the file from the site it shows as, "Binary FIle (766 KB)"

like image 346
user2661503 Avatar asked Aug 07 '13 16:08

user2661503


People also ask

Is HTTP Content Length in bytes?

HTTP Content-Length entity-header is used to indicate the size of entity-body in decimal no of octets i.e. bytes and sent it to the recipient. It is a forbidden header name. Basically it is the number of bytes of data in the body of the request or response.

Is Content Length required in HTTP?

The Content-Length header is mandatory for messages with entity bodies, unless the message is transported using chunked encoding. Content-Length is needed to detect premature message truncation when servers crash and to properly segment messages that share a persistent connection.

Is Content Length set automatically?

When making a POST request, HTTP clients typically automatically add a Content-Length header based on the size of the data supplied and a Content-Type header based on the type of data being transferred.

What is Content Length in HTTP response?

The Content-Length header indicates the size of the message body, in bytes, sent to the recipient.


1 Answers

Converting Bytes to Kilobytes

784,536/1024 = 766.14
like image 101
bastos.sergio Avatar answered Oct 17 '22 15:10

bastos.sergio