mIRC Homepage
Posted By: Garou Excess Flood - 31/03/07 02:02 AM
Why do i excess flood myseft when I detect and kick a open port?

Code:
 
  dialog proxy {
  title Proxy Scaner
  size 60 100 320 170
  icon graphics\telnet.ico
  option dbu
  button "Close", 10, 279 74 35 10, flat,ok
  list 11, 5 90 310 80, hsbar
  combo 12, 85 45 180 40
  button "KickBan", 13, 279 34 35 10, flat
  button "Start", 17, 279 20 35 10, flat
  button "Found", 18, 279 61 35 10, flat
  text "", 20, 90 25 170 12
  edit "", 1, 5 33 65 10, autohs
  edit "", 22, 5 73 65 10, autohs
  button "Add Port", 2, 5 20 30 10, flat multi
  button "Edit Port", 3, 40 20 30 10, flat multi
  button "Edit Nick", 21, 40 60 30 10, flat multi
  button "Add Nick", 19, 5 60 30 10, flat multi
  button "Reset", 29, 279 48 35 10, flat
  text "Add Port To Proxy Scaner", 23, 5 10 65 10
  text "Add Nick To Exempted List", 24, 5 50 80 10
  text "Scaner for exploited hosts, such as open ports.", 27, 120 10 155 10
  box "", 25, 85 18 180 24
  box "", 26, 2 5 316 163
}
on *:dialog:proxy:sclick:*: {
  if ($did == 3) { run notepad.exe ProxyCheckList.txt }
  if ($did == 21) { run notepad.exe ProxyChecknick.txt }
  elseif ($did == 2) { .write ProxyCheckList.txt $did(1).text }
  elseif ($did == 19) { .write ProxyChecknick.txt $did(22).text }
  elseif ($did == 14) { did -v proxy 15 }
  elseif ($did == 13) { ban $chan($active) %chk.nickkb 2 | kick $chan($active) %chk.nickkb }
  elseif ($did == 17) { .enable #PROXYCHKD ON }
  elseif ($did == 10) { .disable #PROXYCHKD Off }
  elseif ($did == 18) { .run proxcheck.txt }
  elseif ($did == 29) { did -r proxy 1,11,12,20,22 }

}
#PROXYCHKD off
on *:join:#:{
  if (($nick isop $chan) || (nick isvoice $chan)) halt
  if ($nick !isreg #) || ($read(proxychecknick.txt,w,$nick)) halt
  if ((~ !isin $address) || ($nick == $me)) { halt }
  %chk.addr3 = $address($nick,5) 
  %chk.addr = $mid($mask(%chk.addr3,2),5,100))  
  :l 
  inc %chk.l 
  %s.read = $read -l $+ %chk.l proxcheck.txt 
  if (%chk.addr == %s.read) { %chk.l = 0 | halt } 
  else { %chk.l = 0 | goto n } | goto l 
  :n 
  if (%chk.addr == $null) { halt } 
  inc %i.chk 
  did -a proxy 11 ProxyCheck...  Nick.   $+ $nick  Chan.   $+ #  Address.   $+ %chk.addr 
  set %px.ck 1
  set %px.ck1 $calc($lines(ProxyCheckList.txt) - 1)
  while (%px.ck <= %px.ck1) {
  sockopen chk. [ $+ [ $r(111111,999999) ] $+ . $+ [ $nick ] ] %chk.addr $read(ProxyCheckList.txt,%px.ck)
  inc %px.ck
  }
} 

;  on *:part:*:{
;  if (($nick isop $chan) || (nick isvoice $chan)) halt 
;  if ($nick == $me) { halt } 
;  %chk.addr3 = $address($nick,5) 
;  %chk.addr = $mid($mask(%chk.addr3,2),5,100)) 
;  :l 
;  inc %chk.l 
;  %s.read = $read -l $+ %chk.l proxcheck.txt 
;  if (%chk.addr isin %s.read) { %chk.l = 0 | halt } 
;  else { %chk.l = 0 | goto n } 
;  goto l 
;  :n 
;  if (%chk.addr == $null) { halt } 
;  inc %i.chk 
;  did -a proxy 11 ProxyCheck..... Nick.. $+ $nick $+  Chan.. $+ # $+  Address.. $+ %chk.addr $+  
;  sockopen chk. [ $+ [ $r(111111,999999) ] $+ . [ $+ [ $nick ] %chk.addr 65535
;} 


on *:sockopen:chk.*:{
  set %lastproxyaddress $address($nick,5) 
  if ($sockerr) { return } 
  inc %i.chk2 
  inc %chk.addr3 $nick
  set %chk.nickkb $remove($sock($sockname),$left($sock($sockname),11)) 
  set %chk.nickp $sock($sockname).port
  did -r proxy 11 2 SOCKET-INFO: Errors..( $+ $sock($sockname).wsmsg $+ ) Timer:( $+ $duration($sock(chk.*).to)) $+ $nick  ) 
  did -a proxy 12  $sock($sockname).ip
  did -a proxy 20 Found Proxy $remove($sock($sockname),$left($sock($sockname),11)) $sock($sockname).ip $sock($sockname).port Select && Press Kick Ban   
  write proxcheck.txt $asctime(HH:nn) $comchan(%chk.nickkb,1) %chk.nickkb $sock($sockname).ip $+ : port  $sock($sockname).port
  ban -ku3600 $$comchan(%chk.nickkb,1) %chk.nickkb 2 14Compromised Host On Port %chk.nickp
  return 
}

#PROXYCHKD END 
Posted By: DJ_Sol Re: Excess Flood - 31/03/07 02:45 AM
Found some errors.

(nick isvoice $chan))

What is $nick in a sockopen event?
on *:sockopen:chk.*:{
set %lastproxyaddress $address($nick,5)


inc %chk.addr3 $nick

I don't believe this is correct.
/inc will add one to an integer.
Even so, again $nick is nothing in a sockopen event. You can retrieve the $nick from the sockname though it looks like.
Posted By: Garou Re: Excess Flood - 31/03/07 03:03 AM
I see how else can it be coded then?
Posted By: starbucks_mafia Re: Excess Flood - 31/03/07 03:11 AM
I didn't read all of your code but as DJ_Sol pointed out you're using $nick in an event which has no $nick associated with it. Instead the simplest thing to do is use the /sockmark command to associate the nick with that given socket when you create it in the on join event. That way you can just use var %nick = $sock($sockname).mark in your socket event to get the associated nickname and use %nick in the rest of the event.
Posted By: Garou Re: Excess Flood - 31/03/07 03:18 AM
Humm i see but am not sure how and what line to change exacly to try with the /sockmark.
Posted By: starbucks_mafia Re: Excess Flood - 03/04/07 04:28 PM
Code:
sockopen chk. [ $+ [ $r(111111,999999) ] $+ . $+ [ $nick ] ] %chk.addr $read(ProxyCheckList.txt,%px.ck)

becomes:
Code:
var %name = $+(chk., %px.ck, $nick)
sockopen %name %chk.addr $read(ProxyCheckList.txt,%px.ck)
sockmark %name $nick


Then you can use $sock($sockname).mark to get the nickname associated with the socket.
Posted By: Garou Re: Excess Flood - 03/04/07 07:10 PM
Dunno what am doing wrong but its not working, here what I have so far.
Code:
 

dialog proxy {
title Proxy Scaner
size 60 100 320 170
option dbu
button "Close", 10, 279 74 35 10, flat,ok
list 11, 5 90 310 80, hsbar
combo 12, 85 45 180 40
button "KickBan", 13, 279 34 35 10, flat
button "Start", 17, 279 20 35 10, flat
button "Found", 18, 279 61 35 10, flat
text "", 20, 90 25 170 12
edit "", 1, 5 33 65 10, autohs
edit "", 22, 5 73 65 10, autohs
button "Add Port", 2, 5 20 30 10, flat multi
button "Edit Port", 3, 40 20 30 10, flat multi
button "Edit Nick", 21, 40 60 30 10, flat multi
button "Add Nick", 19, 5 60 30 10, flat multi
button "Reset", 29, 279 48 35 10, flat
text "Add Port To Proxy Scaner", 23, 5 10 65 10
text "Add Nick To Exempted List", 24, 5 50 80 10
text "Scaner for exploited hosts, such as open ports.", 27, 120 10 155 10
box "", 25, 85 18 180 24
box "", 26, 2 5 316 163
}
on *:dialog:proxy:sclick:*: {
if ($did == 3) { run notepad.exe ProxyCheckList.txt }
if ($did == 21) { run notepad.exe ProxyChecknick.txt }
elseif ($did == 2) { .write ProxyCheckList.txt $did(1).text }
elseif ($did == 19) { .write ProxyChecknick.txt $did(22).text }
elseif ($did == 14) { did -v proxy 15 }
elseif ($did == 13) { ban $chan($active) %chk.nickkb 2 | kick $chan($active) %chk.nickkb }
elseif ($did == 17) { .enable #PROXYCHKD ON }
elseif ($did == 10) { .disable #PROXYCHKD Off }
elseif ($did == 18) { .run proxcheck.txt }
elseif ($did == 29) { did -r proxy 1,11,12,20,22 }

}
#PROXYCHKD off
on *:join:#:{
if (($nick isop $chan)) halt
if ($nick !isreg #) || ($read(proxychecknick.txt,w,$nick)) halt
if ((~ !isin $address) || ($nick == $me)) { halt }
%chk.addr3 = $address($nick,5)
%chk.addr = $mid($mask(%chk.addr3,2),5,100))
:l
inc %chk.l
%s.read = $read -l $+ %chk.l proxcheck.txt
if (%chk.addr == %s.read) { %chk.l = 0 | halt }
else { %chk.l = 0 | goto n } | goto l
:n
if (%chk.addr == $null) { halt }
inc %i.chk
did -a proxy 11 ProxyCheck... Nick. $+ $nick Chan. $+ # Address. $+ %chk.addr
set %px.ck 1
set %px.ck1 $calc($lines(ProxyCheckList.txt) - 1)
while (%px.ck <= %px.ck1) {
var %name = $+(chk., %px.ck, $nick)
sockopen %name %chk.addr $read(ProxyCheckList.txt,%px.ck)
sockmark %name $nick
}
}

; on *:part:*:{
; if (($nick isop $chan) || (nick isvoice $chan)) halt
; if ($nick == $me) { halt }
; %chk.addr3 = $address($nick,5)
; %chk.addr = $mid($mask(%chk.addr3,2),5,100))
; :l
; inc %chk.l
; %s.read = $read -l $+ %chk.l proxcheck.txt
; if (%chk.addr isin %s.read) { %chk.l = 0 | halt }
; else { %chk.l = 0 | goto n }
; goto l
; :n
; if (%chk.addr == $null) { halt }
; inc %i.chk
; did -a proxy 11 ProxyCheck..... Nick.. $+ $nick $+ Chan.. $+ # $+ Address.. $+ %chk.addr $+
; sockopen chk. [ $+ [ $r(111111,999999) ] $+ . [ $+ [ $nick ] %chk.addr 65535
;}


on *:sockopen:chk.*:{
set %lastproxyaddress $address($nick,5)
if ($sockerr) { return }
inc %i.chk2
inc %chk.addr3 $nick
set %chk.nickkb $remove($sock($sockname),$left($sock($sockname),11))
set %chk.nickp $sock($sockname).port
did -r proxy 11 2 SOCKET-INFO: Errors..( $+ $sock($sockname).wsmsg $+ ) Timer:( $+ $duration($sock(chk.*).to)) $+ $nick )
did -a proxy 12 $sock($sockname).ip
did -a proxy 20 Found Proxy $remove($sock($sockname),$left($sock($sockname),11)) $sock($sockname).ip $sock($sockname).port Select && Press Kick Ban
write proxcheck.txt $asctime(HH:nn) $comchan(%chk.nickkb,1) %chk.nickkb $sock($sockname).ip $+ : port $sock($sockname).port
ban -ku3600 $$comchan(%chk.nickkb,1) %chk.nickkb 2 14Compromised Host On Port %chk.nickp
return
}

#PROXYCHKD END
Code:
 
Posted By: RusselB Re: Excess Flood - 03/04/07 11:43 PM
While we appreciate the fact that you used the Code tags, in this forum pressing the Code tag button creates both start and end tags, not just one or the other. Therefore, you have an empty code box, followed by your code (not in a code box), followed by another empty code box.

In regards to your code, I'm sorry to say that I can't see anything wrong with it, so I have no idea as to why it's not working (although I can confirm that it's not working by my own testing)
Posted By: Riamus2 Re: Excess Flood - 03/04/07 11:52 PM
As RusselB said, just pressing the # button won't really help. Highlight all of your code and then press it and your code will be inside a code box. Alternatively, just type [code] at the beginning of your code and [/code] at the end instead of using the button.
© mIRC Discussion Forums