This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

how do you release lingering connections?

Old posts that have not been replied to for several years.
Locked
Z
ZvOO
Voice
Posts: 22
Joined: Thu Jan 20, 2005 2:33 am

how do you release lingering connections?

Post by ZvOO »

I've searched the archives and can find nothing on this.

Sometimes if I lose a link between bots in my botnet they will not reconnect (even if I remove the passwords with .chpass on each one). I've found that the only way to get them to reconnect is to change their 'bots' port number to a different port. After I change these ports in their config files and in each bot's user record and then rehash the bots, the bots immediately link up again.

Here's my question: after I've changed the ports, I do a .dccstat and I see lingering connections on the old port numbers in addition to the new connection(s). Is there an easy way to release these sock's and free up the old ports again?

Here's what it looks like:

SOCK ADDR PORT NICK HOST TYPE
---- -------- ----- --------- ----------------- ----
3 C0A8FE07 6464 (bots) * lstn 6464
4 C0A8FE07 3335 (users) * lstn 3335
5 00000000 0 (dns) dns (ready)
7 CE2975C7 6668 (server) irc.weblook2k.com serv (lag: 0)
8 C0A8FE06 2525 zvoo22 net@192.168.3.13 chat flags: cpTEp/0
6 C0A8FE07 6400 (bots) * lstn 6400
9 C0A8FE07 5019 (bots) * lstn 5019
11 C0A8FE07 5019 bothead1 192.168.3.9 bot flags: pucosgwLiA
12 C0A8FE07 4443 bothead2 192.168.3.9 bot flags: pucosgwliA
13 C0A8FE07 9300 bothead3 192.168.3.9 bot flags: pucosgwLiA

In the above .dccstat paste, the connection to port 5019 is the new link connection, and the connections to ports 6464 and port 6400 are old and unnecessary connections. How can I get rid of these old ones? They seem to last forever :x Note: these bots exist on a LAN behind a NAT router.

Thanks.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

bind dcc t|- closeport dcc:closeport
proc dcc:closeport {hand idx arg} {
 set port [lindex $arg 0]
 if {[catch {listen $port off} .]} {
  putidx $idx "Port $port is not open."
 } {
  putidx $idx "Port $port have been closed."
 }
}
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

did you also try using .unlink and .link?
did you try using .restart? .rehash doesnt unload the bot so new configs will only override... if possible, if not there might be left behind some shadows (like when you delete an proc in a tcl, it will remain in the memory). So probably rehashing with another port just adds the new port and doesnt remove the old one :).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked