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.

need some help

Old posts that have not been replied to for several years.
Locked
f
feroz
Voice
Posts: 25
Joined: Wed Aug 04, 2004 11:59 am

need some help

Post by feroz »

Hello,

tryin to script an open proxy scanner that get info from BOPM site..
having some probs :(

here goes the code

Code: Select all



bind join - * bopm:join
bind raw - 302  getip


proc bopm:join {nick host hand chan} { 
	if {[strlwr $nick] == [strlwr $::botnick] || [matchattr $hand of|fo $chan]} {
	return
	} 
  putserv "userhost $nick"  
}


proc getip { from key arg} {
	global victim_host
	putserv "PRIVMSG #test : $arg"
	set victim_host [lindex [lrange [split $arg "@"] 1 end] 0] 
	putserv "PRIVMSG #test :$victim_host"
	set new_url "http://opm.blitzed.org/proxy?ip=$victim_host"
	set sock [egghttp:geturl $new_url bopm]

		proc bopm {sock} {
		set headers [egghttp:headers $sock]
		set body [egghttp:data $sock]
		egghttp:cleanup $sock
			foreach line [split $body \n] {
				if {[string match "*The IP address \<tt\>*" $line]} {
					set ip_line $line
					#putserv "PRIVMSG #test :$ip_line"
					if {[string match *active* $ip_line] == 1} {
						putserv "PRIVMSG #test :it's an open-proxy!"
					#putserv "gline add *@$victim_host 120s testing"
					}
					if {[string match *never* $ip_line] == 1} {
						putserv "PRIVMSG #test :it is not an open proxy "
							putserv "PRIVMSG #test :$victim_host"
					} 
					break
				}
			}
		}		
}
My prob is i dont know how to get the $victim_host var in bopm {sock} proc.. because i need it to gline/ban the proxy user there..
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

{[strlwr $nick] == [strlwr $::botnick]} is equal with [isbotnick $nick] and move the "bopm" proc outside the "getip" proc.. once something get from the socket the "bopm" proc is called.
Once the game is over, the king and the pawn go back in the same box.
f
feroz
Voice
Posts: 25
Joined: Wed Aug 04, 2004 11:59 am

Post by feroz »

thx for reply,

i'll change it to, [isbotnick $nick].

And actually the bopm proc was out side in my first trys, but i thought i could get the $victim_host if i put it inside the other proc as it'll be still considered as "local"...but didnt work...
any clue how i could get the $victim_var in the bopm proc?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Umm.. either use arrays or upvar ("create link to variable in a different stack frame")
Once the game is over, the king and the pawn go back in the same box.
Locked