Procházet zdrojové kódy

* Remove pscloak feature, it was too malicious, pointless and stupid.

This also changed the settings_t struct, requiring initialized binaries
at the next upgrade.
Bryan Drewery před 17 roky
rodič
revize
48fb052e77
9 změnil soubory, kde provedl 6 přidání a 71 odebrání
  1. 2 0
      doc/UPDATES
  2. 1 1
      doc/help.txt
  3. 0 35
      doc/responses.txt
  4. 1 4
      src/binary.c
  5. 0 2
      src/cmds.c
  6. 0 14
      src/conf.c
  7. 0 1
      src/conf.h
  8. 0 11
      src/main.c
  9. 2 3
      src/settings.h

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+Remove pscloak feature, it was too malicious, pointless and stupid.
+
 1.2.17 - http://wraith.botpack.net/milestone/1.2.17
 1.2.17 - http://wraith.botpack.net/milestone/1.2.17
 * Binary pass prompt has been changed to be more clear.
 * Binary pass prompt has been changed to be more clear.
 * Fix uname checking on NetBSD and OpenBSD
 * Fix uname checking on NetBSD and OpenBSD

+ 1 - 1
doc/help.txt

@@ -740,7 +740,7 @@ See also: console, echo, login, page, strip
       WARNING: Options changed MAY OR MAY NOT affect bots already running,
       WARNING: Options changed MAY OR MAY NOT affect bots already running,
                it is a good idea to restart all bots on the shell
                it is a good idea to restart all bots on the shell
                if you change any of the following: 
                if you change any of the following: 
-    $bhomedir$b, $bbinpath$b, $bbinname$b, $bportmin$b, $bportmax$b, $bpscloak$b
+    $bhomedir$b, $bbinpath$b, $bbinname$b, $bportmin$b, $bportmax$b
  
  
 See also: newleaf
 See also: newleaf
 ::console:
 ::console:

+ 0 - 35
doc/responses.txt

@@ -249,41 +249,6 @@
  reporting you for spam.
  reporting you for spam.
  Congratulations, prick, you've just made my ignore list. Was it worth it to you to make your 'witty' comments and snide in-jokes to your irc pals about me if it meant you are now disappeared from my online experience? Have a nice life.
  Congratulations, prick, you've just made my ignore list. Was it worth it to you to make your 'witty' comments and snide in-jokes to your irc pals about me if it meant you are now disappeared from my online experience? Have a nice life.
  brb getting u glined
  brb getting u glined
-:pscloak
- -bash
- ftp
- /usr/sbin/sshd
- man
- pine
- bash
- top
- last
- w
- ps ux
- bash
- ./psybnc
- BitchX
- who
- irssi
- sh
- -sh
- screen -r
- -screen
- -SCREEN
- pico
- vi
- eggdrop
- ./eggdrop
- lynx
- ssh-agent
- epic (epic-EPIC4-2.2)
- screen epic
- screen BitchX
- screen irssi
- ezbnc
- ./bnc
- ./sbnc
- /usr/bin/bash
 :mIRCver
 :mIRCver
  5.91
  5.91
  6.01
  6.01

+ 1 - 4
src/binary.c

@@ -32,7 +32,7 @@ settings_t settings = {
   /* -- STATIC -- */
   /* -- STATIC -- */
   "", "", "", "", "", "", "", "", "", "",
   "", "", "", "", "", "", "", "", "", "",
   /* -- DYNAMIC -- */
   /* -- DYNAMIC -- */
-  "", "", "", "", "", "", "", "", "", "", "", "", "", "",
+  "", "", "", "", "", "", "", "", "", "", "", "", "",
   /* -- PADDING */
   /* -- PADDING */
   ""
   ""
 };
 };
@@ -460,7 +460,6 @@ static void edpack(settings_t *incfg, const char *in_hash, int what)
   dofield(incfg->bots);
   dofield(incfg->bots);
   dofield(incfg->uid);
   dofield(incfg->uid);
   dofield(incfg->autouname);
   dofield(incfg->autouname);
-  dofield(incfg->pscloak);
   dofield(incfg->autocron);
   dofield(incfg->autocron);
   dofield(incfg->watcher);
   dofield(incfg->watcher);
   dofield(incfg->uname);
   dofield(incfg->uname);
@@ -499,7 +498,6 @@ tellconfig(settings_t *incfg)
   dofield(incfg->bots);
   dofield(incfg->bots);
   dofield(incfg->uid);
   dofield(incfg->uid);
   dofield(incfg->autouname);
   dofield(incfg->autouname);
-  dofield(incfg->pscloak);
   dofield(incfg->autocron);
   dofield(incfg->autocron);
   dofield(incfg->watcher);
   dofield(incfg->watcher);
   dofield(incfg->uname);
   dofield(incfg->uname);
@@ -636,7 +634,6 @@ void conf_to_bin(conf_t *in, bool move, int die)
   simple_snprintf(settings.autouname, sizeof(settings.autouname), "%d", in->autouname);
   simple_snprintf(settings.autouname, sizeof(settings.autouname), "%d", in->autouname);
   simple_snprintf(settings.portmin, sizeof(settings.portmin), "%d", in->portmin);
   simple_snprintf(settings.portmin, sizeof(settings.portmin), "%d", in->portmin);
   simple_snprintf(settings.portmax, sizeof(settings.portmax), "%d", in->portmax);
   simple_snprintf(settings.portmax, sizeof(settings.portmax), "%d", in->portmax);
-  simple_snprintf(settings.pscloak, sizeof(settings.pscloak), "%d", in->pscloak);
 
 
   strlcpy(settings.binname, in->binname, sizeof(settings.binname));
   strlcpy(settings.binname, in->binname, sizeof(settings.binname));
   if (in->username)
   if (in->username)

+ 0 - 2
src/cmds.c

@@ -1756,7 +1756,6 @@ static void cmd_conf(int idx, char *par)
         else if (!egg_strcasecmp(what, "datadir"))   str_redup(&conf.datadir, par);
         else if (!egg_strcasecmp(what, "datadir"))   str_redup(&conf.datadir, par);
         else if (!egg_strcasecmp(what, "portmin"))   conf.portmin = atoi(par);
         else if (!egg_strcasecmp(what, "portmin"))   conf.portmin = atoi(par);
         else if (!egg_strcasecmp(what, "portmax"))   conf.portmax = atoi(par);
         else if (!egg_strcasecmp(what, "portmax"))   conf.portmax = atoi(par);
-        else if (!egg_strcasecmp(what, "pscloak"))   conf.pscloak = atoi(par);
         else if (!egg_strcasecmp(what, "autocron"))  conf.autocron = atoi(par);
         else if (!egg_strcasecmp(what, "autocron"))  conf.autocron = atoi(par);
         else if (!egg_strcasecmp(what, "autouname")) conf.autouname = atoi(par);
         else if (!egg_strcasecmp(what, "autouname")) conf.autouname = atoi(par);
         else if (!egg_strcasecmp(what, "watcher"))  conf.watcher = atoi(par);
         else if (!egg_strcasecmp(what, "watcher"))  conf.watcher = atoi(par);
@@ -1780,7 +1779,6 @@ static void cmd_conf(int idx, char *par)
       if (!what || !egg_strcasecmp(what, "datadir"))    dprintf(idx, "%sdatadir: %s\n", ss, conf.datadir);
       if (!what || !egg_strcasecmp(what, "datadir"))    dprintf(idx, "%sdatadir: %s\n", ss, conf.datadir);
       if (!what || !egg_strcasecmp(what, "portmin"))    dprintf(idx, "%sportmin: %d\n", ss, conf.portmin);
       if (!what || !egg_strcasecmp(what, "portmin"))    dprintf(idx, "%sportmin: %d\n", ss, conf.portmin);
       if (!what || !egg_strcasecmp(what, "portmax"))    dprintf(idx, "%sportmax: %d\n", ss, conf.portmax);
       if (!what || !egg_strcasecmp(what, "portmax"))    dprintf(idx, "%sportmax: %d\n", ss, conf.portmax);
-      if (!what || !egg_strcasecmp(what, "pscloak"))    dprintf(idx, "%spscloak: %d\n", ss, conf.pscloak);
       if (!what || !egg_strcasecmp(what, "autocron"))   dprintf(idx, "%sautocron: %d\n", ss, conf.autocron);
       if (!what || !egg_strcasecmp(what, "autocron"))   dprintf(idx, "%sautocron: %d\n", ss, conf.autocron);
       if (!what || !egg_strcasecmp(what, "autouname"))  dprintf(idx, "%sautouname: %d\n", ss, conf.autouname);
       if (!what || !egg_strcasecmp(what, "autouname"))  dprintf(idx, "%sautouname: %d\n", ss, conf.autouname);
       if (!what || !egg_strcasecmp(what, "watcher"))    dprintf(idx, "%swatcher: %d\n", ss, conf.watcher);
       if (!what || !egg_strcasecmp(what, "watcher"))    dprintf(idx, "%swatcher: %d\n", ss, conf.watcher);

+ 0 - 14
src/conf.c

@@ -56,7 +56,6 @@ tellconf()
   sdprintf(STR("datadir: %s\n"), replace(conf.datadir, conf.homedir, "~"));
   sdprintf(STR("datadir: %s\n"), replace(conf.datadir, conf.homedir, "~"));
   sdprintf(STR("portmin: %d\n"), conf.portmin);
   sdprintf(STR("portmin: %d\n"), conf.portmin);
   sdprintf(STR("portmax: %d\n"), conf.portmax);
   sdprintf(STR("portmax: %d\n"), conf.portmax);
-  sdprintf(STR("pscloak: %d\n"), conf.pscloak);
   sdprintf(STR("autocron: %d\n"), conf.autocron);
   sdprintf(STR("autocron: %d\n"), conf.autocron);
   sdprintf(STR("autouname: %d\n"), conf.autouname);
   sdprintf(STR("autouname: %d\n"), conf.autouname);
   sdprintf(STR("watcher: %d\n"), conf.watcher);
   sdprintf(STR("watcher: %d\n"), conf.watcher);
@@ -389,7 +388,6 @@ init_conf()
   conf.features = 0;
   conf.features = 0;
   conf.portmin = 0;
   conf.portmin = 0;
   conf.portmax = 0;
   conf.portmax = 0;
-  conf.pscloak = 0;
   conf.uid = -1;
   conf.uid = -1;
   conf.uname = NULL;
   conf.uname = NULL;
   conf.username = NULL;
   conf.username = NULL;
@@ -751,10 +749,6 @@ readconf(const char *fname, int bits)
           if (egg_isdigit(line[0]))
           if (egg_isdigit(line[0]))
             conf.portmax = atoi(line);
             conf.portmax = atoi(line);
 
 
-        } else if (!egg_strcasecmp(option, STR("pscloak"))) {        /* should bots on this shell pscloak? */
-          if (egg_isdigit(line[0]))
-            conf.pscloak = atoi(line);
-
         } else if (!egg_strcasecmp(option, STR("uid"))) {    /* new method uid */
         } else if (!egg_strcasecmp(option, STR("uid"))) {    /* new method uid */
           if (str_isdigit(line))
           if (str_isdigit(line))
             conf.uid = atoi(line);
             conf.uid = atoi(line);
@@ -928,13 +922,6 @@ writeconf(char *filename, FILE * stream, int bits)
   }
   }
 
 
 
 
-  if (conf.pscloak) {
-    comment("# Attempt to \"cloak\" the process name in `ps` for Linux?");
-    my_write(f, STR("! pscloak %d\n"), conf.pscloak);
-
-    comment("");
-  }
-
   if (conf.autocron == 0) {
   if (conf.autocron == 0) {
     comment("# Automatically add the bot to crontab?");
     comment("# Automatically add the bot to crontab?");
     my_write(f, STR("! autocron %d\n"), conf.autocron);
     my_write(f, STR("! autocron %d\n"), conf.autocron);
@@ -1102,7 +1089,6 @@ bin_to_conf(bool error)
   conf.autouname = atoi(settings.autouname);
   conf.autouname = atoi(settings.autouname);
   conf.autocron = atoi(settings.autocron);
   conf.autocron = atoi(settings.autocron);
   conf.watcher = atoi(settings.watcher);
   conf.watcher = atoi(settings.watcher);
-  conf.pscloak = atoi(settings.pscloak);
 
 
 
 
   prep_homedir(error);
   prep_homedir(error);

+ 0 - 1
src/conf.h

@@ -33,7 +33,6 @@ typedef struct conf_b {
   int features;		/* Pack features (take, mdop, beta... etc..) */
   int features;		/* Pack features (take, mdop, beta... etc..) */
   int uid;
   int uid;
   int autouname;        /* should we just auto update any changed in uname output? */
   int autouname;        /* should we just auto update any changed in uname output? */
-  int pscloak;          /* should the bots bother trying to cloak `ps`? */
   int autocron;         /* should the bot auto crontab itself? */
   int autocron;         /* should the bot auto crontab itself? */
   int watcher;		/* spawn a watcher pid to block ptrace? */
   int watcher;		/* spawn a watcher pid to block ptrace? */
   char *localhub;	/* my localhub */
   char *localhub;	/* my localhub */

+ 0 - 11
src/main.c

@@ -843,17 +843,6 @@ printf("out: %s\n", out);
     check_crontab();
     check_crontab();
 #endif /* !CYGWIN_HACKS */
 #endif /* !CYGWIN_HACKS */
 
 
-#ifdef __linux__
-  if (conf.pscloak) {
-    const char *p = response(RES_PSCLOAK);
-
-    for (int argi = 0; argi < argc; argi++)
-      egg_memset(argv[argi], 0, strlen(argv[argi]));
-
-    strcpy(argv[0], p);
-  }
-#endif /* __linux_ */
-
   /* Move into background? */
   /* Move into background? */
   /* we don't split cygwin because to run as a service the bot shouldn't exit.
   /* we don't split cygwin because to run as a service the bot shouldn't exit.
      confuses windows ;)
      confuses windows ;)

+ 2 - 3
src/settings.h

@@ -22,7 +22,6 @@ typedef struct settings_struct {
   char bots[1025];
   char bots[1025];
   char uid[17];
   char uid[17];
   char autouname[17];        /* should we just auto update any changed in uname output? */
   char autouname[17];        /* should we just auto update any changed in uname output? */
-  char pscloak[17];          /* should the bots bother trying to cloak `ps`? */
   char autocron[17];         /* should the bot auto crontab itself? */
   char autocron[17];         /* should the bot auto crontab itself? */
   char watcher[17];          /* spawn a watcher pid to block ptrace? */
   char watcher[17];          /* spawn a watcher pid to block ptrace? */
   char uname[113];
   char uname[113];
@@ -34,7 +33,7 @@ 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[8];
+  char padding[9];
 } settings_t;
 } settings_t;
 
 
 #define SALT1 {s1_1[0],s1_1[1],s1_5[0],s1_5[1],s1_8[0],s1_8[1],s1_4[0],s1_9[1],s1_2[0],s1_13[0],s1_6[0],s1_6[1],s1_7[0],s1_7[1],s1_3[0],s1_13[1],s1_16[1],s1_4[1],s1_15[0],s1_10[1],s1_14[0],s1_14[1],s1_12[0],s1_12[1],s1_2[1],s1_3[1],s1_11[0],s1_11[1],s1_10[0],s1_15[1],s1_16[0],s1_9[0],'\0'}
 #define SALT1 {s1_1[0],s1_1[1],s1_5[0],s1_5[1],s1_8[0],s1_8[1],s1_4[0],s1_9[1],s1_2[0],s1_13[0],s1_6[0],s1_6[1],s1_7[0],s1_7[1],s1_3[0],s1_13[1],s1_16[1],s1_4[1],s1_15[0],s1_10[1],s1_14[0],s1_14[1],s1_12[0],s1_12[1],s1_2[1],s1_3[1],s1_11[0],s1_11[1],s1_10[0],s1_15[1],s1_16[0],s1_9[0],'\0'}
@@ -49,7 +48,7 @@ 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) + \
-sizeof(settings.pscloak) + sizeof(settings.autocron) + sizeof(settings.watcher) + sizeof(settings.uname) + \
+sizeof(settings.autocron) + sizeof(settings.watcher) + sizeof(settings.uname) + \
 sizeof(settings.username) + sizeof(settings.homedir) + sizeof(settings.binpath) + sizeof(settings.binname) + \
 sizeof(settings.username) + sizeof(settings.homedir) + sizeof(settings.binpath) + sizeof(settings.binname) + \
 sizeof(settings.portmin) + sizeof(settings.portmin) + sizeof(settings.datadir)
 sizeof(settings.portmin) + sizeof(settings.portmin) + sizeof(settings.datadir)