Date: Mon, 09 Feb 2004 22:27:34 -0800 From: Lev Walkin <vlm@netli.com> To: Hendrik Scholz <hscholz@raisdorf.net> Cc: freebsd-net@freebsd.org Subject: Re: remote traceroute and ping for jails Message-ID: <402879D6.70401@netli.com> In-Reply-To: <1BEABD96-5B82-11D8-A0D4-000A95BAD088@raisdorf.net> References: <1BEABD96-5B82-11D8-A0D4-000A95BAD088@raisdorf.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hendrik Scholz wrote: > Hi! > > I've just finished a quick hack to allow jails to indirectly execute ping > and traceroute by sending commands to the FreeBSD host housing the jails. > A small daemon processes the requests and sends the reply back to the > clients. > > Just grab http://www.wormulon.net/files/FreeBSD/rsocket-HEAD.tar.gz > and don't forget to modify defs.h :) > > 'features': > > - should be safe from 'hack' attempts like "traceroute 123.org;id" > - IPv6 ready ... just need to add some lines > - executes ping -c 4 and does not offer any way to modify parameters > - works for me :) > > Any comments are welcome! === cut === /* dissect into type and parameter */ param = strstr(buf, " "); if ((param != NULL) || (strstr(param, " ") != NULL)) { *param = '\0'; param++; param[strlen(param)-2] = '\0'; === cut === Suppose the buffer holds the following data: " ". param=strstr(buf, " "); will pass. param!=NULL will yield true *param++ = 0 will put \0 instead of the space. strlen(param) will yield 0. param[-2] = '\0' will write zero into... into... something... throw it off and rewirite anew. -- Lev Walkin vlm@netli.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?402879D6.70401>