# libmagic for HTTP

**URL:** <https://community.zeek.org/t/libmagic-for-http/1342>\
**Category:** Zeek\
**Created:** [May 30, 2008, 5:41pm UTC](https://community.zeek.org/t/libmagic-for-http/1342 "2008-05-30T17:41:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Thomas](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@Eric\_Thomas](https://community.zeek.org/u/Eric_Thomas)\
**Post date:** [May 30, 2008, 5:41pm UTC](https://community.zeek.org/t/libmagic-for-http/1342/1 "2008-05-30T17:41:04Z")

</div>

I like FileAnalyzer and its use of libmagic. But I'd like to explore ways it can be used for protocols other than FTP, SMTP, etc. Would it be possible to expose some BIFs so that the magic number analyzer could be used elsewhere, such as http\_entity\_data? Or is this already there and I'm just missing it? Thanks!

Eric  
[edthoma@sandia.gov](mailto:edthoma@sandia.gov)

---

<div class="post-metadata">

**Author:** ![Seth\_Hall4](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Seth\_Hall4](https://community.zeek.org/u/Seth_Hall4)\
**Post date:** [May 30, 2008, 6:09pm UTC](https://community.zeek.org/t/libmagic-for-http/1342/2 "2008-05-30T18:09:54Z")

</div>

Here is a patch for Bro's trunk to add two libmagic BiFs. (identify\_magic\_descr, identify\_magic\_mime). I have a corresponding Bro script for identifying files transferred over HTTP if you're interested in it too.

&nbsp;&nbsp;&nbsp;.Seth

[libmagic\_bifs.patch](https://community.zeek.org/uploads/short-url/mUPBTlyBsM44uhuZA6sH6t93FPm.patch) (1.83 KB)

---

<div class="post-metadata">

**Author:** ![Seth\_Hall4](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Seth\_Hall4](https://community.zeek.org/u/Seth_Hall4)\
**Post date:** [May 31, 2008, 1:10am UTC](https://community.zeek.org/t/libmagic-for-http/1342/3 "2008-05-31T01:10:08Z")

</div>

(I'm sending this to the list again since I sent it to the wrong list last time)

[http-identified-files.bro](https://community.zeek.org/uploads/short-url/965CZGwYakpsbu1YMoymXGAdEQe.bro) (2.93 KB)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:38pm UTC](https://community.zeek.org/t/libmagic-for-http/1342/4 "2022-05-06T15:38:34Z")

</div>


