Răsfoiți Sursa

* Added var 'auth-obscure': Don't halt on dcc w/dccauth if the pass is wrong; halt at hash (right or wrong). (#100)

svn: 2164
Bryan Drewery 21 ani în urmă
părinte
comite
394fd8acf0
6 a modificat fișierele cu 17 adăugiri și 6 ștergeri
  1. 1 0
      doc/UPDATES
  2. 7 2
      misc/help.txt
  3. 5 3
      src/dcc.c
  4. 1 0
      src/dcc.h
  5. 2 0
      src/set.c
  6. 1 1
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -149,6 +149,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * In config/-C, the ip field for bots can now be either ipv4 or ipv6. (ipv6 field still present)
 * Clearing chanset var now correctly uses defaults.
 * Fixed cmd_jump/cmd_botjump not parsing 'server:port' correctly.
+* Added var 'auth-obscure': Don't halt on dcc w/dccauth if the pass is wrong; halt at hash (right or wrong). (#100)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 7 - 2
misc/help.txt

@@ -1483,14 +1483,19 @@ See also: reload, backup
    $uR$u:    Rate. Set as 'number:interval', ie, '1:5'
    $uD$u:    Detected vars have the folloing options: $bignore$b/0, $bwarn$b/1, $bdie$b/2, 
                                                       $breject$b/3, $bsuicide$b/4
- 
+
+[SL] $balias$b           List of dcc aliases in format '<alias> <cmd> [parms]'. First
+                          matching alias is used. Normal flag checking is done
+                          after the alias is expanded.
+                          $fCAUTION: TRIPPLE CHECK FOR POSSIBLE LOOPS AS THEY ARE FATAL.$f
 [S]  $bchanset$b         List of default options for when a channel is added. Same format 
                           as 'chanset'.
 [N]  $bserver-port$b     Default port to use for server connections.
 [S]  $bauth-key$b        The authkey used during authing.G ive to users if they need to auth. 
                           (can be bot specific)
 [C]  $bauth-prefix$b     The prefix character used for msg cmds, ie: $u!$uop or $u.$uop
- 
+[B]  $bauth-obscure$b    Will not halt in dcc pass is wrong and authing is enabled. 
+                          Will always fail at auth hash though.
   *  Msg cmd vars may be left blank to disable usage of cmd.
 [S]  $bmsgop$b           Defines the cmd for opping via msging the bot.
 [S]  $bmsgpass$b         Defines the cmd for setting a pass via msging the bot.

+ 5 - 3
src/dcc.c

@@ -639,7 +639,7 @@ dcc_chat_secpass(int idx, char *buf, int atr)
   }
 
   /* Correct pass or secpass! */
-  if (!dccauth || (dccauth && !badauth)) {
+  if (!dcc[idx].wrong_pass || (!dccauth || (dccauth && !badauth))) {
     putlog(LOG_MISC, "*", DCC_LOGGEDIN, dcc[idx].nick, dcc[idx].host, dcc[idx].port);
     if (dcc[idx].u.chat->away) {
       free(dcc[idx].u.chat->away);
@@ -666,7 +666,7 @@ dcc_chat_secpass(int idx, char *buf, int atr)
       dprintf(idx, "********************************************************************\n");
     }
     dcc_chatter(idx);
-  } else if (dccauth && badauth) { 		/* bad auth */
+  } else if ((dccauth && badauth) || dcc[idx].wrong_pass) { 		/* bad auth */
     dprintf(idx, "%s\n", response(RES_BADUSERPASS));
     putlog(LOG_MISC, "*", DCC_BADAUTH, dcc[idx].nick, dcc[idx].host, dcc[idx].port);
     if (dcc[idx].u.chat->away) {        /* su from a dumb user */
@@ -950,7 +950,9 @@ dcc_chat_pass(int idx, char *buf, int atr)
     }
     return;
   }
-  if (u_pass_match(dcc[idx].user, pass)) {
+  if (u_pass_match(dcc[idx].user, pass) || auth_obscure) {
+    if (auth_obscure)
+      dcc[idx].wrong_pass = 1;
     if (dccauth) { 
       char randstr[51] = "";
 

+ 1 - 0
src/dcc.h

@@ -51,6 +51,7 @@ struct dcc_t {
   int simul;                    /* this will hold the idx on the remote bot to return result. */
   bool irc;			/* forward the output back to irc? */
   bool hub;			// is this bot a hub?
+  bool wrong_pass;		// auth obscure hack
 //  int auth;
   bool whowas;
   int dns_id;

+ 2 - 0
src/set.c

@@ -20,6 +20,7 @@
 
 int set_noshare = 0;
 
+bool auth_obscure = 0;
 char alias[1024] = "bc botcmd,bl botcmd ?";
 char auth_key[51] = "";
 char auth_prefix[2] = "";
@@ -50,6 +51,7 @@ static variable_t vars[] = {
  {"alias",		alias,			sizeof(alias),			VAR_STRING|VAR_LIST|VAR_NOLOC|VAR_PERM, NULL, NULL},
  {"auth-key",		auth_key,		sizeof(auth_key),		VAR_STRING|VAR_PERM, NULL, NULL},
  {"auth-prefix",	auth_prefix,		sizeof(auth_prefix),		VAR_STRING|VAR_NOLHUB|VAR_PERM, NULL, NULL},
+ {"auth-obscure",	&auth_obscure,		0,				VAR_INT|VAR_BOOL, NULL, NULL},
  {"bad-process",	&badprocess,		0,				VAR_INT|VAR_DETECTED, NULL, NULL},
  {"dccauth",		&dccauth,		0,				VAR_INT|VAR_BOOL, NULL, NULL},
  {"chanset",		glob_chanset,		sizeof(glob_chanset),		VAR_STRING|VAR_CHANSET|VAR_NOLHUB, NULL, NULL},

+ 1 - 1
src/set.h

@@ -53,7 +53,7 @@ typedef struct rate_b {
 
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[], process_list[];
-extern bool		dccauth;
+extern bool		dccauth, auth_obscure;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare,
 			kill_threshold, lag_threshold, op_bots, badprocess, hijack, login, promisc, trace;
 extern rate_t		op_requests, close_threshold;