LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-01-2014, 06:56 AM   #1
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 387

Rep: Reputation: 33
How can I identify what format payload is in? Question on content encodings.


Hi guys,

I've got an HTTP payload. I'm trying to test what is laid out by Mark Adler (author of zlib and gzip compression) in his post here - where he states that "some" servers send deflate encoding when they should be sending zlib (as laid out in the specification).

How should I go about analysing the raw payload to see if the data sent is raw deflate or with the zlib wrapper? I have the byte sequence of the payload. I assume the headers should have this information. Any help with this is much appreciated.
 
Old 09-01-2014, 07:11 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Perhaps 'file' utility program might help (or 'libmagic', if you want to use it from program).
 
Old 09-01-2014, 09:55 AM   #3
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 387

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by NevemTeve View Post
Perhaps 'file' utility program might help (or 'libmagic', if you want to use it from program).
I tried that - file command returned "data". More research into this suggests most formats have some sort magic number (or header) but I can't find this for raw deflate. Zlib supposedly has several magic numbers.
 
Old 09-01-2014, 10:13 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
(Oh, I remember now, I've heard something about gzip-ped HTTP-data not having actual gzip header...)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to identify whether the script is in Unix format or not ? kalpeer Linux - General 5 07-04-2012 04:05 AM
packet payload question rey Linux - Security 1 05-22-2012 08:11 PM
Snort rules created to search content in payload it is not showing alerts dalgas Linux - Security 9 05-30-2010 10:20 AM
kernel 2.6.26fc+ ISOFS: Unable to identify CD-ROM format" alok.rhct Linux - Hardware 4 04-21-2009 08:09 AM
Difference between FTP payload Data and simply chopping a file into payload size ahm_irf Programming 1 11-07-2007 08:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration