[Bro] Obtain a MD5 hash from a file in disk

Luis Martin martin.liras at gmail.com
Wed May 11 03:58:18 PDT 2016


Ok,

Found it. Only had to use the function

md5_hash

...of the payload, not the handler.


Rgds


2016-05-11 11:03 GMT+02:00 Luis Martin Liras <martin.liras at gmail.com>:

> Hi there,
>
> I need some help to obtain a MD5 hash of file. But not a file obtained
> from an HTTP stream. I have my own network payload I have written to disk:
>
>
>                 f=open(payload_filename);
>                 if (write_file(f, payload))
>                 {
>                         close(f);
>                 }
>
> in this case the file handler "f" is of type "file".
>
>
> I tried adding it to an MD5 analyzer:
>
>                         #Files::add_analyzer(f, Files::ANALYZER_MD5);
>
> However this request needs a "fa_file" record, associated with a stream
> not a "file" handler...
>
> Anyone can explain how can I obtain a MD5 hash from a file in disk?
>
> Thank you!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20160511/e4c0d72b/attachment-0001.html 


More information about the Bro mailing list