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.

Antiproxy script

Old posts that have not been replied to for several years.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Antiproxy script

Post by r0t3n »

Ok. I found this antiproxy script made by James Seward but i tweaked it abit. Just added some features etc.

Code: Select all

# open proxy checker for eggdrop
# (c) James Seward 2003/4
# version 1.0

# http://www.jamesoff.net/projects/eggdrop
# james@jamesoff.net
# chris@cs-room.com - Tosser^^

# Released under the GPL

# MADE BY James Seward 4/2003 Tweaked by Tosser^^ 7/2005 \(#eggtcl\)

## INSTRUCTIONS
###############################################################################

# This script will check the hosts of people joining channels against one or
# RBLs. Choose your RBLs wisely, some of them list DIALUP SPACE and that would
# be a bad thing to be matching your IRC users against :P
#
# Enable the 'proxycheck' flag for channels you want the script active on
# --> .chanset #somechannel +proxycheck
#
# Users who are +o, +v, or +f in your bot (local or global) won't be checked.
#
# Turn on console level d on the partyline to see some debug from the script
# --> .console +d (to enable)
# --> .console -d (to disable)

## CONFIG
###############################################################################

# space-separated list of RBLs to look in
set proxycheck_rbls { "cbl.abuseat.org" "opm.blitzed.org" "dnsbl.ahbl.org" }

# time in minutes to ban for
set proxycheck_bantime 0

# stop editing here unless you're TCL-proof



## CODE
###############################################################################

#add our channel flag
setudef flag proxycheck
setudef str antijoin
setudef str antidetected
setudef str antikicked

#bind our events
bind join - *!*@* proxycheck_join

#swing your pants

# catch joins
proc proxycheck_join { nick host handle channel } {
  #check we're active
  if {![channel get $channel proxycheck]} {
    return 0
  channel set $channel antijoin "[expr [channel get $channel antijoin] + 1]" 

  }

  #don't apply to friends, voices, ops
  if {[matchattr $handle fovC|fovC $channel]} {
    return 0
  }

  #get the actual host
  regexp ".+@(.+)" $host matches newhost
  if [regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} $newhost] {
    #it's a numeric host, skip the lookup
    proxycheck_check2 $newhost $newhost 1 $nick $newhost $channel
  } else {
    putloglev d * "proxycheck: doing dns lookup on $newhost to get IP"
    dnslookup $newhost proxycheck_check2 $nick $newhost $channel
  }
}

# first callback (runs RBL checks)
proc proxycheck_check2 { ip host status nick orighost channel } {
  global proxycheck_rbls

  if {$status} {
    putloglev d * "proxycheck: $host resolves to $ip"

    # reverse the IP
    regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})} $ip matches a b c d
    set newip "$d.$c.$b.$a"

    # look it up in the rbls
    foreach rbl $proxycheck_rbls {
      putloglev d * "proxycheck: looking up $newip.$rbl"
      dnslookup "$newip.$rbl" proxycheck_check3 $nick $host $channel $rbl
    }
  } else {
    putlog "proxycheck: Couldn't resolve $host. (No further action taken.)"
  }
}

# second callback (catches RBL results)
proc proxycheck_check3 { ip host status nick orighost channel rbl } {
global proxycheck_bantime

if {$status} {
  putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
  if {[botisop $channel]} {
    newchanban $channel "*!*@$orighost" "$::botnick" "Detected as a openproxy host. Original Host: \($orighost\) RBL \($rbl\)." $proxycheck_bantime
    putquick "MODE $channel -ov+b $nick $nick *!*@$orighost"
    putquick "KICK $channel $nick :Detected as a openproxy host. Original Host: \($orighost\) RBL: \($rbl\)."
    channel set $channel antidetected "[expr [channel get $channel antidetected] + 1]" 
    channel set $channel antikicked "[expr [channel get $channel antikicked] + 1]"
    set fp [open proxy.db a]
    put $fp "$nick detected as a openproxy. Host: \($orighost\) RBL: \($rbl\) Banned on $channel for $proxycheck_bantime minutes."
    close $fp
    } else {
    putlog "$nick detected as a openproxy. Host: \($orighost\) RBL: \($rbl\) Could not ban on $channel because i have no op."
    newchanban $channel "*!*@$orighost" "$::botnick" "Detected as a openproxy host. Original Host: \($orighost\) RBL \($rbl\)." $proxycheck_bantime
    set fp [open proxy.db a]
    put $fp "$nick detected as a openproxy. Host: \($orighost\) RBL: \($rbl\) Could not ban on $channel because i have no op."
    close $fp
    channel set $channel antidetected "[expr [channel get $channel antidetected] + 1]" 
  }
}
#if we didn't get a host, they're not in RBL
}
putlog "proxycheck 1.0 Made By James Seward but Tweaked by Tosser^^ Loaded"
Now. As you know im not that good at tcl. I dont know if this script will actually work. If the script is up-to-date. Any chance anyone could look through this script and tell me if this script will actually work.

Thanks in advance!!

PS: I would test this. But i dont have a eggdrop to test it on, and my windrop dont want to work :(
r0t3n @ #r0t3n @ Quakenet
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

we couldnt care less if your tweaks work or not, test it yourself.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

its not my tweaks. Just as this script is old, made in 2003. I just wondered if the code by James Seward is out of date in anyway.
r0t3n @ #r0t3n @ Quakenet
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

greenbear wrote:...test it yourself.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Sir_Fz wrote:
greenbear wrote:...test it yourself.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

Well, that's clear, if i may be rude :P
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

^DooM^ wrote:
Sir_Fz wrote:
greenbear wrote:...test it yourself.
Tosser^^ wrote:PS: I would test this. But i dont have a eggdrop to test it on, and my windrop dont want to work
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Then why care so much about it.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

man, i would love to install linux on my computer. But its shared with my two sisters. They know [censored] about linux. So, im stuck. I want linux, they dont know how to use it. Windows is crap. Linux is l33t. So i wont win, unless i teach them all i know about linux...
r0t3n @ #r0t3n @ Quakenet
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

how old are you ? 8 ?
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

greenbear wrote:how old are you ? 8 ?
Your being way to generous greenbear. ;)

Tosser^^, Hows about build a second machine to run linux from. It doesnt have to be l33t as you put it. I run RH9 on a PentiumII just fine, then you can stop bugging us with your dumb questions :!:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Yea, i could. Not all people have the time and money to do that. Also, i have to buy a ruoter etc to get it hooked up to the internet.
r0t3n @ #r0t3n @ Quakenet
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Tosser^^ wrote:Yea, i could. Not all people have the time and money to do that. Also, i have to buy a ruoter etc to get it hooked up to the internet.
you don't need money, you need determination, persistance, modesty to become good with computers in general, not only good Tcl/eggdrop scripter

here, choose a free UNIX shell account provider, register, get account and try to teach yourself a thing or two; they won't let you to run bots, but you'll at least learn the basics of using UNIX/Linux (that is, if you are over 13 and serious about learning stuff)
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

ok. I will. Thanks demond.
r0t3n @ #r0t3n @ Quakenet
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Btw tosser, You hardly made any tweaks. You simply copied stuff from my script and put it in there, And you did a pretty lousy job at it.

If you don't have an eggdrop to test it on and it doesn't work on your windrop, that's clear isn't it? It doesn't work.
Locked