ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/doc/reference.conf
Revision: 5437
Committed: Wed Jan 28 18:50:03 2015 UTC (9 years, 2 months ago) by michael
File size: 21017 byte(s)
Log Message:
- reference.conf: added connregex for InspIRCd provided by Attila

File Contents

# Content
1 /*
2 * Hybrid Open Proxy Monitor - HOPM sample configuration
3 *
4 * $Id$
5 */
6
7 /*
8 * Shell style (#), C++ style (//) and C style comments are supported.
9 *
10 * Times/durations are written as:
11 * 12 hours 30 minutes 1 second
12 *
13 * Valid units of time:
14 * year, month, week, day, hour, minute, second
15 *
16 * Valid units of size:
17 * megabyte/mbyte/mb, kilobyte/kbyte/kb, byte
18 *
19 * Sizes and times may be singular or plural.
20 */
21
22 options {
23 /*
24 * Full path and filename for storing the process ID of the running
25 * HOPM.
26 */
27 pidfile = "/some/path/var/hopm.pid";
28
29 /*
30 * How long to store the IP address of hosts which are confirmed
31 * (by previous scans) to be secure. New users from these
32 * IP addresses will not be scanned again until this amount of time
33 * has passed. IT IS STRONGLY RECOMMENDED THAT YOU DO NOT USE THIS
34 * DIRECTIVE, but it is provided due to demand.
35 *
36 * The main reason for not using this feature is that anyone capable
37 * of running a proxy can get abusers onto your network - all they
38 * need do is shut the proxy down, connect themselves, restart the
39 * proxy, and tell their friends to come flood.
40 *
41 * Keep this directive commented out to disable negative caching.
42 */
43 # negcache = 1 hour;
44
45 /*
46 * How long between rebuilds of the negative cache. The negcache
47 * is only rebuilt to free up memory used by entries that are too old.
48 * You probably don't need to tweak this unless you have huge amounts
49 * of people connecting (hundreds per minute). Default is 12 hours.
50 */
51 negcache_rebuild = 12 hours;
52
53 /*
54 * Amount of file descriptors to allocate to asynchronous DNS. 64
55 * should be plenty for almost anyone.
56 */
57 dns_fdlimit = 64;
58
59 /*
60 * Put the full path and filename of a logfile here if you wish to log
61 * every scan done. Normally HOPM only logs successfully detected
62 * proxies in the hopm.log, but you may get abuse reports to your ISP
63 * about portscanning. Being able to show that it was HOPM that did
64 * the scan in question can be useful. Leave commented for no
65 * logging.
66 */
67 # scanlog = "/some/path/var/scan.log";
68 };
69
70
71 irc {
72 /*
73 * IP to bind to for the IRC connection. You only need to use this if
74 * you wish HOPM to use a particular interface (virtual host, IP
75 * alias, ...) when connecting to the IRC server. There is another
76 * "vhost" setting in the scan {} block below for the actual
77 * portscans. Note that this directive expects an IP address, not a
78 * hostname. Please leave this commented out if you do not
79 * understand what it does, as most people don't need it.
80 */
81 # vhost = "0.0.0.0";
82
83 /*
84 * Nickname for HOPM to use.
85 */
86 nick = "MyHopm";
87
88 /*
89 * Text to appear in the "realname" field of HOPM's /whois output.
90 */
91 realname = "Hybrid Open Proxy Monitor";
92
93 /*
94 * If you don't have an identd running, what username to use.
95 */
96 username = "hopm";
97
98 /*
99 * Hostname (or IP) of the IRC server which HOPM will monitor
100 * connections on.
101 */
102 server = "irc.example.org";
103
104 /*
105 * Password used to connect to the IRC server (PASS)
106 */
107 # password = "secret";
108
109 /*
110 * Port of the above server to connect to. This is what HOPM uses to
111 * get onto IRC itself, it is nothing to do with what ports/protocols
112 * are scanned, nor do you need to list every port your ircd listens
113 * on.
114 */
115 port = 6667;
116
117 /*
118 * Defines time in which bot will timeout if no data is received
119 */
120 readtimeout = 15 minutes;
121
122 /*
123 * Command to execute to identify to NickServ (if your network uses
124 * it). This is the raw IRC command text, and the below example
125 * corresponds to "/msg nickserv identify password" in a client. If
126 * you don't understand, just edit "password" in the line below to be
127 * your HOPM's nick password. Leave commented out if you don't need
128 * to identify to NickServ.
129 */
130 # nickserv = "NS IDENTIFY password";
131
132 /*
133 * The username and password needed for HOPM to oper up.
134 */
135 oper = "hopm operpass";
136
137 /*
138 * Mode string that HOPM needs to set on itself as soon as it opers
139 * up. This needs to include the mode for seeing connection notices,
140 * otherwise HOPM won't scan anyone (that's usually umode +c).
141 */
142 mode = "+c";
143
144 /*
145 * If this is set then HOPM will use it as an /away message as soon as
146 * it connects.
147 */
148 away = "I'm a bot. Your messages will be ignored.";
149
150 /*
151 * Info about channels you wish HOPM to join in order to accept
152 * commands. HOPM will also print messages in these channels every
153 * time it detects a proxy. Only IRC operators can command HOPM to do
154 * anything, but some of the things HOPM reports to these channels
155 * could be considered sensitive, so it's best not to put HOPM into
156 * public channels.
157 */
158 channel {
159 /*
160 * Channel name. Local ("&") channels are supported if your ircd
161 * supports them.
162 */
163 name = "#hopm";
164
165 /*
166 * If HOPM will need to use a key to enter this channel, this is
167 * where you specify it.
168 */
169 # key = "somekey";
170
171 /*
172 * If you use ChanServ then maybe you want to set the channel
173 * invite-only and have each HOPM do "/msg ChanServ invite" to get
174 * itself in. Leave commented if you don't, or if this makes no
175 * sense to you.
176 */
177 # invite = "CS INVITE #hopm";
178 };
179
180 /*
181 * You can define a bunch of channels if you want:
182 *
183 * channel { name = "#other"; }; channel { name="#channel"; }
184 */
185
186 /*
187 * connregex is a POSIX regular expression used to parse connection
188 * (+c) notices from the ircd. The complexity of the expression should
189 * be kept to a minimum.
190 *
191 * Items in order MUST be: nick user host IP
192 *
193 * HOPM will not work with ircds which do not send an IP in the
194 * connection notice.
195 *
196 * This is fairly complicated stuff, and the consequences of getting
197 * it wrong are the HOPM does not scan anyone. Unless you know
198 * absolutely what you are doing, please just uncomment the example
199 * below that best matches the type of ircd you use.
200 */
201
202 /* ircd-hybrid */
203 connregex = "\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*";
204
205 /* InspIRCd */
206 # connregex = "\\*\\*\\* .*CONNECT: Client connecting.*: ([^ ]+)!([^@]+)@([^\\)]+) \\(([0-9\\.]+)\\) \\[.*\\]";
207
208 /*
209 * "kline" controls the command used when an open proxy is confirmed.
210 * We suggest applying a temporary (no more than a few hours) KLINE on the host.
211 *
212 * <WARNING>
213 * Make sure if you need to change this string you also change the
214 * kline command for every DNSBL you enable below.
215 *
216 * Also note that some servers do not allow you to include ':' characters
217 * inside the KLINE message (e.g. for a http:// address).
218 *
219 * Users rewriting this message into something that isn't even a valid
220 * IRC command is the single most common cause of support requests and
221 * therefore WE WILL NOT SUPPORT YOU UNLESS YOU USE ONE OF THE EXAMPLE
222 * KLINE COMMANDS BELOW.
223 * </WARNING>
224 *
225 * That said, should you wish to customise this text, several
226 * printf-like placeholders are available:
227 *
228 * %n User's nick
229 * %u User's username
230 * %h User's irc hostname
231 * %i User's IP address
232 *
233 */
234 kline = "KLINE 180 *@%h :Open proxy found on your host.";
235
236 /*
237 * An AKILL example for services with OperServ. Your HOPM must have permission to
238 * AKILL for this to work!
239 */
240 # kline = "OS AKILL ADD +3h *@%h Open proxy found on your host.";
241
242 /*
243 * Text to send on connection, these can be stacked and will be sent in this order.
244 */
245 # perform = "TIME";
246
247 /*
248 * Text to send, via NOTICE, immediately when a new client connects. These can be
249 * stacked and will be sent in this order.
250 */
251 # notice = "You are now being scanned for open proxies. If you have nothing to hide, you have nothing to fear.";
252 };
253
254
255 /*
256 * OPM Block defines blacklists and information required to report new proxies
257 * to a dns blacklist. DNS-based blacklists store IP addresses in a DNS zone
258 * file. There are several blacklist that list IP addresses known to be open
259 * proxies or other forms of IRC abuse. By checking against these blacklists,
260 * HOPMs are able to ban known sources of abuse without completely scanning them.
261 */
262 #opm {
263 /*
264 * Blacklist zones to check IPs against. If you would rather not
265 * trust a remotely managed blacklist, you could set up your own, or
266 * leave these commented out in which case every user will be
267 * scanned. The use of at least one open proxy DNSBL is recommended
268 * however.
269 *
270 * Please check the policies of each blacklist you use to check you
271 * are comfortable with using them to block access to your server
272 * (and that you are allowed to use them).
273 */
274
275
276 /* dnsbl.dronebl.org - http://dronebl.org */
277 # blacklist {
278 /* The DNS name of the blacklist */
279 # name = "dnsbl.dronebl.org";
280
281 /*
282 * There are only two values that are valid for this
283 * "A record bitmask" and "A record reply"
284 * These options affect how the values specified to reply
285 * below will be interpreted, a bitmask is where the reply
286 * values are 2^n and more than one is added up, a reply is
287 * simply where the last octet of the IP is that number.
288 * If you are not sure then the values set for dnsbl.dronebl.org
289 * will work without any changes.
290 */
291 # type = "A record reply";
292
293 /*
294 * Kline types not listed in the reply list below.
295 *
296 * For DNSBLs that are not IRC specific and you just wish to kline
297 * certain types this can be enabled/disabled.
298 */
299 # ban_unknown = no;
300
301 /*
302 * The actual values returned by the dnsbl.dronebl.org blacklist as
303 * documented at http://dronebl.org/docs/howtouse
304 */
305 # reply {
306 # 2 = "Sample";
307 # 3 = "IRC Drone";
308 # 5 = "Bottler";
309 # 6 = "Unknown spambot or drone";
310 # 7 = "DDOS Drone";
311 # 8 = "SOCKS Proxy";
312 # 9 = "HTTP Proxy";
313 # 10 = "ProxyChain";
314 # 13 = "Brute force attackers";
315 # 14 = "Open Wingate Proxy";
316 # 15 = "Compromised router / gateway";
317 # 17 = "Automatically determined botnet IPs (experimental)";
318 # 255 = "Unknown";
319 # };
320
321 /*
322 * The kline message sent for this specific blacklist, remember to put
323 * the removal method in this.
324 */
325 # kline = "KLINE 180 *@%h :You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded?ip=%i&network=Network";
326 # };
327
328
329 /* tor.dnsbl.sectoor.de - http://www.sectoor.de/tor.php */
330 # blacklist {
331 # name = "tor.dnsbl.sectoor.de";
332 # type = "A record reply";
333 # ban_unknown = no;
334
335 # reply {
336 # 1 = "Tor exit server";
337 # };
338
339 # kline = "KLINE 180 *@%h :Tor exit server detected. For more information, visit http://www.sectoor.de/tor.php?ip=%i";
340 # };
341
342 /* rbl.efnetrbl.org - http://rbl.efnetrbl.org/ */
343 # blacklist {
344 # name = "rbl.efnetrbl.org";
345 # type = "A record reply";
346 # ban_unknown = no;
347
348 # reply {
349 # 1 = "Open proxy";
350 # 2 = "spamtrap666";
351 # 3 = "spamtrap50";
352 # 4 = "TOR";
353 # 5 = "Drones / Flooding";
354 # };
355
356 # kline = "KLINE 180 *@%h :Blacklisted proxy found. For more information, visit http://rbl.efnetrbl.org/?i=%i";
357 # };
358
359
360
361 /* tor.efnetrbl.org - http://rbl.efnetrbl.org/ */
362 # blacklist {
363 # name = "tor.efnetrbl.org";
364 # type = "A record reply";
365 # ban_unknown = no;
366
367 # reply {
368 # 1 = "TOR";
369 # };
370
371 # kline = "KLINE 180 *@%h :TOR exit node found. For more information, visit http://rbl.efnetrbl.org/?i=%i";
372 # };
373
374 /*
375 * You can report the insecure proxies you find to a DNSBL also!
376 * The remaining directives in this section are only needed if you
377 * intend to do this. Reports are sent by email, one email per IP
378 * address. The format does support multiple addresses in one email,
379 * but we don't know of any servers that are detecting enough insecure
380 * proxies for this to be really necessary.
381 */
382
383 /*
384 * Email address to send reports FROM. If you intend to send reports,
385 * please pick an email address that we can actually send mail to
386 * should we ever need to contact you.
387 */
388 # dnsbl_from = "mybopm@myserver.org";
389
390 /*
391 * Email address to send reports TO.
392 * For example DroneBL:
393 */
394 # dnsbl_to = "bopm-report@dronebl.org";
395
396 /*
397 * Full path to your sendmail binary. Even if your system does not
398 * use sendmail, it probably does have a binary called "sendmail"
399 * present in /usr/sbin or /usr/lib. If you don't set this, no
400 * proxies will be reported.
401 */
402 # sendmail = "/usr/sbin/sendmail";
403 #};
404
405
406 /*
407 * The short explanation:
408 *
409 * This is where you define what ports/protocols to check for. You can have
410 * multiple scanner blocks and then choose which users will get scanned by
411 * which scanners further down.
412 *
413 * The long explanation:
414 *
415 * Scanner defines a virtual scanner. For each user being scanned, a scanner
416 * will use a file descriptor (and subsequent connection) for each protocol.
417 * Once connecting it will negotiate the proxy to connect to
418 * target_ip:target_port (target_ip MUST be an IP).
419 *
420 * Once connected, any data passed through the proxy will be checked to see if
421 * target_string is contained within that data. If it is the proxy is
422 * considered open. If the connection is closed at any point before
423 * target_string is matched, or if at least max_read bytes are read from the
424 * connection, the negotiation is considered failed.
425 */
426 scanner {
427
428 /*
429 * Unique name of this scanner. This is used further down in the
430 * user {} blocks to decide which users get affected by which
431 * scanners.
432 */
433 name = "default";
434
435 /*
436 * HTTP CONNECT - very common proxy protocol supported by widely known
437 * software such as Squid and Apache. The most common sort of
438 * insecure proxy and found on a multitude of weird ports too. Offers
439 * transparent two way TCP connections.
440 */
441 protocol = HTTP:80;
442 protocol = HTTP:8080;
443 protocol = HTTP:3128;
444 protocol = HTTP:6588;
445
446 /*
447 * SOCKS4/5 - well known proxy protocols, probably the second most
448 * common for insecure proxies, also offers transparent two way TCP
449 * connections. Fortunately largely confined to port 1080.
450 */
451 protocol = SOCKS4:1080;
452 protocol = SOCKS5:1080;
453
454 /*
455 * Cisco routers with a default password (yes, it really does happen).
456 * Also pretty much anything else that will let you telnet to anywhere
457 * else on the internet. Fortunately these are always on port 23.
458 */
459 protocol = ROUTER:23;
460
461 /*
462 * WinGate is commercial windows proxy software which is now not so
463 * common, but still to be found, and helpfully presents an interface
464 * that can be used to telnet out, on port 23.
465 */
466 protocol = WINGATE:23;
467
468 /*
469 * The HTTP POST protocol, often dismissed when writing the access
470 * controls for proxies, but sadly can still be used to abused.
471 * Offers only the opportunity to send a single block of data, but
472 * enough of them at once can still make for a devastating flood.
473 * Found on the same ports that HTTP CONNECT proxies inhabit.
474 *
475 * Note that if your ircd has "ping cookies" then clients from HTTP
476 * POST proxies cannot actually ever get onto your network anyway. If
477 * you leave the checks in then you'll still find some (because some
478 * people IRC from boxes that run them), but if you use HOPM purely as
479 * a protective measure and you have ping cookies, you need not scan
480 * for HTTP POST.
481 */
482 protocol = HTTPPOST:80;
483
484 /*
485 * IP this scanner will bind to. Use this if you need your scans to
486 * come FROM a particular interface on the machine you run HOPM from.
487 * If you don't understand what this means, please leave this
488 * commented out, as this is a major source of support queries!
489 */
490 # vhost = "127.0.0.1";
491
492 /*
493 * Maximum file descriptors this scanner can use. Remember that there
494 * will be one FD for each protocol listed above. As this example
495 * scanner has 8 protocols, it requires 8 FDs per user. With a 512 FD
496 * limit, this scanner can be used on 64 users _at the same time_.
497 * That should be adequate for most servers.
498 */
499 fd = 512;
500
501 /*
502 * Maximum data read from a proxy before considering it closed. Don't
503 * set this too high, some people have fun setting up lots of ports
504 * that send endless data to tie up your scanner. 4KB is plenty for
505 * any known proxy.
506 */
507 max_read = 4kb;
508
509 /*
510 * Amount of time before a test is considered timed out.
511 * Again, all but the poorest slowest proxies will be detected within
512 * 30 seconds, and this helps keep resource usage low.
513 */
514 timeout = 30 seconds;
515
516 /*
517 * Target IP to tell the proxy to connect to
518 *
519 * !!! THIS MUST BE CHANGED !!!
520 *
521 * You cannot instruct the proxy to connect to itself! The easiest
522 * thing to do would be to set this to the IP of your ircd and then
523 * keep the default target_strings.
524 *
525 * Please use an IP that is publically reachable from anywhere on the
526 * Internet, because you have no way of knowing where the insecure
527 * proxies will be located. Just because you and your HOPM can
528 * connect to your ircd on some private IP like 192.168.0.1, does not
529 * mean that the insecure proxies out there on the Internet will be
530 * able to. And if they never connect, you will never detect them.
531 *
532 * Remember to change this setting for every scanner you configure.
533 */
534 target_ip = "127.0.0.1";
535
536 /*
537 * Target port to tell the proxy to connect to. This is usually
538 * something like 6667. Basically any client-usable port.
539 */
540 target_port = 6667;
541
542 /*
543 * Target string we check for in the data read back by the scanner.
544 * This should be some string out of the data that your ircd usually
545 * sends on connect. The example below will work on most
546 * hybrid/bahamut ircds. Multiple target strings are allowed.
547 *
548 * NOTE: Try to keep the number of target strings to a minimum. Two
549 * should be fine. One for normal connections and one for throttled
550 * connections. Comment out any others for efficiency.
551 */
552
553 /*
554 * Usually first line sent to client on connection to ircd.
555 * If your ircd supports a more specific line (see below),
556 * using it will reduce false positives.
557 */
558 target_string = ":irc.example.org NOTICE * :*** Looking up your hostname";
559
560 /*
561 * If you try to connect too fast, you'll be throttled by your own
562 * ircd. Here's what a hybrid throttle message looks like:
563 */
564 target_string = "ERROR :Your host is trying to (re)connect too fast -- throttled.";
565 };
566
567
568 scanner {
569 name = "extended";
570
571 protocol = HTTP:81;
572 protocol = HTTP:8000;
573 protocol = HTTP:8001;
574 protocol = HTTP:8081;
575
576 protocol = HTTPPOST:81;
577 protocol = HTTPPOST:6588;
578 # protocol = HTTPPOST:4480;
579 protocol = HTTPPOST:8000;
580 protocol = HTTPPOST:8001;
581 protocol = HTTPPOST:8080;
582 protocol = HTTPPOST:8081;
583
584 /*
585 * IRCnet have seen many socks5 on these ports, more than on the
586 * standard ports even.
587 */
588 protocol = SOCKS4:4914;
589 protocol = SOCKS4:6826;
590 protocol = SOCKS4:7198;
591 protocol = SOCKS4:7366;
592 protocol = SOCKS4:9036;
593
594 protocol = SOCKS5:4438;
595 protocol = SOCKS5:5104;
596 protocol = SOCKS5:5113;
597 protocol = SOCKS5:5262;
598 protocol = SOCKS5:5634;
599 protocol = SOCKS5:6552;
600 protocol = SOCKS5:6561;
601 protocol = SOCKS5:7464;
602 protocol = SOCKS5:7810;
603 protocol = SOCKS5:8130;
604 protocol = SOCKS5:8148;
605 protocol = SOCKS5:8520;
606 protocol = SOCKS5:8814;
607 protocol = SOCKS5:9100;
608 protocol = SOCKS5:9186;
609 protocol = SOCKS5:9447;
610 protocol = SOCKS5:9578;
611
612 /*
613 * These came courtsey of Keith Dunnett from a bunch of public open
614 * proxy lists.
615 */
616 protocol = SOCKS4:29992;
617 protocol = SOCKS4:38884;
618 protocol = SOCKS4:18844;
619 protocol = SOCKS4:17771;
620 protocol = SOCKS4:31121;
621
622 fd = 400;
623
624 /*
625 * If required you can add settings such as target_ip here
626 * they will override the defaults set in the first scanner
627 * for this and subsequent scanners defined in the config file
628 * This affects the following options:
629 * fd, vhost, target_ip, target_port, target_string, timeout and
630 * max_read.
631 */
632 };
633
634
635 /*
636 * User blocks define what scanners will be used to scan which hostmasks.
637 * When a user connects they will be scanned on every scanner {} (above)
638 * that matches their host.
639 */
640 user {
641 /*
642 * Users matching this host mask will be scanned with all the
643 * protocols in the scanner named.
644 */
645 mask = "*!*@*";
646 scanner = "default";
647 };
648
649 user {
650 /*
651 * Connections without ident will match on a vast number of connections
652 * very few proxies run ident though
653 */
654 # mask = "*!~*@*";
655 mask = "*!squid@*";
656 mask = "*!nobody@*";
657 mask = "*!www-data@*";
658 mask = "*!cache@*";
659 mask = "*!CacheFlowS@*";
660 mask = "*!*@*www*";
661 mask = "*!*@*proxy*";
662 mask = "*!*@*cache*";
663
664 scanner = "extended";
665 };
666
667
668 /*
669 * Exempt hosts matching certain strings from any form of scanning or dnsbl.
670 * HOPM will check each string against both the hostname and the IP address of
671 * the user.
672 *
673 * There are very few valid reasons to actually use "exempt". HOPM should
674 * never get false positives, and we would like to know very much if it does.
675 * One possible scenario is that the machine HOPM runs from is specifically
676 * authorized to use certain hosts as proxies, and users from those hosts use
677 * your network. In this case, without exempt, HOPM will scan these hosts,
678 * find itself able to use them as proxies, and ban them.
679 */
680 exempt {
681 mask = "*!*@127.0.0.1";
682 };

Properties

Name Value
svn:eol-style native
svn:keywords Id