ic ur right but still doesn't work also changed the vars below cause they overwrited them selfs forgot about that !
the connection remains open and still doesn't close i allready tryed to add a flush infront so it can become writeable but it seems that this doesn't work either ..
Code: Select all
proc proxy_scan {nick host} {
global proxy
foreach port $proxy(port) {
catch {socket -async $host $port} proxy(socket)
if {[string match -nocase "sock?" $proxy(socket)] && ![string match -nocase {} $proxy(socket)]} {
flush $proxy(socket)
fileevent $proxy(socket) writable [list open_sock $nick $proxy(socket) $host $port]
}
}
}
proc open_sock {nick socket host port} {
catch {
set error [fconfigure $socket -error]
close $socket
} errors
eval report_sock [list $nick $host $port $error]
}
proc report_sock {nick host port error} {
if {[string match -nocase {} $error]} {
operwall "Possible open proxy found on $host $port \($nick\)"
}
}
By the way, hopefully you are passing it ip addresses and not hosts (as the variable name implies) because tcl does *not* do async dns lookups.
no didn't know that i used there hosts thing is it does connect tho i can see it on netcat it opens but thats it so it connects but does not close netcat will only close the sock if it is dropped.
so if ur question is is it connecting yes .. tnx for the tip tho ill add it once i get it right ..
Code: Select all
#!/usr/bin/tclsh
set proxy(port) "1080 1081 3380 3381"
proc proxy_scan {nick host} {
global proxy
foreach port $proxy(port) {
catch {socket -async $host $port} proxy(socket)
if {[string match -nocase "sock?" $proxy(socket)] && ![string match -nocase {} $proxy(socket)]} {
flush $proxy(socket)
fileevent $proxy(socket) writable [list open_sock $nick $proxy(socket) $host $port]
}
}
}
proc open_sock {nick socket host port} {
# catch {
set error [fconfigure $socket -error]
close $socket
# } errors
eval report_sock [list $nick $host $port $error]
}
proc report_sock {nick host port error} {
if {[string match -nocase {} $error]} {
puts "Possible open proxy found on $host $port \($nick\)"
}
}
proxy_scan somenick [lindex $argv 0]
tryed that in shell script doesn't realy mather .. if i use numeric ips ..