Id: 10683; Nick: Teppuli; Timestamp: 2008-05-17 11:28:47; Pasted as: mIRC
Description: n/a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
; ProxyScan v2.0 by Teppuli (#AndRew & #teppuli @QuakeNet)
 
 
on 1:join:#:{
  if ($readini(dnsblscan.ini,$chan,status) == on) {
    if ($me !isop $chan) { halt }
    if (*.users.quakenet.org iswm $site) { halt }
    if ($network != QuakeNet) { echo -ag ProxyScan: Warning! I'm not connected to QuakeNet. This script is designed to work only with QuakeNet. | halt }
    if (!%dnsbls) { echo -ag ProxyScan: No DNSBL list specified, set it with ".proxy help" | halt }
    set -u20 %dnsresolving_ [ $+ [ $nick ] ] $chan
    dns $nick
  }
}
ctcp *:VERSION:*:{
  /.ctcpreply $nick VERSION + ProxyScan v2.0 by Teppuli (#teppuli&#AndRew @ QuakeNet) 
  halt
}
 
 
on 9:text:.proxy *:#:{
  if ($2 == version) {
    ; Version
    .notice $nick ProxyScan v2.0 by teppuli & AndRew (Linecount: $lines($script) $+ )
    halt
  }
  if ($2 == status) {
    ; Status
    if (!$readini(dnsblscan.ini,$chan,status)) { .notice $nick ProxyScan status is currently: OFF | halt }
    .notice $nick ProxyScan status is currently:  $upper($readini(dnsblscan.ini,$chan,status)) 
    halt
  }
  if ($2 == enable) { writeini dnsblscan.ini $chan status on | .notice $nick Done. ProxyScan is enabled for this channel. | halt }
  if ($2 == disable) { writeini dnsblscan.ini $chan status off | .notice $nick Done. ProxyScan is disabled for this channel. | halt }
  if ($2 == sources)  {
    ; Get DNSBLs
    if (!%dnsbls) { .notice $nick No sources list specified, set it with " $+ $1 setsources <sources separated with space> " | halt }
    .notice $nick Sources: %dnsbls
    halt
  }
  if ($2 == setsources) {
    ; Set DNSBLs
    if (!$3) { .notice $nick Usage $1-2 <sources separated with space> | halt }
    set %dnsbls $3-
    .notice $nick Done. New sources set.
    halt
  }
  if ($2 == kickskin) {
    ; Set kickskin
    if (!$3) { .notice $nick Usage $1-2 <skin> | .notice $nick Variables: :id: :dnsbl: :ip: | halt }
    set %dnsbl_kskin $3-
    .notice $nick Done. New kickskin set.
    halt
  }
  if ($2 == clearcache) {
    ; Clear host cache
    remini dnsblscan.ini cache
    .notice $nick Done. Cache cleared succesfully.
    halt
  }
  if ($2 == getkickskin) {
    ; Get kickskin
    if (!%dnsbl_kskin) { .notice $nick No kickskin set, using default. | halt }
    .notice $nick Current kickskin: %dnsbl_kskin
    halt
  }
  if ($2 == listexceptions) {
    ; List exceptions
    .notice $nick Proxy exception list:
    var %i = 1
    while (%i <= $ini(dnsblexceptions.ini,$chan)) {
      var %host = $ini(dnsblexceptions.ini,$chan,%i)
      if (%host == $null) { .notice $nick End of Proxy exception list. | halt }
      .notice $nick Host: %host
      inc %i
    }
    .notice $nick End of Proxy exception list.
    halt
  }
  if ($2 == addexception) {
    ; Add exception
    if (!$3) { .notice $nick Usage: $1-2 <host> | halt }
    if (*!*@* !iswm $3) { .notice $nick Please specify valid host. | halt }
    writeini dnsblexceptions.ini $chan $3 valid
    .notice $nick Done. Added $+(",$3,") to proxy exception list.
    halt
  }
  if ($2 == delexception) {
    ; Remove exception
    if (!$3) { .notice $nick Usage: $1-2 <host> | halt }
    if (*!*@* !iswm $3) { .notice $nick Please specify valid host. | halt }
    remini dnsblexceptions.ini $chan $3
    .notice $nick Done. Removed $+(",$3,") from proxy exception list.
    halt
  }
  if ($2 == info) {
    ; Info about status
    .notice $nick Status:
    .notice $nick Total cached IPs: $ini(dnsblscan.ini,cache,0)
    .notice $nick Number of hosts in exception list: $ini(dnsblexceptions.ini,$chan,0) 
    .notice $nick Proxy kick-ID: $iif(!%proxyid,0,%proxyid) 
    .notice $nick Status on this channel: $upper($readini(dnsblscan.ini,$chan,status))
    halt
  }
  if ($2 == kickid) {
    ; Kick ID
 
    .notice $nick Proxy kick-ID: $iif(!%proxyid,0,%proxyid) 
 
    halt
  }
  if ($2 == init) {
    ; Init script
    if ($readini(dnsblscan.ini,::proxy_CINIT,$chan) == g) { .notice $nick ProxyScan is already initialized. | halt }
    set %dnsbls cbl.abuseat.org opm.blitzed.org dnsbl.ahbl.org list.dsbl.org sbl.csma.biz dnsbl.njabl.org
    writeini dnsblexceptions.ini $chan LM D
    writeini dnsblscan.ini cache LM D
    remini dnsblscan.ini cache LM
    writeini dnsblscan.ini $chan status off
    remini dnsblexceptions.ini $chan LM
    writeini dnsblscan.ini ::proxy_CINIT $chan g
    .notice $nick ProxyScan initialized.
    halt
  }
  if ($2 == scan) {
    ; Scan user using this feature
    if (!$3) { .notice $nick Usage: $1-2 <nickname> | halt }
 
    if ($me !isop $chan) { .notice $nick Im not op here! | halt }
    if ($3 !ison $chan) { .notice $nick Error! User $3 isnt on this chan! | halt }
    if (*!*@*.users.quakenet.org iswm $address($3,5)) { .notice $nick Error! User $3 has mode +x enabled. | halt }
    if (!%dnsbls) { .notice $nick No DNSBL list specified, set it with " $+ $1 help" | halt }
    set -u20 %dnsresolving_ [ $+ [ $3 ] ] $chan
    dns $3
    .notice $nick Scanning in process... You 
    halt
  }
  if ($2 == help) { .notice $nick Usage: $1 help/kickid/init/info/scan/setsources/sources/clearcache/enable/disable/status/kickskin/getkickskin/version/addexception/listexceptions/delexception | halt }
  .notice $nick Usage: $1 help/kickid/init/info/scan/setsources/sources/clearcache/enable/disable/status/kickskin/getkickskin/version/addexception/listexceptions/delexception | halt
}
on 1:DNS:{
 
  if ($dns(0) == 0) { halt }
  if (%dnsresolving_ [ $+ [ $dns(1).nick ] ]) {
    dnsblcheck $dns(1).ip $dns(1).nick %dnsresolving_ [ $+ [ $dns(1).nick ] ] 
  }
  if (!$readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),channel)) { halt }
  var %host = $address($readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),nick),2)
  inc %proxyid
  var %kskin = Banned: Open proxy resolved from DNSBL :dnsbl:. ID: :id:
  if (%dnsbl_kskin) { var %kskin = %dnsbl_kskin }
  kick $readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),channel) $readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),nick) $replace(%kskin,:ip:,$reversebytes($gettok($dns(1),1-4,46)),:id:,%proxyid,:dnsbl:,$deltok($dns(1),1-4,46))
  mode $readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),channel) +b %host
  echo -ag ProxyScan: dnsblcheck: Open proxy detected. DNSBL: $deltok($dns(1),1-4,46) CHAN: $readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),channel) NICK: $readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),nick) IP (reversed): $gettok($dns(1),1-4,46)
  writeini dnsblscan.ini cache $gettok($dns(1),1-4,46) $deltok($dns(1),1-4,46)
  timer 1 300 mode $readini(dnsblcheck.ini,$gettok($dns(1),1-4,46),channel) -b %host
}
on 9:text:.proxy:#:{ .notice $nick Usage: $1 help/info/scan/setsources/sources/clearcache/enable/disable/status/kickskin/getkickskin/version/addexception/listexceptions/delexception | halt  }
on 1:load:{  echo -ag ProxyScan v2.0 loaded first time. REMEMBER TO TYPE .proxy init TO INITIALIZE THIS SCRIPT! }
alias reversebytes {
  tokenize 46 $1 
  return $+($4,.,$3,.,$2,.,$1)
}
alias dnsblcheck {
  if (!%dnsbls) { echo -ag ProxyScan: dnsblcheck: No DNSBL list specified, halting | halt }
  var %i = 1
  while (%i <= $ini(dnsblexceptions.ini,$3)) {
    var %host = $ini(dnsblexceptions.ini,$3,%i)
    if (%host iswm $address($2,2)) { echo -ag ProxyScan: dnsblcheck: Nickname is in exception list, halting. | notice $2 Because you're in our proxy exception list, you don't get scanned for open proxies. | halt }
    inc %i
  }
  var %address = $reversebytes($1)
  var %i = 1
  while (%i <= $ini(dnsblscan.ini,cache)) {
    var %dnsblused = $readini(dnsblscan.ini,cache,$ini(dnsblscan.ini,cache,%i))
    var %ipaddr = $ini(dnsblscan.ini,cache,%i)
    if (%ipaddr == %address) {
      echo -ag dnsblcheck: Cached address %address detected on $3 $+ , banning nick $2
      var %host = $address(2,2)
      inc %proxyid
      var %kskin = Banned: Cached open proxy resolved from DNSBL :dnsbl:. ID: :id:
      if (%dnsbl_kskin) { var %kskin = %dnsbl_kskin }
      kick $3 $2 $replace(%kskin,:id:,%proxyid,:dnsbl:,%dnsblused)
      echo -ag ProxyScan: dnsblcheck: Open proxy detected (used cache). DNSBL: %dnsblused CHAN: $3 NICK: $2 IP (normal-reversed): $1 $+ %address
      ; READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ 
      ; ----------------------------------------------------------------------------------------------------------------------------
      ; Following message is sent to user, if he/she is in cache.
      notice $2 You're in our proxy cache database. Maybe you are'nt proxy? Then send message to channel admin, please :)
      ; ----------------------------------------------------------------------------------------------------------------------------
      ; READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ 
 
      mode $3 +b %host
      timer 1 300 mode $3 -b %host
    }
    inc %i
  }
 
  var %i = 1
  while (%i <= $numtok(%dnsbls,32)) {
    writeini dnsblcheck.ini %address channel $3
    writeini dnsblcheck.ini %address nick $2 
    timer 1 60 remini dnsblcheck.ini %address
    dns $+(%address,.,$gettok(%dnsbls,%i,32))
    inc %i
  }
}
 
Options: New, Download,
, mIRC Parser;
Copyright © 2006 by Zyberdog - Some rights reserved. (Browse/Disclaimer/Stats/About)