<br><div class="gmail_quote">i remove the reply, thanks .<br><br><div class="gmail_quote">2011/6/28  <span dir="ltr">&lt;<a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">
I wouldn&#39;t even reply back with a &quot;403 - Access Denied&quot;.  If you do that then you just told whoever that you exist and you are SIP
<br><div>
<br>        if($ua=~&quot;friendly-scanner&quot;){
<br>                xlog(&quot;L_NOTICE&quot;,&quot;Auth error for $fU@$fd from $Ri cause $var(auth_code)&quot;);
<br>                xlog(&quot;FRIENDLY-SCANNER: UA: $ua From_TAG: $ft From_URI: $fu Received IP: $Ri IP Source: $si&quot;);
<br></div>                exit;
<br><div>        }
<br>
<br>
<br>
<br>On Jun 28, 2011 4:55pm, Mike Tesliuk &lt;<a href="mailto:mike@ultra.net.br" target="_blank">mike@ultra.net.br</a>&gt; wrote:
<br>&gt; Hello, 
<br>&gt; 
<br>&gt; 
<br>&gt; Im new to Opensips and im getting an attack that i can read the ip just on the first register, the attacker are sending my own ip on the sip package
<br>&gt; 
<br>&gt; 
<br></div><div><div></div><div>&gt; on the begin of my main route i put the rule below
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt;         if($ua=~&quot;friendly-scanner&quot;){
<br>&gt;                 xlog(&quot;L_NOTICE&quot;,&quot;Auth error for $fU@$fd from $Ri cause $var(auth_code)&quot;);
<br>&gt;                 xlog(&quot;FRIENDLY-SCANNER: UA: $ua From_TAG: $ft From_URI: $fu Received IP: $Ri IP Source: $si&quot;);
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt;                 sl_send_reply(&quot;403&quot;, &quot;Access Denied&quot;);
<br>&gt;         }
<br>&gt; 
<br>&gt; 
<br>&gt; Small time later the attacker start the attack i get this message
<br>&gt; 
<br>&gt; 
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:_reply_light: failed to allocate shmem buffer
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: WARNING:core:fm_malloc: Not enough free memory, will atempt defragmenation
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:relay_reply: no more share memory
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: WARNING:core:fm_malloc: Not enough free memory, will atempt defragmenation
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:_reply_light: failed to allocate shmem buffer
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: WARNING:core:fm_malloc: Not enough free memory, will atempt defragmenation
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:relay_reply: no more share memory
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: WARNING:core:fm_malloc: Not enough free memory, will atempt defragmenation
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:_reply_light: failed to allocate shmem buffer
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: WARNING:core:fm_malloc: Not enough free memory, will atempt defragmenation
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:relay_reply: no more share memory
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: WARNING:core:fm_malloc: Not enough free memory, will atempt defragmenation
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Jun 28 18:31:06 ser1-vm /sbin/opensips[19848]: ERROR:tm:_reply_light: failed to allocate shmem buffer
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; i can get the log, but the ip that i show is my own, how can i block this kind of attack ? 
<br>&gt; 
<br>&gt; Thanks
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; below you have the firs 3 packages that i can get on ngrep (the XXX.XXX.XXX.XXX is my IP)
<br>&gt; 
<br>&gt; U 2011/06/28 17:46:11.898262 <a href="http://60.171.75.147:5100" target="_blank">60.171.75.147:5100</a> -&gt; XXX.XXX.XXX.XXX:5060
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; REGISTER sip:XXX.XXX.XXX.XXX SIP/2.0.
<br>&gt; Via: SIP/2.0/UDP 127.0.0.1:5100;branch=z9hG4bK-693079904;rport.
<br>&gt; Content-Length: 0.
<br></div></div>&gt; From: &quot;6362&quot; .
<br><div>&gt; Accept: application/sdp.
<br>&gt; User-Agent: friendly-scanner.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br></div>&gt; To: &quot;6362&quot; .
<br><div>&gt; Contact: <a href="mailto:sip%3A123@1.1.1.1" target="_blank">sip:123@1.1.1.1</a>.
<br>&gt; CSeq: 1 REGISTER.
<br>&gt; Call-ID: 1696826551.
<br>&gt; Max-Forwards: 70.
<br>&gt; .
<br>&gt; 
<br>&gt; #
<br>&gt; 
<br>&gt; 
<br>&gt; U 2011/06/28 17:46:11.899246 XXX.XXX.XXX.XXX:5060 -&gt; XXX.XXX.XXX.XXX:5060
<br>&gt; 
<br>&gt; 
<br>&gt; REGISTER sip:XXX.XXX.XXX.XXX SIP/2.0.
<br>&gt; Via: SIP/2.0/UDP XXX.XXX.XXX.XXX;branch=z9hG4bKe9e1.7864db01.0.
<br>&gt; Via: SIP/2.0/UDP 127.0.0.1:5100;received=60.171.75.147;branch=z9hG4bK-693079904;rport=5100.
<br>&gt; Content-Length: 0.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br></div>&gt; From: &quot;6362&quot; .
<br><div>&gt; Accept: application/sdp.
<br>&gt; User-Agent: friendly-scanner.
<br></div>&gt; To: &quot;6362&quot; .
<br><div>&gt; Contact: <a href="mailto:sip%3A123@1.1.1.1" target="_blank">sip:123@1.1.1.1</a>.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; CSeq: 1 REGISTER.
<br>&gt; Call-ID: 1696826551.
<br>&gt; Max-Forwards: 69.
<br>&gt; P-hint: outbound.
<br>&gt; 
<br>&gt; 
<br>&gt; #
<br>&gt; U 2011/06/28 17:46:11.899388 XXX.XXX.XXX.XXX:5060 -&gt; XXX.XXX.XXX.XXX:5060
<br>&gt; REGISTER sip:XXX.XXX.XXX.XXX SIP/2.0.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Via: SIP/2.0/UDP XXX.XXX.XXX.XXX;branch=z9hG4bKe9e1.8864db01.0.
<br>&gt; Via: SIP/2.0/UDP XXX.XXX.XXX.XXX;rport=5060;received=XXX.XXX.XXX.XXX;branch=z9hG4bKe9e1.7864db01.0.
<br>&gt; Via: SIP/2.0/UDP 127.0.0.1:5100;received=60.171.75.147;branch=z9hG4bK-693079904;rport=5100.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; Content-Length: 0.
<br></div>&gt; From: &quot;6362&quot; .
<br><div>&gt; Accept: application/sdp.
<br>&gt; User-Agent: friendly-scanner.
<br></div>&gt; To: &quot;6362&quot; .
<br><div><div></div><div>&gt; Contact: <a href="mailto:sip%3A123@1.1.1.1" target="_blank">sip:123@1.1.1.1</a>.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; CSeq: 1 REGISTER.
<br>&gt; Call-ID: 1696826551.
<br>&gt; Max-Forwards: 68.
<br>&gt; P-hint: outbound.
<br>&gt; P-hint: outbound.
<br>&gt; .
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt;</div></div><br></div></div><div class="im">_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></div></blockquote></div><br>
</div><br>