فهرست منبع

* Removed BDHASH as it wasn't even used.


svn: 3783
Bryan Drewery 18 سال پیش
والد
کامیت
c815be93ad
7فایلهای تغییر یافته به همراه10 افزوده شده و 23 حذف شده
  1. 1 0
      doc/UPDATES
  2. 0 7
      pack/pack.cfg.sample
  3. 1 6
      src/binary.c
  4. 3 5
      src/enclink.c
  5. 2 1
      src/enclink.h
  6. 1 1
      src/main.c
  7. 2 3
      src/settings.h

+ 1 - 0
doc/UPDATES

@@ -2,6 +2,7 @@
 * Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)
 * Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)
 * Fix channels added by cmd_slowjoin not having the user who added them associated with the channel.
 * Fix channels added by cmd_slowjoin not having the user who added them associated with the channel.
 * Fix leaf bots not updating behind other hubs (fixes #419)
 * Fix leaf bots not updating behind other hubs (fixes #419)
+* Removed BDHASH as it wasn't even used.
 
 
 1.2.15 - http://wraith.botpack.net/milestone/1.2.15
 1.2.15 - http://wraith.botpack.net/milestone/1.2.15
 * Fix a possible segfault when binaries compiled wrong
 * Fix a possible segfault when binaries compiled wrong

+ 0 - 7
pack/pack.cfg.sample

@@ -16,13 +16,6 @@ PACKNAME <name>
  */
  */
 SHELLHASH <md5hash>
 SHELLHASH <md5hash>
 
 
-/* BDHASH: 32 char MD5 hash used for IRC backdoor
- * in mIRC: //echo -a $MD5(SOMEWORD)
- * URL: http://bryan.shatow.net/crypt/
-# NOTE: Botlink uses this for linking, if it is changed on a bot, it wont link to another bot unless
-# the other bot has the same bdhash. (Protects your botnet, trust me) */
-BDHASH <md5hash>
-
 /* DCCPREFIX: 1 char cmd prefix for dcc. (ie, .cmd or !cmd) */
 /* DCCPREFIX: 1 char cmd prefix for dcc. (ie, .cmd or !cmd) */
 DCCPREFIX <.>
 DCCPREFIX <.>
 
 

+ 1 - 6
src/binary.c

@@ -25,7 +25,7 @@
 settings_t settings = {
 settings_t settings = {
   "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200",
   "\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200",
   /* -- STATIC -- */
   /* -- STATIC -- */
-  "", "", "", "", "", "", "", "", "", "", "",
+  "", "", "", "", "", "", "", "", "", "",
   /* -- DYNAMIC -- */
   /* -- DYNAMIC -- */
   "", "", "", "", "", "", "", "", "", "", "", "", "", "",
   "", "", "", "", "", "", "", "", "", "", "", "", "", "",
   /* -- PADDING */
   /* -- PADDING */
@@ -254,9 +254,6 @@ readcfg(const char *cfgfile)
         } else if (!egg_strcasecmp(buffer, "shellhash")) {
         } else if (!egg_strcasecmp(buffer, "shellhash")) {
           strlcpy(settings.shellhash, trim(p), sizeof settings.shellhash);
           strlcpy(settings.shellhash, trim(p), sizeof settings.shellhash);
           printf(".");
           printf(".");
-        } else if (!egg_strcasecmp(buffer, "bdhash")) {
-          strlcpy(settings.bdhash, trim(p), sizeof settings.bdhash);
-          printf(".");
         } else if (!egg_strcasecmp(buffer, "dccprefix")) {
         } else if (!egg_strcasecmp(buffer, "dccprefix")) {
           strlcpy(settings.dcc_prefix, trim(p), sizeof settings.dcc_prefix);
           strlcpy(settings.dcc_prefix, trim(p), sizeof settings.dcc_prefix);
           printf(".");
           printf(".");
@@ -362,7 +359,6 @@ static void edpack(settings_t *incfg, const char *in_hash, int what)
   update_hash();
   update_hash();
 
 
   dohash(incfg->shellhash);
   dohash(incfg->shellhash);
-  dohash(incfg->bdhash);
   update_hash();
   update_hash();
 
 
   dofield(incfg->dcc_prefix);
   dofield(incfg->dcc_prefix);
@@ -407,7 +403,6 @@ tellconfig(settings_t *incfg)
   dofield(incfg->hash);
   dofield(incfg->hash);
   dofield(incfg->packname);
   dofield(incfg->packname);
   dofield(incfg->shellhash);
   dofield(incfg->shellhash);
-  dofield(incfg->bdhash);
   dofield(incfg->dcc_prefix);
   dofield(incfg->dcc_prefix);
   dofield(incfg->features);
   dofield(incfg->features);
   dofield(incfg->owners);
   dofield(incfg->owners);

+ 3 - 5
src/enclink.c

@@ -40,8 +40,8 @@ static void ghost_link_case(int idx, direction_t direction)
     }
     }
 
 
     /* initkey-gen */
     /* initkey-gen */
-    /* bdhash port mynick conf.bot->nick */
-    sprintf(tmp, "%s@%4x@%s@%s", settings.bdhash, port, strtoupper(nick1), strtoupper(nick2));
+    /* salt1 salt2 port mynick conf.bot->nick */
+    sprintf(tmp, "%s@%s@%4x@%s@%s", settings.salt1, settings.salt2, port, strtoupper(nick1), strtoupper(nick2));
     free(nick1);
     free(nick1);
     free(nick2);
     free(nick2);
     strlcpy(keyp, SHA1(tmp), ENC_KEY_LEN + 1);
     strlcpy(keyp, SHA1(tmp), ENC_KEY_LEN + 1);
@@ -354,9 +354,7 @@ void link_get_method(int idx)
 
 
 /* the order of entries here determines which will be picked */
 /* the order of entries here determines which will be picked */
 struct enc_link enclink[] = {
 struct enc_link enclink[] = {
-  { "ghost+case2", LINK_GHOSTCASE2, ghost_link_case, ghost_write, ghost_read, ghost_parse },
-// Disabled this one so 1.2.6->1.2.7 will use cleartext, as some 1.2.6 nets have an empty BDHASH
-//  { "ghost+case", LINK_GHOSTCASE, ghost_link_case, ghost_write, ghost_read, ghost_parse },
+  { "ghost+case3", LINK_GHOSTCASE3, ghost_link_case, ghost_write, ghost_read, ghost_parse },
   { "cleartext", LINK_CLEARTEXT, NULL, NULL, NULL, NULL },
   { "cleartext", LINK_CLEARTEXT, NULL, NULL, NULL, NULL },
   { NULL, 0, NULL, NULL, NULL, NULL }
   { NULL, 0, NULL, NULL, NULL, NULL }
 };
 };

+ 2 - 1
src/enclink.h

@@ -15,7 +15,8 @@ enum {
         LINK_GHOSTMD5, /* attic */
         LINK_GHOSTMD5, /* attic */
         LINK_CLEARTEXT,
         LINK_CLEARTEXT,
 	LINK_GHOSTCASE, /* attic */
 	LINK_GHOSTCASE, /* attic */
-	LINK_GHOSTCASE2
+	LINK_GHOSTCASE2, /* attic */
+	LINK_GHOSTCASE3
 };
 };
 enum direction_t {
 enum direction_t {
         FROM,
         FROM,

+ 1 - 1
src/main.c

@@ -397,7 +397,7 @@ static void dtx_arg(int& argc, char *argv[])
 	printf("%s\nBuild Date: %s (%s%lu%s)\n", version, date, BOLD(-1), buildts, BOLD_END(-1));
 	printf("%s\nBuild Date: %s (%s%lu%s)\n", version, date, BOLD(-1), buildts, BOLD_END(-1));
         printf("BuildOS: %s%s%s BuildArch: %s%s%s\n", BOLD(-1), BUILD_OS, BOLD_END(-1), BOLD(-1), BUILD_ARCH, BOLD_END(-1));
         printf("BuildOS: %s%s%s BuildArch: %s%s%s\n", BOLD(-1), BUILD_OS, BOLD_END(-1), BOLD(-1), BUILD_ARCH, BOLD_END(-1));
         printf("Revision: %d\n", revision);
         printf("Revision: %d\n", revision);
-	printf("pack: %d conf: %d settings_t: %d pad: %d\n", SIZE_PACK, SIZE_CONF, sizeof(settings_t), SIZE_PAD);
+	printf("pack: %d conf: %d settings_t: %d prefix: %d pad: %d\n", SIZE_PACK, SIZE_CONF, sizeof(settings_t), PREFIXLEN, SIZE_PAD);
         if (settings.uname[0]) {
         if (settings.uname[0]) {
           sdebug++;
           sdebug++;
           bin_to_conf();
           bin_to_conf();

+ 2 - 3
src/settings.h

@@ -11,7 +11,6 @@ typedef struct settings_struct {
   char hash[49];
   char hash[49];
   char packname[65];
   char packname[65];
   char shellhash[65];
   char shellhash[65];
-  char bdhash[65];
   char owners[513];
   char owners[513];
   char hubs[513];
   char hubs[513];
   char owneremail[385];
   char owneremail[385];
@@ -35,11 +34,11 @@ typedef struct settings_struct {
   char portmin[17];       /* for hubs, the reserved port range for incoming connections */
   char portmin[17];       /* for hubs, the reserved port range for incoming connections */
   char portmax[17];       /* for hubs, the reserved port range for incoming connections */
   char portmax[17];       /* for hubs, the reserved port range for incoming connections */
   /* -- PADDING -- */
   /* -- PADDING -- */
-  char padding[7];
+  char padding[8];
 } settings_t;
 } settings_t;
 
 
 #define SIZE_PACK sizeof(settings.hash) + sizeof(settings.packname) + sizeof(settings.shellhash) + \
 #define SIZE_PACK sizeof(settings.hash) + sizeof(settings.packname) + sizeof(settings.shellhash) + \
-sizeof(settings.bdhash) + sizeof(settings.owners) + sizeof(settings.hubs) + sizeof(settings.owneremail) + \
+sizeof(settings.owners) + sizeof(settings.hubs) + sizeof(settings.owneremail) + \
 sizeof(settings.salt1) + sizeof(settings.salt2) + sizeof(settings.dcc_prefix) + sizeof(settings.features)
 sizeof(settings.salt1) + sizeof(settings.salt2) + sizeof(settings.dcc_prefix) + sizeof(settings.features)
 
 
 #define SIZE_CONF sizeof(settings.bots) + sizeof(settings.uid) + sizeof(settings.autouname) + \
 #define SIZE_CONF sizeof(settings.bots) + sizeof(settings.uid) + sizeof(settings.autouname) + \