# signature match script

**URL:** <https://community.zeek.org/t/signature-match-script/2827>\
**Category:** Zeek\
**Created:** [September 23, 2013, 7:38pm UTC](https://community.zeek.org/t/signature-match-script/2827 "2013-09-23T19:38:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Andreoni](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Martin\_Andreoni](https://community.zeek.org/u/Martin_Andreoni)\
**Post date:** [September 23, 2013, 7:38pm UTC](https://community.zeek.org/t/signature-match-script/2827/1 "2013-09-23T19:38:23Z")

</div>

Hi guys, I'm new on Bro scripts. I'm traying to test the most easiest signature match script. I have read the manual and some examples, but it is not working.

So I tried the following:  
on signatura.sig:

signature my-first-sig {  
ip-proto == tcp  
dst-port == 12345  
payload /.\*hello/  
event "Signature Found"  
}

on test\_sig.bro (was added on local.bro):

@load base/frameworks/notice  
@load base/frameworks/signatures/main  
@load-sigs ./signatura.sig #in the same directory

event signature\_match(state: signature\_state, msg: string, data: string)  
{  
print fmt("Match!!! %s",msg);  
print fmt("%s",data);  
}

event tcp\_packet (c: connection, is\_orig: bool, flags: string, seq: count, ack: count, len: count, payload: string)  
{  
print fmt ("%s",payload);  
}

So I create a socket to connect the host and send messages just to test it.  
When i run the program  
bro -i eth0 local # the interface is the correct one  
I can see the payload of the tcp packets (the messages I'm sending) but I don't have any type of signature.log not even the print Im doing.  
What could be happening?  
Thanks

-- Martin

---

<div class="post-metadata">

**Author:** ![Martin\_Andreoni](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Martin\_Andreoni](https://community.zeek.org/u/Martin_Andreoni)\
**Post date:** [September 23, 2013, 11:46pm UTC](https://community.zeek.org/t/signature-match-script/2827/2 "2013-09-23T23:46:31Z")

</div>

Hi guys, I'm new on Bro scripts. I'm traying to test the most easiest  
signature match script. I have read the manual and some examples, but it  
is not working.

So I tried the following:  
on signatura.sig:

signature my-first-sig {  
ip-proto == tcp  
dst-port == 12345  
payload /.\*hello/  
event "Signature Found"  
}

on test\_sig.bro (was added on local.bro):

@load base/frameworks/notice  
@load base/frameworks/signatures/main  
@load-sigs ./signatura.sig #in the same directory

event signature\_match(state: signature\_state, msg: string, data: string)  
{  
print fmt("Match!!! %s",msg);  
print fmt("%s",data);  
}

event tcp\_packet (c: connection, is\_orig: bool, flags: string, seq:  
count, ack: count, len: count, payload: string)  
{  
print fmt ("%s",payload);  
}

So I create a socket to connect the host and send messages just to test it.  
When i run the program  
bro -i eth0 local # the interface is the correct one  
I can see the payload of the tcp packets (the messages I'm sending) but  
I don't have any type of signature.log not even the print Im doing.  
What could be happening?  
Thanks

-- Martin

---

<div class="post-metadata">

**Author:** ![Patrick\_Powell](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Patrick\_Powell](https://community.zeek.org/u/Patrick_Powell)\
**Post date:** [September 24, 2013, 1:40am UTC](https://community.zeek.org/t/signature-match-script/2827/3 "2013-09-24T01:40:37Z")

</div>

Martin,  
The .sig file looks fine. I don't load those in local.bro, I load them in  
\<BRO\_DIR\_\>/base/frameworks/signatures/main.bro. I have my sigs in that  
directory as well.

Patrick Powell  
Security Analyst  
21CT, Inc.  
Direct: 512.682.4754  
Cell: 210.587.9255  
Direct Fax: 512.682.4749

---

<div class="post-metadata">

**Author:** ![Martin\_Andreoni](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Martin\_Andreoni](https://community.zeek.org/u/Martin_Andreoni)\
**Post date:** [September 24, 2013, 12:58pm UTC](https://community.zeek.org/t/signature-match-script/2827/4 "2013-09-24T12:58:55Z")

</div>

IT must be something else, I tryied what you said Patrick but is still not working.  
May be something in configuration I should switch on?

---

<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:41pm UTC](https://community.zeek.org/t/signature-match-script/2827/5 "2022-05-06T15:41:15Z")

</div>


