<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks,<div><br></div><div>that worked.</div><div><br><div><div>On Nov 27, 2013, at 3:47 AM, Muhammad Shahzad <<a href="mailto:shaheryarkh@gmail.com">shaheryarkh@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Never give any SIP response to any malicious SIP request, ignore it completely. Usually such malicious attacks are done through bots (with identifiable user--agent header), which send a basic / harmless SIP request such as SIP OPTIONS and see if they get response, if they do then they proceed with sending SIP REGISTER or INVITE and start actual brute-force attack to crack the server. If on the other hand, you completely ignore them and do not respond to them then they ignore you too and move on to next target server.<br>

<br>if ($ua=="friendly-scanner") {<br>         exit;<br>}<br><br></div>Thank you.<br><div><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 9:31 AM, Daniel Grotti <span dir="ltr"><<a href="mailto:dgrotti@sipwise.com" target="_blank">dgrotti@sipwise.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Do you have some example about malicious messages ?<br>
<br>
D.<br>
<br>
On 11/27/2013 12:00 AM, Joli Martinez wrote:<br>
> I have placed the code below right underneath the route portion in the<br>
> kamailio.cfg file restarted kamailio and I am still being attacked.<br>
><br>
> ####### Routing Logic ########<br>
><br>
><br>
> # main request routing logic<br>
><br>
> route{<br>
><br>
>         if ($ua=="friendly-scanner") {<br>
>                 sl_send_reply("200","OK");<br>
>                 exit;<br>
>         }<br>
><br>
> On Nov 26, 2013, at 5:29 PM, Daniel Grotti <<a href="mailto:dgrotti@sipwise.com">dgrotti@sipwise.com</a><br>
> <mailto:<a href="mailto:dgrotti@sipwise.com">dgrotti@sipwise.com</a>>> wrote:<br>
><br>
>> Hi,<br>
>> you can check the User-Agent reference $ua, if it is equal to<br>
>> "friendly-scanner", just send back a reply with sl_send_reply("200", "OK")<br>
>><br>
>> Daniel<br>
>><br>
>><br>
>><br>
>> On 11/26/2013 10:53 PM, Joli Martinez wrote:<br>
>>> How can I do this?  Is there an article I can reference or something?<br>
>>>  I am new to kamailio and not sure how to do this.<br>
>>><br>
>>> Thanks,<br>
>>><br>
>>> On Nov 26, 2013, at 4:41 PM, Ovidiu Sas <<a href="mailto:osas@voipembedded.com">osas@voipembedded.com</a><br>
>>> <mailto:<a href="mailto:osas@voipembedded.com">osas@voipembedded.com</a>>> wrote:<br>
>>><br>
>>>> Google around for "friendly-scanner" to learn more about it.<br>
>>>> In the mean time, allow the packets to be handled by kamailio and send<br>
>>>> a 200ok back - maybe this will stop the attack.<br>
>>>> After the attack is stopped, simply drop all "friendly-scanner" SIP<br>
>>>> requests :)<br>
>>>><br>
>>>> Regards,<br>
>>>> Ovidiu Sas<br>
>>>><br>
>>>> On Tue, Nov 26, 2013 at 4:32 PM, Joli Martinez <<a href="mailto:mrjoli021@gmail.com">mrjoli021@gmail.com</a><br>
>>>> <mailto:<a href="mailto:mrjoli021@gmail.com">mrjoli021@gmail.com</a>>> wrote:<br>
>>>>> it is comming from "friendly-scanner" The other issue I have is<br>
>>>>> that "/var/log/secure" is not getting the sip requests so the only<br>
>>>>> way I realize it is happeing is from tcpdump.  If the secure file<br>
>>>>> is not picking it up then iptables wont know about it.  How can I<br>
>>>>> tell iptables to listen for sip requests?  I have already added the<br>
>>>>> IP to the blocked IP's but he still keeps on comming.<br>
>>>>><br>
>>>>> Thanks,<br>
>>>>><br>
>>>>> On Nov 26, 2013, at 4:28 PM, Ovidiu Sas <<a href="mailto:osas@voipembedded.com">osas@voipembedded.com</a><br>
>>>>> <mailto:<a href="mailto:osas@voipembedded.com">osas@voipembedded.com</a>>> wrote:<br>
>>>>><br>
>>>>>> Most likely it's a bogus script.<br>
>>>>>> Sometimes just sending a dummy reply, will stop the script sending<br>
>>>>>> SIP requests.<br>
>>>>>> Check the User-Agent header and from username to see if you can<br>
>>>>>> identify the script and google around for it.<br>
>>>>>><br>
>>>>>> Regards,<br>
>>>>>> Ovidiu Sas<br>
>>>>>><br>
>>>>>> On Tue, Nov 26, 2013 at 4:17 PM, Joli Martinez<br>
>>>>>> <<a href="mailto:mrjoli021@gmail.com">mrjoli021@gmail.com</a> <mailto:<a href="mailto:mrjoli021@gmail.com">mrjoli021@gmail.com</a>>> wrote:<br>
>>>>>>> I am running Kamailio in CentOS.  I ran tcpdump and noticed that<br>
>>>>>>> we are getting attacked from IP 188.138.32.72.  I have already<br>
>>>>>>> blocked it on IPtables, but he keeps on attacking the server.  If<br>
>>>>>>> I look at "/var/log/secure" there are no SIP messages.  My<br>
>>>>>>> question is where is the log file for Kamailio and how can I<br>
>>>>>>> prevent this type of attacks in the future.<br>
>>>>>>><br>
>>>>>>> Thanks,<br>
>>>>>>> _______________________________________________<br>
>>>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users<br>
>>>>>>> mailing list<br>
>>>>>>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
>>>>>>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> --<br>
>>>>>> VoIP Embedded, Inc.<br>
>>>>>> <a href="http://www.voipembedded.com/" target="_blank">http://www.voipembedded.com</a><br>
>>>>>><br>
>>>>>> _______________________________________________<br>
>>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing<br>
>>>>>> list<br>
>>>>>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
>>>>>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
>>>>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
>>>>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>><br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> VoIP Embedded, Inc.<br>
>>>> <a href="http://www.voipembedded.com/" target="_blank">http://www.voipembedded.com</a><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
>>>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
>>>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
>>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
>>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Mit freundlichen Grüßen</span></div><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Muhammad Shahzad</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">------------------------------</span><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-----</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Rich Media Communication Specialist (CRMCS)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Certified Network Associate (CCNA)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Cell: +49 176 99 83 10 85</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">MSN: </span><a href="mailto:shari_786pk@hotmail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shari_786pk@hotmail.com</a><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Email: </span><a href="mailto:shaheryarkh@googlemail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shaheryarkh@googlemail.com</a>
</div>
_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br></blockquote></div><br></div></body></html>