Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: Content monitorting in Application Security |
|---|---|
| Date: | Fri, 14 Jan 2005 08:39:12 -0800 |
Thanks Jeremiah
One righteous within the City of Sodom.... I already thought that I'll get only tones of answers showing me the light of "file" ...
Lets hope the Internet doesn't suffer a biblical apocalypse...
-----Original Message----- on Monday, January 10 Jeremiah Grossman wrote:
3) Is the file within certain size constraints? If not, fail.
As this is not directly type related, it sort of belongs to along list of checks that an Application IDS should do (RFC compliance for example).
5) If is an HTML file, then run it through some security filtering libraries.
Probably true to other file types as well...
Certainly.
* Hopefully I got the steps right. Someone might want to double check the logic flow *
With respect to the question, step 4 is where the details really matter. While you could use the unix 'file' command (as suggest by another poster) to determine actual file type, I would prefer another approach.
How right you are regarding "file": while file is a very nice and useful
utility, it is productivity oriented and not very security oriented:
- It matches very short signatures, making it relatively simple to evade
it.
- It has some big identification holes, at least in the magic file I'm
using (while it detects sub versions of a PDF file, it detects both word
and excel as a "Microsoft office document"
- It does little to detect content of text files, so that a perl, shell
and java script files are all detected the same.
The reason is not just that these shortcomings is not just that the
magic file is not large enough: the detection operators it supports are
rather limited. For example it does not support scanning the files for a
signature, but only looking for it at a predefined offset.
I'm also not sure that it is very well optimized for real time traffic
inspection required by an application security protection system such as
my company's product.
Use the content-type header value that the files claims to be andparseanybased on that premise. For instance if the file claimed to be GIF when it hits step 4, run it through an image parser and see if there aremaybeerrors. Usually when I see files uploaded via web interface, the expect type of file is fairly limited for the most part. Normallycase-by-casea few types of text files (HTML, CSV, XML), pictures (GIF, JPG, PNG), possibly mp3's, etc. I would handle each type of file on abasis.
The problem with full parsing of each type is that it just takes too
long for a real time product such as the one we do. I'm looking for an
interim solution that does not require full parsing but does not rely on
limited signatures.
One tool that I've found is trid (http://mark0.ngi.it/soft-trid-e.html).
It is signature based but employs much stronger signatures. It also has
a unique tool to build those signatures from a collection of files.
Interesting. I hadn't come across this before.
| Previous by Date: | Re: Proposal to anti-phishing, Rogan Dawes |
|---|---|
| Next by Date: | RE: Proposal to anti-phishing, RSnake |
| Previous by Thread: | Re: Content monitorting in Application Security, Jeremiah Grossman |
| Next by Thread: | RE: Content monitorting in Application Security, Ofer Shezaf |
| Indexes: | [Date] [Thread] [Top] [All Lists] |