mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2005
Posts: 29
N
Name141 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2005
Posts: 29
how would I make a socket script to look up, and ban if possible, IPs that are connecting to the network? Or just a DNSBL lookup socket script in general,I don't know how I'd post , and check to see if the IP is banned in the DNSBL address. Yes, I already know there's BOPM and OPSB ;-p

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
If you're an oper you could use the On Snotice event from *** Client connecting Andy (Andy@blah.com) on 127.0.0.1 etc.

Joined: Dec 2002
Posts: 79
F
Babel fish
Offline
Babel fish
F
Joined: Dec 2002
Posts: 79
opm.blitzed.org you can reverse the ip and /dns ipnumber.opm.blitzed.org

Joined: Mar 2005
Posts: 29
N
Name141 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2005
Posts: 29
I was hoping there'd be a way to post info to a loopup like opm.blitzed.org , and see if it is black listed or not... and if so, do something like gline, or something. I haven't started the script, nor do I really know how. I've never done sockets before.

Joined: Dec 2002
Posts: 79
F
Babel fish
Offline
Babel fish
F
Joined: Dec 2002
Posts: 79
you don't have to do a socket. say the ip is 12.345.67.891
you would simply type /dns 891.67.345.12.opm.blitzed.org
if you got a resolved it means they have it on file

Joined: Mar 2005
Posts: 29
N
Name141 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2005
Posts: 29
[10:14:25:pm] <&opsb> Banning 166.114.30.40 (166.114.30.40) as its listed in opm.blitzed.org

[03:57:31:am] * Dns resolving 166.114.30.40.opm.blitzed.org
-----
[03:57:31:am] * Dns unable to resolve 166.114.30.40.opm.blitzed.org

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
40.30.114.166.opm.blitzed.org

The example reversed the order of the 4 values of a.b.c.d IP address to d.c.b.a.opm.blitzed.org

Joined: Mar 2005
Posts: 29
N
Name141 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2005
Posts: 29
that's pretty cool, but i found a website to make a socks script off of, however it lags mIRC.

alias ipcheck {
if ($sock(dnsbl,0) > 0) sockclose dnsbl
sockopen dnsbl spamblock.outblaze.com 80
sockmark dnsbl $1
}
on 1:sockopen:dnsbl:{
sockwrite -n dnsbl GET / $+ $sock(dnsbl).mark HTTP/1.1
sockwrite -n dnsbl Host: spamblock.outblaze.com
sockwrite -n dnsbl
}

on 1:sockread:dnsbl:{
if ($sockerr > 0) return
sockread %dnsbl
if (%dnsbl) {
if ((found isin %dnsbl) && (not !isin %dnsbl)) echo -a IP $sock(dnsbl).mark is blacklisted. | some other stuff here
}
}

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Here is a minimal version of what you will need to query the DNS server and process the response:

; Syntax: /ipcheck IP
alias ipcheck {
.dns $+($reverseIP($$1), .opm.blitzed.org)
}

alias -l reverseIP {
tokenize 46 $1
return $+($4, ., $3, ., $2, ., $1)
}

On *:dns:{
if (*.opm.blitzed.org iswm $dns(1).addr) {
var %IP = $reverseIP($gettok($v2, 1-4, 46))
echo 4 -s IP %IP should be killed.
}
}


Link Copied to Clipboard